aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext2/super.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-25 11:14:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-25 11:14:59 -0400
commitece78b7df734726e790dcab207f463401ff80440 (patch)
tree4a0b23c28c6a727d5eebc8a88a22fe3720c425fd /fs/ext2/super.c
parent07acfc2a9349a8ce45b236c2624dad452001966b (diff)
parent0324876628a9c7faf8127e20af29373dc6dec876 (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull ext2, ext3 and quota fixes from Jan Kara: "Interesting bits are: - removal of a special i_mutex locking subclass (I_MUTEX_QUOTA) since quota code does not need i_mutex anymore in any unusual way. - backport (from ext4) of a fix of a checkpointing bug (missing cache flush) that could lead to fs corruption on power failure The rest are just random small fixes & cleanups." * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: ext2: trivial fix to comment for ext2_free_blocks ext2: remove the redundant comment for ext2_export_ops ext3: return 32/64-bit dir name hash according to usage type quota: Get rid of nested I_MUTEX_QUOTA locking subclass quota: Use precomputed value of sb_dqopt in dquot_quota_sync ext2: Remove i_mutex use from ext2_quota_write() reiserfs: Remove i_mutex use from reiserfs_quota_write() ext4: Remove i_mutex use from ext4_quota_write() ext3: Remove i_mutex use from ext3_quota_write() quota: Fix double lock in add_dquot_ref() with CONFIG_QUOTA_DEBUG jbd: Write journal superblock with WRITE_FUA after checkpointing jbd: protect all log tail updates with j_checkpoint_mutex jbd: Split updating of journal superblock and marking journal empty ext2: do not register write_super within VFS ext2: Remove s_dirt handling ext2: write superblock only once on unmount ext3: update documentation with barrier=1 default ext3: remove max_debt in find_group_orlov() jbd: Refine commit writeout logic
Diffstat (limited to 'fs/ext2/super.c')
-rw-r--r--fs/ext2/super.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 38f816071ddb..b3621cb7ea31 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -130,9 +130,6 @@ static void ext2_put_super (struct super_block * sb)
130 130
131 dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED); 131 dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED);
132 132
133 if (sb->s_dirt)
134 ext2_write_super(sb);
135
136 ext2_xattr_put_super(sb); 133 ext2_xattr_put_super(sb);
137 if (!(sb->s_flags & MS_RDONLY)) { 134 if (!(sb->s_flags & MS_RDONLY)) {
138 struct ext2_super_block *es = sbi->s_es; 135 struct ext2_super_block *es = sbi->s_es;
@@ -307,7 +304,6 @@ static const struct super_operations ext2_sops = {
307 .write_inode = ext2_write_inode, 304 .write_inode = ext2_write_inode,
308 .evict_inode = ext2_evict_inode, 305 .evict_inode = ext2_evict_inode,
309 .put_super = ext2_put_super, 306 .put_super = ext2_put_super,
310 .write_super = ext2_write_super,
311 .sync_fs = ext2_sync_fs, 307 .sync_fs = ext2_sync_fs,
312 .statfs = ext2_statfs, 308 .statfs = ext2_statfs,
313 .remount_fs = ext2_remount, 309 .remount_fs = ext2_remount,
@@ -358,11 +354,6 @@ static struct dentry *ext2_fh_to_parent(struct super_block *sb, struct fid *fid,
358 ext2_nfs_get_inode); 354 ext2_nfs_get_inode);
359} 355}
360 356
361/* Yes, most of these are left as NULL!!
362 * A NULL value implies the default, which works with ext2-like file
363 * systems, but can be improved upon.
364 * Currently only get_parent is required.
365 */
366static const struct export_operations ext2_export_ops = { 357static const struct export_operations ext2_export_ops = {
367 .fh_to_dentry = ext2_fh_to_dentry, 358 .fh_to_dentry = ext2_fh_to_dentry,
368 .fh_to_parent = ext2_fh_to_parent, 359 .fh_to_parent = ext2_fh_to_parent,
@@ -1176,7 +1167,6 @@ static void ext2_sync_super(struct super_block *sb, struct ext2_super_block *es,
1176 mark_buffer_dirty(EXT2_SB(sb)->s_sbh); 1167 mark_buffer_dirty(EXT2_SB(sb)->s_sbh);
1177 if (wait) 1168 if (wait)
1178 sync_dirty_buffer(EXT2_SB(sb)->s_sbh); 1169 sync_dirty_buffer(EXT2_SB(sb)->s_sbh);
1179 sb->s_dirt = 0;
1180} 1170}
1181 1171
1182/* 1172/*
@@ -1209,8 +1199,6 @@ void ext2_write_super(struct super_block *sb)
1209{ 1199{
1210 if (!(sb->s_flags & MS_RDONLY)) 1200 if (!(sb->s_flags & MS_RDONLY))
1211 ext2_sync_fs(sb, 1); 1201 ext2_sync_fs(sb, 1);
1212 else
1213 sb->s_dirt = 0;
1214} 1202}
1215 1203
1216static int ext2_remount (struct super_block * sb, int * flags, char * data) 1204static int ext2_remount (struct super_block * sb, int * flags, char * data)
@@ -1456,7 +1444,6 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type,
1456 struct buffer_head tmp_bh; 1444 struct buffer_head tmp_bh;
1457 struct buffer_head *bh; 1445 struct buffer_head *bh;
1458 1446
1459 mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
1460 while (towrite > 0) { 1447 while (towrite > 0) {
1461 tocopy = sb->s_blocksize - offset < towrite ? 1448 tocopy = sb->s_blocksize - offset < towrite ?
1462 sb->s_blocksize - offset : towrite; 1449 sb->s_blocksize - offset : towrite;
@@ -1486,16 +1473,13 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type,
1486 blk++; 1473 blk++;
1487 } 1474 }
1488out: 1475out:
1489 if (len == towrite) { 1476 if (len == towrite)
1490 mutex_unlock(&inode->i_mutex);
1491 return err; 1477 return err;
1492 }
1493 if (inode->i_size < off+len-towrite) 1478 if (inode->i_size < off+len-towrite)
1494 i_size_write(inode, off+len-towrite); 1479 i_size_write(inode, off+len-towrite);
1495 inode->i_version++; 1480 inode->i_version++;
1496 inode->i_mtime = inode->i_ctime = CURRENT_TIME; 1481 inode->i_mtime = inode->i_ctime = CURRENT_TIME;
1497 mark_inode_dirty(inode); 1482 mark_inode_dirty(inode);
1498 mutex_unlock(&inode->i_mutex);
1499 return len - towrite; 1483 return len - towrite;
1500} 1484}
1501 1485