Skip to content

Commit e66af07

Browse files
pskrgagaalexandrovich
authored andcommitted
fs/ntfs3: Make ntfs_update_mftmirr return void
None of callers check the return value of ntfs_update_mftmirr(), so make it return void to make code simpler. Signed-off-by: Pavel Skripkin <[email protected]> Signed-off-by: Konstantin Komarov <[email protected]>
1 parent 321460c commit e66af07

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

fs/ntfs3/fsntfs.c

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ int ntfs_refresh_zone(struct ntfs_sb_info *sbi)
827827
/*
828828
* ntfs_update_mftmirr - Update $MFTMirr data.
829829
*/
830-
int ntfs_update_mftmirr(struct ntfs_sb_info *sbi, int wait)
830+
void ntfs_update_mftmirr(struct ntfs_sb_info *sbi, int wait)
831831
{
832832
int err;
833833
struct super_block *sb = sbi->sb;
@@ -836,12 +836,12 @@ int ntfs_update_mftmirr(struct ntfs_sb_info *sbi, int wait)
836836
u32 bytes;
837837

838838
if (!sb)
839-
return -EINVAL;
839+
return;
840840

841841
blocksize = sb->s_blocksize;
842842

843843
if (!(sbi->flags & NTFS_FLAGS_MFTMIRR))
844-
return 0;
844+
return;
845845

846846
err = 0;
847847
bytes = sbi->mft.recs_mirr << sbi->record_bits;
@@ -852,16 +852,13 @@ int ntfs_update_mftmirr(struct ntfs_sb_info *sbi, int wait)
852852
struct buffer_head *bh1, *bh2;
853853

854854
bh1 = sb_bread(sb, block1++);
855-
if (!bh1) {
856-
err = -EIO;
857-
goto out;
858-
}
855+
if (!bh1)
856+
return;
859857

860858
bh2 = sb_getblk(sb, block2++);
861859
if (!bh2) {
862860
put_bh(bh1);
863-
err = -EIO;
864-
goto out;
861+
return;
865862
}
866863

867864
if (buffer_locked(bh2))
@@ -881,13 +878,10 @@ int ntfs_update_mftmirr(struct ntfs_sb_info *sbi, int wait)
881878

882879
put_bh(bh2);
883880
if (err)
884-
goto out;
881+
return;
885882
}
886883

887884
sbi->flags &= ~NTFS_FLAGS_MFTMIRR;
888-
889-
out:
890-
return err;
891885
}
892886

893887
/*

fs/ntfs3/ntfs_fs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ int ntfs_look_free_mft(struct ntfs_sb_info *sbi, CLST *rno, bool mft,
593593
void ntfs_mark_rec_free(struct ntfs_sb_info *sbi, CLST rno);
594594
int ntfs_clear_mft_tail(struct ntfs_sb_info *sbi, size_t from, size_t to);
595595
int ntfs_refresh_zone(struct ntfs_sb_info *sbi);
596-
int ntfs_update_mftmirr(struct ntfs_sb_info *sbi, int wait);
596+
void ntfs_update_mftmirr(struct ntfs_sb_info *sbi, int wait);
597597
enum NTFS_DIRTY_FLAGS {
598598
NTFS_DIRTY_CLEAR = 0,
599599
NTFS_DIRTY_DIRTY = 1,

0 commit comments

Comments
 (0)