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);
251 osb->sb->s_blocksize, osb->s_clustersize); in ocfs2_osb_dump()
412 static int ocfs2_sync_fs(struct super_block *sb, int wait) in ocfs2_sync_fs() argument
416 struct ocfs2_super *osb = OCFS2_SB(sb); in ocfs2_sync_fs()
429 if (jbd2_journal_start_commit(OCFS2_SB(sb)->journal->j_journal, in ocfs2_sync_fs()
432 jbd2_log_wait_commit(OCFS2_SB(sb)->journal->j_journal, in ocfs2_sync_fs()
440 if (!OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, OCFS2_FEATURE_RO_COMPAT_USRQUOTA) in ocfs2_need_system_inode()
444 if (!OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, OCFS2_FEATURE_RO_COMPAT_GRPQUOTA) in ocfs2_need_system_inode()
566 static struct inode *ocfs2_alloc_inode(struct super_block *sb) in ocfs2_alloc_inode() argument
640 static int ocfs2_remount(struct super_block *sb, int *flags, char *data) in ocfs2_remount() argument
645 struct ocfs2_super *osb = OCFS2_SB(sb); in ocfs2_remount()
648 sync_filesystem(sb); in ocfs2_remount()
650 if (!ocfs2_parse_options(sb, data, &parsed_options, 1) || in ocfs2_remount()
651 !ocfs2_check_set_options(sb, &parsed_options)) { in ocfs2_remount()
681 if ((*flags & MS_RDONLY) != (sb->s_flags & MS_RDONLY)) { in ocfs2_remount()
698 sb->s_flags |= MS_RDONLY; in ocfs2_remount()
707 incompat_features = OCFS2_HAS_RO_COMPAT_FEATURE(sb, ~OCFS2_FEATURE_RO_COMPAT_SUPP); in ocfs2_remount()
715 sb->s_flags &= ~MS_RDONLY; in ocfs2_remount()
718 trace_ocfs2_remount(sb->s_flags, osb->osb_flags, *flags); in ocfs2_remount()
723 if (sb_any_quota_suspended(sb)) in ocfs2_remount()
730 sb->s_flags |= MS_RDONLY; in ocfs2_remount()
750 sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | in ocfs2_remount()
758 static int ocfs2_sb_probe(struct super_block *sb, in ocfs2_sb_probe() argument
771 *sector_size = bdev_logical_block_size(sb->s_bdev); in ocfs2_sb_probe()
784 status = ocfs2_get_sector(sb, bh, 0, *sector_size); in ocfs2_sb_probe()
818 tmpstat = ocfs2_get_sector(sb, bh, in ocfs2_sb_probe()
912 struct super_block *sb = osb->sb; in ocfs2_susp_quotas() local
919 if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type])) in ocfs2_susp_quotas()
922 status = dquot_resume(sb, type); in ocfs2_susp_quotas()
927 oinfo = sb_dqinfo(sb, type)->dqi_priv; in ocfs2_susp_quotas()
929 status = dquot_suspend(sb, type); in ocfs2_susp_quotas()
943 struct super_block *sb = osb->sb; in ocfs2_enable_quotas() local
953 sb_dqopt(sb)->flags |= DQUOT_QUOTA_SYS_FILE | DQUOT_NEGATIVE_USAGE; in ocfs2_enable_quotas()
955 if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type])) in ocfs2_enable_quotas()
984 struct super_block *sb = osb->sb; in ocfs2_disable_quotas() local
990 if (!sb_has_quota_loaded(sb, type)) in ocfs2_disable_quotas()
993 oinfo = sb_dqinfo(sb, type)->dqi_priv; in ocfs2_disable_quotas()
995 inode = igrab(sb->s_dquot.files[type]); in ocfs2_disable_quotas()
999 dquot_disable(sb, type, DQUOT_USAGE_ENABLED | in ocfs2_disable_quotas()
1007 static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) in ocfs2_fill_super() argument
1018 trace_ocfs2_fill_super(sb, data, silent); in ocfs2_fill_super()
1020 if (!ocfs2_parse_options(sb, data, &parsed_options, 0)) { in ocfs2_fill_super()
1026 status = ocfs2_sb_probe(sb, &bh, §or_size, &stats); in ocfs2_fill_super()
1032 status = ocfs2_initialize_super(sb, bh, sector_size, &stats); in ocfs2_fill_super()
1033 osb = OCFS2_SB(sb); in ocfs2_fill_super()
1041 if (!ocfs2_check_set_options(sb, &parsed_options)) { in ocfs2_fill_super()
1062 sb->s_magic = OCFS2_SUPER_MAGIC; in ocfs2_fill_super()
1064 sb->s_flags = (sb->s_flags & ~(MS_POSIXACL | MS_NOSEC)) | in ocfs2_fill_super()
1069 if (bdev_read_only(sb->s_bdev)) { in ocfs2_fill_super()
1070 if (!(sb->s_flags & MS_RDONLY)) { in ocfs2_fill_super()
1105 if (sb->s_flags & MS_RDONLY) in ocfs2_fill_super()
1145 status = ocfs2_mount_volume(sb); in ocfs2_fill_super()
1165 sb->s_root = root; in ocfs2_fill_super()
1186 if (!(sb->s_flags & MS_RDONLY)) { in ocfs2_fill_super()
1215 ocfs2_dismount_volume(sb, 1); in ocfs2_fill_super()
1241 static int ocfs2_check_set_options(struct super_block *sb, in ocfs2_check_set_options() argument
1245 !OCFS2_HAS_RO_COMPAT_FEATURE(sb, in ocfs2_check_set_options()
1252 !OCFS2_HAS_RO_COMPAT_FEATURE(sb, in ocfs2_check_set_options()
1259 !OCFS2_HAS_INCOMPAT_FEATURE(sb, OCFS2_FEATURE_INCOMPAT_XATTR)) { in ocfs2_check_set_options()
1267 if (OCFS2_HAS_INCOMPAT_FEATURE(sb, OCFS2_FEATURE_INCOMPAT_XATTR)) in ocfs2_check_set_options()
1275 static int ocfs2_parse_options(struct super_block *sb, in ocfs2_parse_options() argument
1668 static void ocfs2_put_super(struct super_block *sb) in ocfs2_put_super() argument
1670 trace_ocfs2_put_super(sb); in ocfs2_put_super()
1672 ocfs2_sync_blockdev(sb); in ocfs2_put_super()
1673 ocfs2_dismount_volume(sb, 0); in ocfs2_put_super()
1713 (osb->s_clustersize >> osb->sb->s_blocksize_bits); in ocfs2_statfs()
1715 (osb->s_clustersize >> osb->sb->s_blocksize_bits); in ocfs2_statfs()
1821 static int ocfs2_get_sector(struct super_block *sb, in ocfs2_get_sector() argument
1826 if (!sb_set_blocksize(sb, sect_size)) { in ocfs2_get_sector()
1831 *bh = sb_getblk(sb, block); in ocfs2_get_sector()
1852 static int ocfs2_mount_volume(struct super_block *sb) in ocfs2_mount_volume() argument
1856 struct ocfs2_super *osb = OCFS2_SB(sb); in ocfs2_mount_volume()
1905 static void ocfs2_dismount_volume(struct super_block *sb, int mnt_err) in ocfs2_dismount_volume() argument
1911 trace_ocfs2_dismount_volume(sb); in ocfs2_dismount_volume()
1913 BUG_ON(!sb); in ocfs2_dismount_volume()
1914 osb = OCFS2_SB(sb); in ocfs2_dismount_volume()
1938 ocfs2_sync_blockdev(sb); in ocfs2_dismount_volume()
1991 sb->s_dev = 0; in ocfs2_dismount_volume()
1992 sb->s_fs_info = NULL; in ocfs2_dismount_volume()
2026 ocfs2_clusters_to_blocks(osb->sb, in ocfs2_journal_addressable()
2035 if (!(OCFS2_HAS_COMPAT_FEATURE(osb->sb, in ocfs2_journal_addressable()
2049 static int ocfs2_initialize_super(struct super_block *sb, in ocfs2_initialize_super() argument
2069 sb->s_fs_info = osb; in ocfs2_initialize_super()
2070 sb->s_op = &ocfs2_sops; in ocfs2_initialize_super()
2071 sb->s_d_op = &ocfs2_dentry_ops; in ocfs2_initialize_super()
2072 sb->s_export_op = &ocfs2_export_ops; in ocfs2_initialize_super()
2073 sb->s_qcop = &dquot_quotactl_sysfile_ops; in ocfs2_initialize_super()
2074 sb->dq_op = &ocfs2_quota_operations; in ocfs2_initialize_super()
2075 sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP; in ocfs2_initialize_super()
2076 sb->s_xattr = ocfs2_xattr_handlers; in ocfs2_initialize_super()
2077 sb->s_time_gran = 1; in ocfs2_initialize_super()
2078 sb->s_flags |= MS_NOATIME; in ocfs2_initialize_super()
2082 sb->s_maxbytes = ocfs2_max_file_offset(bbits, cbits); in ocfs2_initialize_super()
2083 memcpy(sb->s_uuid, di->id2.i_super.s_uuid, in ocfs2_initialize_super()
2092 osb->sb = sb; in ocfs2_initialize_super()
2121 MAJOR(osb->sb->s_dev), MINOR(osb->sb->s_dev)); in ocfs2_initialize_super()
2196 if ((i = OCFS2_HAS_INCOMPAT_FEATURE(osb->sb, ~OCFS2_FEATURE_INCOMPAT_SUPP))) { in ocfs2_initialize_super()
2202 if (!(osb->sb->s_flags & MS_RDONLY) && in ocfs2_initialize_super()
2203 (i = OCFS2_HAS_RO_COMPAT_FEATURE(osb->sb, ~OCFS2_FEATURE_RO_COMPAT_SUPP))) { in ocfs2_initialize_super()
2278 total_blocks = ocfs2_clusters_to_blocks(osb->sb, in ocfs2_initialize_super()
2281 status = generic_check_addressable(osb->sb->s_blocksize_bits, in ocfs2_initialize_super()
2341 osb->bitmap_cpg = ocfs2_group_bitmap_size(sb, 0, in ocfs2_initialize_super()
2349 cleancache_init_shared_fs(sb); in ocfs2_initialize_super()
2561 static int ocfs2_handle_error(struct super_block *sb) in ocfs2_handle_error() argument
2563 struct ocfs2_super *osb = OCFS2_SB(sb); in ocfs2_handle_error()
2572 sb->s_id); in ocfs2_handle_error()
2578 if (sb->s_flags & MS_RDONLY && in ocfs2_handle_error()
2584 sb->s_flags |= MS_RDONLY; in ocfs2_handle_error()
2591 int __ocfs2_error(struct super_block *sb, const char *function, in __ocfs2_error() argument
2604 sb->s_id, function, &vaf); in __ocfs2_error()
2608 return ocfs2_handle_error(sb); in __ocfs2_error()
2614 void __ocfs2_abort(struct super_block *sb, const char *function, in __ocfs2_abort() argument
2626 sb->s_id, function, &vaf); in __ocfs2_abort()
2641 if (!ocfs2_mount_local(OCFS2_SB(sb))) in __ocfs2_abort()
2642 OCFS2_SB(sb)->s_mount_opt |= OCFS2_MOUNT_ERRORS_PANIC; in __ocfs2_abort()
2643 ocfs2_handle_error(sb); in __ocfs2_abort()