diff options
author | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2022-07-07 19:25:43 +0300 |
---|---|---|
committer | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2022-08-03 18:25:08 +0300 |
commit | 8335ebe195dcc76ece418485a9f08b9a9ad7fe23 (patch) | |
tree | 62c29429cb4d057a2f0cc9693d9ece7f976a793e /fs/ntfs3/super.c | |
parent | e6d9398c077d8e21a2ca50efab5cbf7ff5aff728 (diff) | |
download | lwn-8335ebe195dcc76ece418485a9f08b9a9ad7fe23.tar.gz lwn-8335ebe195dcc76ece418485a9f08b9a9ad7fe23.zip |
fs/ntfs3: Make MFT zone less fragmented
Now we take free space after the MFT zone if the MFT zone shrinks.
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3/super.c')
-rw-r--r-- | fs/ntfs3/super.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c index eacea72ff92f..6fad173a8b8f 100644 --- a/fs/ntfs3/super.c +++ b/fs/ntfs3/super.c @@ -867,6 +867,13 @@ static int ntfs_init_from_boot(struct super_block *sb, u32 sector_size, sb->s_maxbytes = 0xFFFFFFFFull << sbi->cluster_bits; #endif + /* + * Compute the MFT zone at two steps. + * It would be nice if we are able to allocate 1/8 of + * total clusters for MFT but not more then 512 MB. + */ + sbi->zone_max = min_t(CLST, 0x20000000 >> sbi->cluster_bits, clusters >> 3); + err = 0; out: |