Lines Matching refs:sb

106 static int ocfs2_parse_options(struct super_block *sb, char *options,
109 static int ocfs2_check_set_options(struct super_block *sb,
112 static void ocfs2_put_super(struct super_block *sb);
113 static int ocfs2_mount_volume(struct super_block *sb);
114 static int ocfs2_remount(struct super_block *sb, int *flags, char *data);
115 static void ocfs2_dismount_volume(struct super_block *sb, int mnt_err);
122 static int ocfs2_sync_fs(struct super_block *sb, int wait);
132 static int ocfs2_initialize_super(struct super_block *sb,
136 static int ocfs2_get_sector(struct super_block *sb,
140 static struct inode *ocfs2_alloc_inode(struct super_block *sb);
249 osb->sb->s_blocksize, osb->s_clustersize); in ocfs2_osb_dump()
410 static int ocfs2_sync_fs(struct super_block *sb, int wait) in ocfs2_sync_fs() argument
414 struct ocfs2_super *osb = OCFS2_SB(sb); in ocfs2_sync_fs()
427 if (jbd2_journal_start_commit(OCFS2_SB(sb)->journal->j_journal, in ocfs2_sync_fs()
430 jbd2_log_wait_commit(OCFS2_SB(sb)->journal->j_journal, in ocfs2_sync_fs()
438 if (!OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, OCFS2_FEATURE_RO_COMPAT_USRQUOTA) in ocfs2_need_system_inode()
442 if (!OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, OCFS2_FEATURE_RO_COMPAT_GRPQUOTA) in ocfs2_need_system_inode()
564 static struct inode *ocfs2_alloc_inode(struct super_block *sb) in ocfs2_alloc_inode() argument
638 static int ocfs2_remount(struct super_block *sb, int *flags, char *data) in ocfs2_remount() argument
643 struct ocfs2_super *osb = OCFS2_SB(sb); in ocfs2_remount()
646 sync_filesystem(sb); in ocfs2_remount()
648 if (!ocfs2_parse_options(sb, data, &parsed_options, 1) || in ocfs2_remount()
649 !ocfs2_check_set_options(sb, &parsed_options)) { in ocfs2_remount()
679 if ((*flags & MS_RDONLY) != (sb->s_flags & MS_RDONLY)) { in ocfs2_remount()
696 sb->s_flags |= MS_RDONLY; in ocfs2_remount()
705 incompat_features = OCFS2_HAS_RO_COMPAT_FEATURE(sb, ~OCFS2_FEATURE_RO_COMPAT_SUPP); in ocfs2_remount()
713 sb->s_flags &= ~MS_RDONLY; in ocfs2_remount()
716 trace_ocfs2_remount(sb->s_flags, osb->osb_flags, *flags); in ocfs2_remount()
721 if (sb_any_quota_suspended(sb)) in ocfs2_remount()
728 sb->s_flags |= MS_RDONLY; in ocfs2_remount()
748 sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | in ocfs2_remount()
756 static int ocfs2_sb_probe(struct super_block *sb, in ocfs2_sb_probe() argument
769 *sector_size = bdev_logical_block_size(sb->s_bdev); in ocfs2_sb_probe()
782 status = ocfs2_get_sector(sb, bh, 0, *sector_size); in ocfs2_sb_probe()
816 tmpstat = ocfs2_get_sector(sb, bh, in ocfs2_sb_probe()
910 struct super_block *sb = osb->sb; in ocfs2_susp_quotas() local
917 if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type])) in ocfs2_susp_quotas()
920 status = dquot_resume(sb, type); in ocfs2_susp_quotas()
925 oinfo = sb_dqinfo(sb, type)->dqi_priv; in ocfs2_susp_quotas()
927 status = dquot_suspend(sb, type); in ocfs2_susp_quotas()
941 struct super_block *sb = osb->sb; in ocfs2_enable_quotas() local
951 sb_dqopt(sb)->flags |= DQUOT_QUOTA_SYS_FILE | DQUOT_NEGATIVE_USAGE; in ocfs2_enable_quotas()
953 if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type])) in ocfs2_enable_quotas()
982 struct super_block *sb = osb->sb; in ocfs2_disable_quotas() local
988 if (!sb_has_quota_loaded(sb, type)) in ocfs2_disable_quotas()
991 oinfo = sb_dqinfo(sb, type)->dqi_priv; in ocfs2_disable_quotas()
993 inode = igrab(sb->s_dquot.files[type]); in ocfs2_disable_quotas()
997 dquot_disable(sb, type, DQUOT_USAGE_ENABLED | in ocfs2_disable_quotas()
1005 static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) in ocfs2_fill_super() argument
1016 trace_ocfs2_fill_super(sb, data, silent); in ocfs2_fill_super()
1018 if (!ocfs2_parse_options(sb, data, &parsed_options, 0)) { in ocfs2_fill_super()
1024 status = ocfs2_sb_probe(sb, &bh, &sector_size, &stats); in ocfs2_fill_super()
1030 status = ocfs2_initialize_super(sb, bh, sector_size, &stats); in ocfs2_fill_super()
1031 osb = OCFS2_SB(sb); in ocfs2_fill_super()
1039 if (!ocfs2_check_set_options(sb, &parsed_options)) { in ocfs2_fill_super()
1060 sb->s_magic = OCFS2_SUPER_MAGIC; in ocfs2_fill_super()
1062 sb->s_flags = (sb->s_flags & ~(MS_POSIXACL | MS_NOSEC)) | in ocfs2_fill_super()
1067 if (bdev_read_only(sb->s_bdev)) { in ocfs2_fill_super()
1068 if (!(sb->s_flags & MS_RDONLY)) { in ocfs2_fill_super()
1103 if (sb->s_flags & MS_RDONLY) in ocfs2_fill_super()
1143 status = ocfs2_mount_volume(sb); in ocfs2_fill_super()
1163 sb->s_root = root; in ocfs2_fill_super()
1184 if (!(sb->s_flags & MS_RDONLY)) { in ocfs2_fill_super()
1213 ocfs2_dismount_volume(sb, 1); in ocfs2_fill_super()
1239 static int ocfs2_check_set_options(struct super_block *sb, in ocfs2_check_set_options() argument
1243 !OCFS2_HAS_RO_COMPAT_FEATURE(sb, in ocfs2_check_set_options()
1250 !OCFS2_HAS_RO_COMPAT_FEATURE(sb, in ocfs2_check_set_options()
1257 !OCFS2_HAS_INCOMPAT_FEATURE(sb, OCFS2_FEATURE_INCOMPAT_XATTR)) { in ocfs2_check_set_options()
1265 if (OCFS2_HAS_INCOMPAT_FEATURE(sb, OCFS2_FEATURE_INCOMPAT_XATTR)) in ocfs2_check_set_options()
1273 static int ocfs2_parse_options(struct super_block *sb, in ocfs2_parse_options() argument
1655 static void ocfs2_put_super(struct super_block *sb) in ocfs2_put_super() argument
1657 trace_ocfs2_put_super(sb); in ocfs2_put_super()
1659 ocfs2_sync_blockdev(sb); in ocfs2_put_super()
1660 ocfs2_dismount_volume(sb, 0); in ocfs2_put_super()
1700 (osb->s_clustersize >> osb->sb->s_blocksize_bits); in ocfs2_statfs()
1702 (osb->s_clustersize >> osb->sb->s_blocksize_bits); in ocfs2_statfs()
1810 static int ocfs2_get_sector(struct super_block *sb, in ocfs2_get_sector() argument
1815 if (!sb_set_blocksize(sb, sect_size)) { in ocfs2_get_sector()
1820 *bh = sb_getblk(sb, block); in ocfs2_get_sector()
1841 static int ocfs2_mount_volume(struct super_block *sb) in ocfs2_mount_volume() argument
1845 struct ocfs2_super *osb = OCFS2_SB(sb); in ocfs2_mount_volume()
1894 static void ocfs2_dismount_volume(struct super_block *sb, int mnt_err) in ocfs2_dismount_volume() argument
1900 trace_ocfs2_dismount_volume(sb); in ocfs2_dismount_volume()
1902 BUG_ON(!sb); in ocfs2_dismount_volume()
1903 osb = OCFS2_SB(sb); in ocfs2_dismount_volume()
1927 ocfs2_sync_blockdev(sb); in ocfs2_dismount_volume()
1980 sb->s_dev = 0; in ocfs2_dismount_volume()
1981 sb->s_fs_info = NULL; in ocfs2_dismount_volume()
2015 ocfs2_clusters_to_blocks(osb->sb, in ocfs2_journal_addressable()
2024 if (!(OCFS2_HAS_COMPAT_FEATURE(osb->sb, in ocfs2_journal_addressable()
2038 static int ocfs2_initialize_super(struct super_block *sb, in ocfs2_initialize_super() argument
2058 sb->s_fs_info = osb; in ocfs2_initialize_super()
2059 sb->s_op = &ocfs2_sops; in ocfs2_initialize_super()
2060 sb->s_d_op = &ocfs2_dentry_ops; in ocfs2_initialize_super()
2061 sb->s_export_op = &ocfs2_export_ops; in ocfs2_initialize_super()
2062 sb->s_qcop = &dquot_quotactl_sysfile_ops; in ocfs2_initialize_super()
2063 sb->dq_op = &ocfs2_quota_operations; in ocfs2_initialize_super()
2064 sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP; in ocfs2_initialize_super()
2065 sb->s_xattr = ocfs2_xattr_handlers; in ocfs2_initialize_super()
2066 sb->s_time_gran = 1; in ocfs2_initialize_super()
2067 sb->s_flags |= MS_NOATIME; in ocfs2_initialize_super()
2071 sb->s_maxbytes = ocfs2_max_file_offset(bbits, cbits); in ocfs2_initialize_super()
2072 memcpy(sb->s_uuid, di->id2.i_super.s_uuid, in ocfs2_initialize_super()
2081 osb->sb = sb; in ocfs2_initialize_super()
2110 MAJOR(osb->sb->s_dev), MINOR(osb->sb->s_dev)); in ocfs2_initialize_super()
2185 if ((i = OCFS2_HAS_INCOMPAT_FEATURE(osb->sb, ~OCFS2_FEATURE_INCOMPAT_SUPP))) { in ocfs2_initialize_super()
2191 if (!(osb->sb->s_flags & MS_RDONLY) && in ocfs2_initialize_super()
2192 (i = OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, ~OCFS2_FEATURE_RO_COMPAT_SUPP))) { in ocfs2_initialize_super()
2267 total_blocks = ocfs2_clusters_to_blocks(osb->sb, in ocfs2_initialize_super()
2270 status = generic_check_addressable(osb->sb->s_blocksize_bits, in ocfs2_initialize_super()
2330 osb->bitmap_cpg = ocfs2_group_bitmap_size(sb, 0, in ocfs2_initialize_super()
2338 cleancache_init_shared_fs(sb); in ocfs2_initialize_super()
2546 static void ocfs2_handle_error(struct super_block *sb) in ocfs2_handle_error() argument
2548 struct ocfs2_super *osb = OCFS2_SB(sb); in ocfs2_handle_error()
2552 sb->s_id); in ocfs2_handle_error()
2556 if (sb->s_flags & MS_RDONLY && in ocfs2_handle_error()
2564 sb->s_flags |= MS_RDONLY; in ocfs2_handle_error()
2568 void __ocfs2_error(struct super_block *sb, const char *function, in __ocfs2_error() argument
2581 sb->s_id, function, &vaf); in __ocfs2_error()
2585 ocfs2_handle_error(sb); in __ocfs2_error()
2591 void __ocfs2_abort(struct super_block *sb, const char *function, in __ocfs2_abort() argument
2603 sb->s_id, function, &vaf); in __ocfs2_abort()
2618 if (!ocfs2_mount_local(OCFS2_SB(sb))) in __ocfs2_abort()
2619 OCFS2_SB(sb)->s_mount_opt |= OCFS2_MOUNT_ERRORS_PANIC; in __ocfs2_abort()
2620 ocfs2_handle_error(sb); in __ocfs2_abort()