aboutsummaryrefslogtreecommitdiffstats
path: root/fs/super.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-30 12:11:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-30 12:11:11 -0400
commitd28619f1563140526e2f84eae436f39206f40a69 (patch)
treed93284016a0983c8f27b745a3c50738617e50995 /fs/super.c
parent021fad8b706849c091f6e682bc5df3ce4f9ab4d7 (diff)
parentf32764bd2bbb6ea003c158b1d276b4dc9f900348 (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6: quota: Convert quota statistics to generic percpu_counter ext3 uses rb_node = NULL; to zero rb_root. quota: Fixup dquot_transfer reiserfs: Fix resuming of quotas on remount read-write pohmelfs: Remove dead quota code ufs: Remove dead quota code udf: Remove dead quota code quota: rename default quotactl methods to dquot_ quota: explicitly set ->dq_op and ->s_qcop quota: drop remount argument to ->quota_on and ->quota_off quota: move unmount handling into the filesystem quota: kill the vfs_dq_off and vfs_dq_quota_on_remount wrappers quota: move remount handling into the filesystem ocfs2: Fix use after free on remount read-only Fix up conflicts in fs/ext4/super.c and fs/ufs/file.c
Diffstat (limited to 'fs/super.c')
-rw-r--r--fs/super.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/fs/super.c b/fs/super.c
index a67409e5ad94..5c35bc7a499e 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -24,7 +24,6 @@
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/acct.h> 25#include <linux/acct.h>
26#include <linux/blkdev.h> 26#include <linux/blkdev.h>
27#include <linux/quotaops.h>
28#include <linux/mount.h> 27#include <linux/mount.h>
29#include <linux/security.h> 28#include <linux/security.h>
30#include <linux/writeback.h> /* for the emergency remount stuff */ 29#include <linux/writeback.h> /* for the emergency remount stuff */
@@ -94,8 +93,6 @@ static struct super_block *alloc_super(struct file_system_type *type)
94 init_rwsem(&s->s_dquot.dqptr_sem); 93 init_rwsem(&s->s_dquot.dqptr_sem);
95 init_waitqueue_head(&s->s_wait_unfrozen); 94 init_waitqueue_head(&s->s_wait_unfrozen);
96 s->s_maxbytes = MAX_NON_LFS; 95 s->s_maxbytes = MAX_NON_LFS;
97 s->dq_op = sb_dquot_ops;
98 s->s_qcop = sb_quotactl_ops;
99 s->s_op = &default_op; 96 s->s_op = &default_op;
100 s->s_time_gran = 1000000000; 97 s->s_time_gran = 1000000000;
101 } 98 }
@@ -160,7 +157,6 @@ void deactivate_locked_super(struct super_block *s)
160{ 157{
161 struct file_system_type *fs = s->s_type; 158 struct file_system_type *fs = s->s_type;
162 if (atomic_dec_and_test(&s->s_active)) { 159 if (atomic_dec_and_test(&s->s_active)) {
163 vfs_dq_off(s, 0);
164 fs->kill_sb(s); 160 fs->kill_sb(s);
165 put_filesystem(fs); 161 put_filesystem(fs);
166 put_super(s); 162 put_super(s);
@@ -524,7 +520,7 @@ rescan:
524int do_remount_sb(struct super_block *sb, int flags, void *data, int force) 520int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
525{ 521{
526 int retval; 522 int retval;
527 int remount_rw, remount_ro; 523 int remount_ro;
528 524
529 if (sb->s_frozen != SB_UNFROZEN) 525 if (sb->s_frozen != SB_UNFROZEN)
530 return -EBUSY; 526 return -EBUSY;
@@ -540,7 +536,6 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
540 sync_filesystem(sb); 536 sync_filesystem(sb);
541 537
542 remount_ro = (flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY); 538 remount_ro = (flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY);
543 remount_rw = !(flags & MS_RDONLY) && (sb->s_flags & MS_RDONLY);
544 539
545 /* If we are remounting RDONLY and current sb is read/write, 540 /* If we are remounting RDONLY and current sb is read/write,
546 make sure there are no rw files opened */ 541 make sure there are no rw files opened */
@@ -549,9 +544,6 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
549 mark_files_ro(sb); 544 mark_files_ro(sb);
550 else if (!fs_may_remount_ro(sb)) 545 else if (!fs_may_remount_ro(sb))
551 return -EBUSY; 546 return -EBUSY;
552 retval = vfs_dq_off(sb, 1);
553 if (retval < 0 && retval != -ENOSYS)
554 return -EBUSY;
555 } 547 }
556 548
557 if (sb->s_op->remount_fs) { 549 if (sb->s_op->remount_fs) {
@@ -560,8 +552,7 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
560 return retval; 552 return retval;
561 } 553 }
562 sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK); 554 sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK);
563 if (remount_rw) 555
564 vfs_dq_quota_on_remount(sb);
565 /* 556 /*
566 * Some filesystems modify their metadata via some other path than the 557 * Some filesystems modify their metadata via some other path than the
567 * bdev buffer cache (eg. use a private mapping, or directories in 558 * bdev buffer cache (eg. use a private mapping, or directories in