aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs
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/ufs
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/ufs')
-rw-r--r--fs/ufs/super.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 14743d935a93..be1f7b05bc28 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -1248,7 +1248,9 @@ static int ufs_remount (struct super_block *sb, int *mount_flags, char *data)
1248 struct ufs_super_block_first * usb1; 1248 struct ufs_super_block_first * usb1;
1249 struct ufs_super_block_third * usb3; 1249 struct ufs_super_block_third * usb3;
1250 unsigned new_mount_opt, ufstype; 1250 unsigned new_mount_opt, ufstype;
1251 int enable_quota = 0;
1251 unsigned flags; 1252 unsigned flags;
1253 int err;
1252 1254
1253 lock_kernel(); 1255 lock_kernel();
1254 lock_super(sb); 1256 lock_super(sb);
@@ -1289,6 +1291,13 @@ static int ufs_remount (struct super_block *sb, int *mount_flags, char *data)
1289 * fs was mouted as rw, remounting ro 1291 * fs was mouted as rw, remounting ro
1290 */ 1292 */
1291 if (*mount_flags & MS_RDONLY) { 1293 if (*mount_flags & MS_RDONLY) {
1294 err = vfs_dq_off(sb, 1);
1295 if (err < 0 && err != -ENOSYS) {
1296 unlock_super(sb);
1297 unlock_kernel();
1298 return -EBUSY;
1299 }
1300
1292 ufs_put_super_internal(sb); 1301 ufs_put_super_internal(sb);
1293 usb1->fs_time = cpu_to_fs32(sb, get_seconds()); 1302 usb1->fs_time = cpu_to_fs32(sb, get_seconds());
1294 if ((flags & UFS_ST_MASK) == UFS_ST_SUN 1303 if ((flags & UFS_ST_MASK) == UFS_ST_SUN
@@ -1327,11 +1336,14 @@ static int ufs_remount (struct super_block *sb, int *mount_flags, char *data)
1327 return -EPERM; 1336 return -EPERM;
1328 } 1337 }
1329 sb->s_flags &= ~MS_RDONLY; 1338 sb->s_flags &= ~MS_RDONLY;
1339 enable_quota = 1;
1330#endif 1340#endif
1331 } 1341 }
1332 UFS_SB(sb)->s_mount_opt = new_mount_opt; 1342 UFS_SB(sb)->s_mount_opt = new_mount_opt;
1333 unlock_super(sb); 1343 unlock_super(sb);
1334 unlock_kernel(); 1344 unlock_kernel();
1345 if (enable_quota)
1346 vfs_dq_quota_on_remount(sb);
1335 return 0; 1347 return 0;
1336} 1348}
1337 1349