fs/ntfs3: Use ALIGN kernel macro
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Tue, 11 Oct 2022 17:12:02 +0000 (20:12 +0300)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Mon, 14 Nov 2022 16:50:47 +0000 (19:50 +0300)
This way code will be more readable.

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/fsntfs.c
fs/ntfs3/ntfs.h
fs/ntfs3/ntfs_fs.h

index 6a1e000fd2b5318f9fec9115c1fc4aab6902a825..567563771bf8997ec3e64eb3793798cfba24dff5 100644 (file)
@@ -503,7 +503,7 @@ static int ntfs_extend_mft(struct ntfs_sb_info *sbi)
        struct ATTRIB *attr;
        struct wnd_bitmap *wnd = &sbi->mft.bitmap;
 
-       new_mft_total = (wnd->nbits + MFT_INCREASE_CHUNK + 127) & (CLST)~127;
+       new_mft_total = ALIGN(wnd->nbits + NTFS_MFT_INCREASE_STEP, 128);
        new_mft_bytes = (u64)new_mft_total << sbi->record_bits;
 
        /* Step 1: Resize $MFT::DATA. */
index 9cc396b117bfd9b02531ad6c6de89ded53bba7f3..9f764bf4ed0a08d2bf78e9fe427b366089af7364 100644 (file)
@@ -84,7 +84,6 @@ typedef u32 CLST;
 
 #define COMPRESSION_UNIT     4
 #define COMPRESS_MAX_CLUSTER 0x1000
-#define MFT_INCREASE_CHUNK   1024
 
 enum RECORD_NUM {
        MFT_REC_MFT             = 0,
index 8dd835626c7e9a02aa6dc6b28d863d16714138e4..1ab8bbaf8eaa87205ed641665b70da2a2d88743f 100644 (file)
@@ -199,6 +199,8 @@ struct ntfs_index {
 
 /* Minimum MFT zone. */
 #define NTFS_MIN_MFT_ZONE 100
+/* Step to increase the MFT. */
+#define NTFS_MFT_INCREASE_STEP 1024
 
 /* Ntfs file system in-core superblock data. */
 struct ntfs_sb_info {