]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
fs/ntfs3: Merge synonym COMPRESSION_UNIT and NTFS_LZNT_CUNIT
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Wed, 15 May 2024 21:41:02 +0000 (00:41 +0300)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Fri, 7 Jun 2024 11:31:05 +0000 (14:31 +0300)
COMPRESSION_UNIT and NTFS_LZNT_CUNIT mean the same thing
(1u<<NTFS_LZNT_CUNIT) determines the size for compression (in clusters).

COMPRESS_MAX_CLUSTER is not used in the code.

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/attrib.c
fs/ntfs3/frecord.c
fs/ntfs3/fslog.c
fs/ntfs3/inode.c
fs/ntfs3/ntfs.h

index 8e6bcdf99770f26b01e5c551bda6664041b859d0..9ccec45190749cea1e186ecd839cd80aa9b5afb0 100644 (file)
@@ -254,7 +254,7 @@ int attr_make_nonresident(struct ntfs_inode *ni, struct ATTRIB *attr,
 
        align = sbi->cluster_size;
        if (is_attr_compressed(attr))
-               align <<= COMPRESSION_UNIT;
+               align <<= NTFS_LZNT_CUNIT;
        len = (rsize + align - 1) >> sbi->cluster_bits;
 
        run_init(run);
index 0008670939a4a17929918ca110e56594931022f2..4822cfd6351c27cc75b568043507405331b4d6b1 100644 (file)
@@ -1501,7 +1501,7 @@ int ni_insert_nonresident(struct ntfs_inode *ni, enum ATTR_TYPE type,
 
        if (is_ext) {
                if (flags & ATTR_FLAG_COMPRESSED)
-                       attr->nres.c_unit = COMPRESSION_UNIT;
+                       attr->nres.c_unit = NTFS_LZNT_CUNIT;
                attr->nres.total_size = attr->nres.alloc_size;
        }
 
index d7807d255dfe2a4d1b551fb6ae36513987caeaae..763644f90094bb64c72ee493db4e84fff48382be 100644 (file)
@@ -2992,7 +2992,7 @@ static struct ATTRIB *attr_create_nonres_log(struct ntfs_sb_info *sbi,
        if (is_ext) {
                attr->name_off = SIZEOF_NONRESIDENT_EX_LE;
                if (is_attr_compressed(attr))
-                       attr->nres.c_unit = COMPRESSION_UNIT;
+                       attr->nres.c_unit = NTFS_LZNT_CUNIT;
 
                attr->nres.run_off =
                        cpu_to_le16(SIZEOF_NONRESIDENT_EX + name_size);
index 6dc51faeef8df684d427ed1f33e54976a48dfe48..66407045e69a6934bf0b5c89746a93cd7a2239d5 100644 (file)
@@ -1478,7 +1478,7 @@ int ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir,
                        attr->size = cpu_to_le32(SIZEOF_NONRESIDENT_EX + 8);
                        attr->name_off = SIZEOF_NONRESIDENT_EX_LE;
                        attr->flags = ATTR_FLAG_COMPRESSED;
-                       attr->nres.c_unit = COMPRESSION_UNIT;
+                       attr->nres.c_unit = NTFS_LZNT_CUNIT;
                        asize = SIZEOF_NONRESIDENT_EX + 8;
                } else {
                        attr->size = cpu_to_le32(SIZEOF_NONRESIDENT + 8);
index 3d6143c7abc03f9e113a884ed7506ef4559dabfe..1f2cdb0dbbe1d09f77cbc2112a944562e9d31b4b 100644 (file)
@@ -82,9 +82,6 @@ typedef u32 CLST;
 #define RESIDENT_LCN   ((CLST)-2)
 #define COMPRESSED_LCN ((CLST)-3)
 
-#define COMPRESSION_UNIT     4
-#define COMPRESS_MAX_CLUSTER 0x1000
-
 enum RECORD_NUM {
        MFT_REC_MFT             = 0,
        MFT_REC_MIRR            = 1,