Skip to content

Commit ca41f7b

Browse files
Christoph HellwigAl Viro
authored andcommitted
ext3: remove ->write_super and stop maintaining ->s_dirt
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 59d697b commit ca41f7b

6 files changed

Lines changed: 2 additions & 30 deletions

File tree

‎fs/ext3/balloc.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ void ext3_free_blocks_sb(handle_t *handle, struct super_block *sb,
649649
count = overflow;
650650
goto do_more;
651651
}
652-
sb->s_dirt = 1;
652+
653653
error_return:
654654
brelse(bitmap_bh);
655655
ext3_std_error(sb, err);
@@ -1708,7 +1708,6 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode,
17081708
if (!fatal)
17091709
fatal = err;
17101710

1711-
sb->s_dirt = 1;
17121711
if (fatal)
17131712
goto out;
17141713

‎fs/ext3/ialloc.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ void ext3_free_inode (handle_t *handle, struct inode * inode)
181181
err = ext3_journal_dirty_metadata(handle, bitmap_bh);
182182
if (!fatal)
183183
fatal = err;
184-
sb->s_dirt = 1;
184+
185185
error_return:
186186
brelse(bitmap_bh);
187187
ext3_std_error(sb, fatal);
@@ -537,7 +537,6 @@ struct inode *ext3_new_inode(handle_t *handle, struct inode * dir, int mode)
537537
percpu_counter_dec(&sbi->s_freeinodes_counter);
538538
if (S_ISDIR(mode))
539539
percpu_counter_inc(&sbi->s_dirs_counter);
540-
sb->s_dirt = 1;
541540

542541
inode->i_uid = current_fsuid();
543542
if (test_opt (sb, GRPID))

‎fs/ext3/inode.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2960,7 +2960,6 @@ static int ext3_do_update_inode(handle_t *handle,
29602960
ext3_update_dynamic_rev(sb);
29612961
EXT3_SET_RO_COMPAT_FEATURE(sb,
29622962
EXT3_FEATURE_RO_COMPAT_LARGE_FILE);
2963-
sb->s_dirt = 1;
29642963
handle->h_sync = 1;
29652964
err = ext3_journal_dirty_metadata(handle,
29662965
EXT3_SB(sb)->s_sbh);

‎fs/ext3/resize.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,6 @@ int ext3_group_add(struct super_block *sb, struct ext3_new_group_data *input)
934934
EXT3_INODES_PER_GROUP(sb));
935935

936936
ext3_journal_dirty_metadata(handle, sbi->s_sbh);
937-
sb->s_dirt = 1;
938937

939938
exit_journal:
940939
unlock_super(sb);
@@ -1066,7 +1065,6 @@ int ext3_group_extend(struct super_block *sb, struct ext3_super_block *es,
10661065
}
10671066
es->s_blocks_count = cpu_to_le32(o_blocks_count + add);
10681067
ext3_journal_dirty_metadata(handle, EXT3_SB(sb)->s_sbh);
1069-
sb->s_dirt = 1;
10701068
unlock_super(sb);
10711069
ext3_debug("freeing blocks %lu through "E3FSBLK"\n", o_blocks_count,
10721070
o_blocks_count + add);

