• Fengnan Chang's avatar
    f2fs: compress: add nocompress extensions support · 151b1982
    Fengnan Chang authored
    When we create a directory with enable compression, all file write into
    directory will try to compress.But sometimes we may know, new file
    cannot meet compression ratio requirements.
    We need a nocompress extension to skip those files to avoid unnecessary
    compress page test.
    
    After add nocompress_extension, the priority should be:
    dir_flag < comp_extention,nocompress_extension < comp_file_flag,
    no_comp_file_flag.
    
    Priority in between FS_COMPR_FL, FS_NOCOMP_FS, extensions:
       * compress_extension=so; nocompress_extension=zip; chattr +c dir;
         touch dir/foo.so; touch dir/bar.zip; touch dir/baz.txt; then foo.so
         and baz.txt should be compresse, bar.zip should be non-compressed.
         chattr +c dir/bar.zip can enable compress on bar.zip.
       * compress_extension=so; nocompress_extension=zip; chattr -c dir;
         touch dir/foo.so; touch dir/bar.zip; touch dir/baz.txt; then foo.so
         should be compresse, bar.zip and baz.txt should be non-compressed.
         chattr+c dir/bar.zip; chattr+c dir/baz.txt; can enable compress on
         bar.zip and baz.txt.
    Signed-off-by: default avatarFengnan Chang <changfengnan@vivo.com>
    Reviewed-by: default avatarChao Yu <chao@kernel.org>
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    151b1982
super.c 116 KB