aboutsummaryrefslogtreecommitdiffstats
path: root/fs/super.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-05-19 07:16:40 -0400
committerJan Kara <jack@suse.cz>2010-05-24 08:06:39 -0400
commitc79d967de3741ceb60c5bbbf1b6f97eab9a89838 (patch)
tree5494e7b504cffb0ddc6942d1542c2b4a472207ed /fs/super.c
parenteea7feb072f5914ecafa95b3d83be0c229244d90 (diff)
quota: move remount handling into the filesystem
Currently do_remount_sb calls into the dquot code to tell it about going from rw to ro and ro to rw. Move this code into the filesystem to not depend on the dquot code in the VFS - note ocfs2 already ignores these calls and handles remount by itself. This gets rid of overloading the quotactl calls and allows to unify the VFS and XFS codepaths in that area later. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/super.c')
-rw-r--r--fs/super.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/super.c b/fs/super.c
index 69688b15f1fa..a38e6e9b6f69 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -524,7 +524,7 @@ rescan:
524int do_remount_sb(struct super_block *sb, int flags, void *data, int force) 524int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
525{ 525{
526 int retval; 526 int retval;
527 int remount_rw, remount_ro; 527 int remount_ro;
528 528
529 if (sb->s_frozen != SB_UNFROZEN) 529 if (sb->s_frozen != SB_UNFROZEN)
530 return -EBUSY; 530 return -EBUSY;
@@ -540,7 +540,6 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
540 sync_filesystem(sb); 540 sync_filesystem(sb);
541 541
542 remount_ro = (flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY); 542 remount_ro = (flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY);
543 remount_rw = !(flags & MS_RDONLY) && (sb->s_flags & MS_RDONLY);
544 543
545 /* If we are remounting RDONLY and current sb is read/write, 544 /* If we are remounting RDONLY and current sb is read/write,
546 make sure there are no rw files opened */ 545 make sure there are no rw files opened */
@@ -549,9 +548,6 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
549 mark_files_ro(sb); 548 mark_files_ro(sb);
550 else if (!fs_may_remount_ro(sb)) 549 else if (!fs_may_remount_ro(sb))
551 return -EBUSY; 550 return -EBUSY;
552 retval = vfs_dq_off(sb, 1);
553 if (retval < 0 && retval != -ENOSYS)
554 return -EBUSY;
555 } 551 }
556 552
557 if (sb->s_op->remount_fs) { 553 if (sb->s_op->remount_fs) {
@@ -560,8 +556,7 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
560 return retval; 556 return retval;
561 } 557 }
562 sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK); 558 sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK);
563 if (remount_rw) 559
564 vfs_dq_quota_on_remount(sb);
565 /* 560 /*
566 * Some filesystems modify their metadata via some other path than the 561 * Some filesystems modify their metadata via some other path than the
567 * bdev buffer cache (eg. use a private mapping, or directories in 562 * bdev buffer cache (eg. use a private mapping, or directories in