Skip to content

Commit a3f5cf1

Browse files
jankaratytso
authored andcommitted
ext4: drop ext4_handle_dirty_super()
The wrapper is now useless since it does what ext4_handle_dirty_metadata() does. Just remove it. Signed-off-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20201216101844.22917-9-jack@suse.cz Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent dfd56c2 commit a3f5cf1

7 files changed

Lines changed: 10 additions & 30 deletions

File tree

fs/ext4/ext4_jbd2.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -372,19 +372,3 @@ int __ext4_handle_dirty_metadata(const char *where, unsigned int line,
372372
}
373373
return err;
374374
}
375-
376-
int __ext4_handle_dirty_super(const char *where, unsigned int line,
377-
handle_t *handle, struct super_block *sb)
378-
{
379-
struct buffer_head *bh = EXT4_SB(sb)->s_sbh;
380-
int err = 0;
381-
382-
if (ext4_handle_valid(handle)) {
383-
err = jbd2_journal_dirty_metadata(handle, bh);
384-
if (err)
385-
ext4_journal_abort_handle(where, line, __func__,
386-
bh, handle, err);
387-
} else
388-
mark_buffer_dirty(bh);
389-
return err;
390-
}

fs/ext4/ext4_jbd2.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,6 @@ int __ext4_handle_dirty_metadata(const char *where, unsigned int line,
244244
handle_t *handle, struct inode *inode,
245245
struct buffer_head *bh);
246246

247-
int __ext4_handle_dirty_super(const char *where, unsigned int line,
248-
handle_t *handle, struct super_block *sb);
249-
250247
#define ext4_journal_get_write_access(handle, bh) \
251248
__ext4_journal_get_write_access(__func__, __LINE__, (handle), (bh))
252249
#define ext4_forget(handle, is_metadata, inode, bh, block_nr) \
@@ -257,8 +254,6 @@ int __ext4_handle_dirty_super(const char *where, unsigned int line,
257254
#define ext4_handle_dirty_metadata(handle, inode, bh) \
258255
__ext4_handle_dirty_metadata(__func__, __LINE__, (handle), (inode), \
259256
(bh))
260-
#define ext4_handle_dirty_super(handle, sb) \
261-
__ext4_handle_dirty_super(__func__, __LINE__, (handle), (sb))
262257

263258
handle_t *__ext4_journal_start_sb(struct super_block *sb, unsigned int line,
264259
int type, int blocks, int rsv_blocks,

fs/ext4/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ static int ext4_sample_last_mounted(struct super_block *sb,
814814
sizeof(sbi->s_es->s_last_mounted));
815815
ext4_superblock_csum_set(sb);
816816
unlock_buffer(sbi->s_sbh);
817-
ext4_handle_dirty_super(handle, sb);
817+
ext4_handle_dirty_metadata(handle, NULL, sbi->s_sbh);
818818
out_journal:
819819
ext4_journal_stop(handle);
820820
out:

fs/ext4/inode.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5155,7 +5155,8 @@ static int ext4_do_update_inode(handle_t *handle,
51555155
ext4_superblock_csum_set(sb);
51565156
unlock_buffer(EXT4_SB(sb)->s_sbh);
51575157
ext4_handle_sync(handle);
5158-
err = ext4_handle_dirty_super(handle, sb);
5158+
err = ext4_handle_dirty_metadata(handle, NULL,
5159+
EXT4_SB(sb)->s_sbh);
51595160
}
51605161
ext4_update_inode_fsync_trans(handle, inode, need_datasync);
51615162
out_brelse:

fs/ext4/namei.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2988,7 +2988,7 @@ int ext4_orphan_add(handle_t *handle, struct inode *inode)
29882988
mutex_unlock(&sbi->s_orphan_lock);
29892989

29902990
if (dirty) {
2991-
err = ext4_handle_dirty_super(handle, sb);
2991+
err = ext4_handle_dirty_metadata(handle, NULL, sbi->s_sbh);
29922992
rc = ext4_mark_iloc_dirty(handle, inode, &iloc);
29932993
if (!err)
29942994
err = rc;
@@ -3069,7 +3069,7 @@ int ext4_orphan_del(handle_t *handle, struct inode *inode)
30693069
ext4_superblock_csum_set(inode->i_sb);
30703070
unlock_buffer(sbi->s_sbh);
30713071
mutex_unlock(&sbi->s_orphan_lock);
3072-
err = ext4_handle_dirty_super(handle, inode->i_sb);
3072+
err = ext4_handle_dirty_metadata(handle, NULL, sbi->s_sbh);
30733073
} else {
30743074
struct ext4_iloc iloc2;
30753075
struct inode *i_prev =

fs/ext4/resize.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
903903
le16_add_cpu(&es->s_reserved_gdt_blocks, -1);
904904
ext4_superblock_csum_set(sb);
905905
unlock_buffer(EXT4_SB(sb)->s_sbh);
906-
err = ext4_handle_dirty_super(handle, sb);
906+
err = ext4_handle_dirty_metadata(handle, NULL, EXT4_SB(sb)->s_sbh);
907907
if (err)
908908
ext4_std_error(sb, err);
909909
return err;
@@ -1521,7 +1521,7 @@ static int ext4_flex_group_add(struct super_block *sb,
15211521

15221522
ext4_update_super(sb, flex_gd);
15231523

1524-
err = ext4_handle_dirty_super(handle, sb);
1524+
err = ext4_handle_dirty_metadata(handle, NULL, sbi->s_sbh);
15251525

15261526
exit_journal:
15271527
err2 = ext4_journal_stop(handle);
@@ -1734,7 +1734,7 @@ static int ext4_group_extend_no_check(struct super_block *sb,
17341734
err = ext4_group_add_blocks(handle, sb, o_blocks_count, add);
17351735
if (err)
17361736
goto errout;
1737-
ext4_handle_dirty_super(handle, sb);
1737+
ext4_handle_dirty_metadata(handle, NULL, EXT4_SB(sb)->s_sbh);
17381738
ext4_debug("freed blocks %llu through %llu\n", o_blocks_count,
17391739
o_blocks_count + add);
17401740
errout:
@@ -1891,7 +1891,7 @@ static int ext4_convert_meta_bg(struct super_block *sb, struct inode *inode)
18911891
ext4_superblock_csum_set(sb);
18921892
unlock_buffer(sbi->s_sbh);
18931893

1894-
err = ext4_handle_dirty_super(handle, sb);
1894+
err = ext4_handle_dirty_metadata(handle, NULL, sbi->s_sbh);
18951895
if (err) {
18961896
ext4_std_error(sb, err);
18971897
goto errout;

fs/ext4/xattr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ static void ext4_xattr_update_super_block(handle_t *handle,
796796
ext4_set_feature_xattr(sb);
797797
ext4_superblock_csum_set(sb);
798798
unlock_buffer(EXT4_SB(sb)->s_sbh);
799-
ext4_handle_dirty_super(handle, sb);
799+
ext4_handle_dirty_metadata(handle, NULL, EXT4_SB(sb)->s_sbh);
800800
}
801801
}
802802

0 commit comments

Comments
 (0)