]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
exfat: drop redundant sec parameter from exfat_mirror_bh
authorChi Zhiling <chizhiling@kylinos.cn>
Tue, 3 Mar 2026 03:14:07 +0000 (11:14 +0800)
committerNamjae Jeon <linkinjeon@kernel.org>
Thu, 5 Mar 2026 12:09:30 +0000 (21:09 +0900)
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>
fs/exfat/fatent.c

index 9a4143f3fc0ca57b725d047d34a3ca7153e1f7dd..4177a933e0be1e92932e7037cc741e34c57f091d 100644 (file)
 #include "exfat_raw.h"
 #include "exfat_fs.h"
 
-static int exfat_mirror_bh(struct super_block *sb, sector_t sec,
-               struct buffer_head *bh)
+static int exfat_mirror_bh(struct super_block *sb, struct buffer_head *bh)
 {
        struct buffer_head *c_bh;
        struct exfat_sb_info *sbi = EXFAT_SB(sb);
+       sector_t sec = bh->b_blocknr;
        sector_t sec2;
        int err = 0;
 
@@ -25,10 +25,7 @@ static int exfat_mirror_bh(struct super_block *sb, sector_t sec,
                if (!c_bh)
                        return -ENOMEM;
                memcpy(c_bh->b_data, bh->b_data, sb->s_blocksize);
-               set_buffer_uptodate(c_bh);
-               mark_buffer_dirty(c_bh);
-               if (sb->s_flags & SB_SYNCHRONOUS)
-                       err = sync_dirty_buffer(c_bh);
+               exfat_update_bh(c_bh, sb->s_flags & SB_SYNCHRONOUS);
                brelse(c_bh);
        }
 
@@ -83,7 +80,7 @@ int exfat_ent_set(struct super_block *sb, unsigned int loc,
        fat_entry = (__le32 *)&(bh->b_data[off]);
        *fat_entry = cpu_to_le32(content);
        exfat_update_bh(bh, sb->s_flags & SB_SYNCHRONOUS);
-       exfat_mirror_bh(sb, sec, bh);
+       exfat_mirror_bh(sb, bh);
        brelse(bh);
        return 0;
 }