‎fs/ext3/super.c‎

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ static const char *ext3_decode_error(struct super_block * sb, int errno,
6767
static int ext3_remount (struct super_block * sb, int * flags, char * data);
6868
static int ext3_statfs (struct dentry * dentry, struct kstatfs * buf);
6969
static int ext3_unfreeze(struct super_block *sb);
70-
static void ext3_write_super (struct super_block * sb);
7170
static int ext3_freeze(struct super_block *sb);
7271

7372
/*
@@ -761,7 +760,6 @@ static const struct super_operations ext3_sops = {
761760
.dirty_inode = ext3_dirty_inode,
762761
.delete_inode = ext3_delete_inode,
763762
.put_super = ext3_put_super,
764-
.write_super = ext3_write_super,
765763
.sync_fs = ext3_sync_fs,
766764
.freeze_fs = ext3_freeze,
767765
.unfreeze_fs = ext3_unfreeze,
@@ -1785,7 +1783,6 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
17851783
#else
17861784
es->s_flags |= cpu_to_le32(EXT2_FLAGS_SIGNED_HASH);
17871785
#endif
1788-
sb->s_dirt = 1;
17891786
}
17901787

17911788
if (sbi->s_blocks_per_group > blocksize * 8) {
@@ -2265,7 +2262,6 @@ static int ext3_load_journal(struct super_block *sb,
22652262
if (journal_devnum &&
22662263
journal_devnum != le32_to_cpu(es->s_journal_dev)) {
22672264
es->s_journal_dev = cpu_to_le32(journal_devnum);
2268-
sb->s_dirt = 1;
22692265

22702266
/* Make sure we flush the recovery flag to disk. */
22712267
ext3_commit_super(sb, es, 1);
@@ -2308,7 +2304,6 @@ static int ext3_create_journal(struct super_block * sb,
23082304
EXT3_SET_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_HAS_JOURNAL);
23092305

23102306
es->s_journal_inum = cpu_to_le32(journal_inum);
2311-
sb->s_dirt = 1;
23122307

23132308
/* Make sure we flush the recovery flag to disk. */
23142309
ext3_commit_super(sb, es, 1);
@@ -2354,7 +2349,6 @@ static void ext3_mark_recovery_complete(struct super_block * sb,
23542349
if (EXT3_HAS_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER) &&
23552350
sb->s_flags & MS_RDONLY) {
23562351
EXT3_CLEAR_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER);
2357-
sb->s_dirt = 0;
23582352
ext3_commit_super(sb, es, 1);
23592353
}
23602354
unlock_super(sb);
@@ -2413,29 +2407,14 @@ int ext3_force_commit(struct super_block *sb)
24132407
return 0;
24142408

24152409
journal = EXT3_SB(sb)->s_journal;
2416-
sb->s_dirt = 0;
24172410
ret = ext3_journal_force_commit(journal);
24182411
return ret;
24192412
}
24202413

2421-
/*
2422-
* Ext3 always journals updates to the superblock itself, so we don't
2423-
* have to propagate any other updates to the superblock on disk at this
2424-
* point. (We can probably nuke this function altogether, and remove
2425-
* any mention to sb->s_dirt in all of fs/ext3; eventual cleanup...)
2426-
*/
2427-
static void ext3_write_super (struct super_block * sb)
2428-
{
2429-
if (mutex_trylock(&sb->s_lock) != 0)
2430-
BUG();
2431-
sb->s_dirt = 0;
2432-
}
2433-
24342414
static int ext3_sync_fs(struct super_block *sb, int wait)
24352415
{
24362416
tid_t target;
24372417

2438-
sb->s_dirt = 0;
24392418
if (journal_start_commit(EXT3_SB(sb)->s_journal, &target)) {
24402419
if (wait)
24412420
log_wait_commit(EXT3_SB(sb)->s_journal, target);
@@ -2451,7 +2430,6 @@ static int ext3_freeze(struct super_block *sb)
24512430
{
24522431
int error = 0;
24532432
journal_t *journal;
2454-
sb->s_dirt = 0;
24552433

24562434
if (!(sb->s_flags & MS_RDONLY)) {
24572435
journal = EXT3_SB(sb)->s_journal;

‎fs/ext3/xattr.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@ static void ext3_xattr_update_super_block(handle_t *handle,
463463

464464
if (ext3_journal_get_write_access(handle, EXT3_SB(sb)->s_sbh) == 0) {
465465
EXT3_SET_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_EXT_ATTR);
466-
sb->s_dirt = 1;
467466
ext3_journal_dirty_metadata(handle, EXT3_SB(sb)->s_sbh);
468467
}
469468
}

0 commit comments

Comments
 (0)