summaryrefslogtreecommitdiff
path: root/fs/ntfs3/fsntfs.c
diff options
context:
space:
mode:
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2023-01-17 15:01:00 +0400
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2023-03-27 17:44:35 +0400
commit96de65a9413e0422233b285368e8a9a64e461187 (patch)
treeb90c01696305460d6332cbb76673ed169541c8b6 /fs/ntfs3/fsntfs.c
parent75c5e0c9e5cad34deeec7c131c2b1368df5a8c75 (diff)
downloadlinux-next-96de65a9413e0422233b285368e8a9a64e461187.tar.gz
fs/ntfs3: Code formatting and refactoring
Added minor refactoring. Added and fixed some comments. In some places, the code has been reformatted to fit into 80 columns. clang-format-12 was used to format code according kernel's .clang-format. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3/fsntfs.c')
-rw-r--r--fs/ntfs3/fsntfs.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c
index 9ed9dd0d8edf..0a82b1bf3ec2 100644
--- a/fs/ntfs3/fsntfs.c
+++ b/fs/ntfs3/fsntfs.c
@@ -172,8 +172,8 @@ int ntfs_fix_post_read(struct NTFS_RECORD_HEADER *rhdr, size_t bytes,
u16 sample, fo, fn;
fo = le16_to_cpu(rhdr->fix_off);
- fn = simple ? ((bytes >> SECTOR_SHIFT) + 1)
- : le16_to_cpu(rhdr->fix_num);
+ fn = simple ? ((bytes >> SECTOR_SHIFT) + 1) :
+ le16_to_cpu(rhdr->fix_num);
/* Check errors. */
if ((fo & 1) || fo + fn * sizeof(short) > SECTOR_SIZE || !fn-- ||
@@ -849,14 +849,13 @@ void ntfs_update_mftmirr(struct ntfs_sb_info *sbi, int wait)
u32 blocksize, bytes;
sector_t block1, block2;
- if (!sb)
+ /*
+ * sb can be NULL here. In this case sbi->flags should be 0 too.
+ */
+ if (!sb || !(sbi->flags & NTFS_FLAGS_MFTMIRR))
return;
blocksize = sb->s_blocksize;
-
- if (!(sbi->flags & NTFS_FLAGS_MFTMIRR))
- return;
-
bytes = sbi->mft.recs_mirr << sbi->record_bits;
block1 = sbi->mft.lbo >> sb->s_blocksize_bits;
block2 = sbi->mft.lbo2 >> sb->s_blocksize_bits;