Skip to content

Commit 63193eb

Browse files
Chi Zhilingnamjaejeon
authored andcommitted
exfat: drop redundant sec parameter from exfat_mirror_bh
The sector offset can be obtained from bh->b_blocknr, so drop the redundant sec parameter from exfat_mirror_bh(). Also clean up the function to use exfat_update_bh() helper. No functional changes. Signed-off-by: Chi Zhiling <chizhiling@kylinos.cn> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
1 parent 7094b09 commit 63193eb

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

fs/exfat/fatent.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
#include "exfat_raw.h"
1212
#include "exfat_fs.h"
1313

14-
static int exfat_mirror_bh(struct super_block *sb, sector_t sec,
15-
struct buffer_head *bh)
14+
static int exfat_mirror_bh(struct super_block *sb, struct buffer_head *bh)
1615
{
1716
struct buffer_head *c_bh;
1817
struct exfat_sb_info *sbi = EXFAT_SB(sb);
18+
sector_t sec = bh->b_blocknr;
1919
sector_t sec2;
2020
int err = 0;
2121

@@ -25,10 +25,7 @@ static int exfat_mirror_bh(struct super_block *sb, sector_t sec,
2525
if (!c_bh)
2626
return -ENOMEM;
2727
memcpy(c_bh->b_data, bh->b_data, sb->s_blocksize);
28-
set_buffer_uptodate(c_bh);
29-
mark_buffer_dirty(c_bh);
30-
if (sb->s_flags & SB_SYNCHRONOUS)
31-
err = sync_dirty_buffer(c_bh);
28+
exfat_update_bh(c_bh, sb->s_flags & SB_SYNCHRONOUS);
3229
brelse(c_bh);
3330
}
3431

@@ -83,7 +80,7 @@ int exfat_ent_set(struct super_block *sb, unsigned int loc,
8380
fat_entry = (__le32 *)&(bh->b_data[off]);
8481
*fat_entry = cpu_to_le32(content);
8582
exfat_update_bh(bh, sb->s_flags & SB_SYNCHRONOUS);
86-
exfat_mirror_bh(sb, sec, bh);
83+
exfat_mirror_bh(sb, bh);
8784
brelse(bh);
8885
return 0;
8986
}

0 commit comments

Comments
 (0)