linux-stable/Documentation/filesystems
Chao Yu 4c8ff7095b f2fs: support data compression
This patch tries to support compression in f2fs.

- New term named cluster is defined as basic unit of compression, file can
be divided into multiple clusters logically. One cluster includes 4 << n
(n >= 0) logical pages, compression size is also cluster size, each of
cluster can be compressed or not.

- In cluster metadata layout, one special flag is used to indicate cluster
is compressed one or normal one, for compressed cluster, following metadata
maps cluster to [1, 4 << n - 1] physical blocks, in where f2fs stores
data including compress header and compressed data.

- In order to eliminate write amplification during overwrite, F2FS only
support compression on write-once file, data can be compressed only when
all logical blocks in file are valid and cluster compress ratio is lower
than specified threshold.

- To enable compression on regular inode, there are three ways:
* chattr +c file
* chattr +c dir; touch dir/file
* mount w/ -o compress_extension=ext; touch file.ext

Compress metadata layout:
                             [Dnode Structure]
             +-----------------------------------------------+
             | cluster 1 | cluster 2 | ......... | cluster N |
             +-----------------------------------------------+
             .           .                       .           .
       .                       .                .                      .
  .         Compressed Cluster       .        .        Normal Cluster            .
+----------+---------+---------+---------+  +---------+---------+---------+---------+
|compr flag| block 1 | block 2 | block 3 |  | block 1 | block 2 | block 3 | block 4 |
+----------+---------+---------+---------+  +---------+---------+---------+---------+
           .                             .
         .                                           .
       .                                                           .
      +-------------+-------------+----------+----------------------------+
      | data length | data chksum | reserved |      compressed data       |
      +-------------+-------------+----------+----------------------------+

Changelog:

20190326:
- fix error handling of read_end_io().
- remove unneeded comments in f2fs_encrypt_one_page().

20190327:
- fix wrong use of f2fs_cluster_is_full() in f2fs_mpage_readpages().
- don't jump into loop directly to avoid uninitialized variables.
- add TODO tag in error path of f2fs_write_cache_pages().

20190328:
- fix wrong merge condition in f2fs_read_multi_pages().
- check compressed file in f2fs_post_read_required().

20190401
- allow overwrite on non-compressed cluster.
- check cluster meta before writing compressed data.

20190402
- don't preallocate blocks for compressed file.

- add lz4 compress algorithm
- process multiple post read works in one workqueue
  Now f2fs supports processing post read work in multiple workqueue,
  it shows low performance due to schedule overhead of multiple
  workqueue executing orderly.

20190921
- compress: support buffered overwrite
C: compress cluster flag
V: valid block address
N: NEW_ADDR

One cluster contain 4 blocks

 before overwrite   after overwrite

- VVVV		->	CVNN
- CVNN		->	VVVV

- CVNN		->	CVNN
- CVNN		->	CVVV

- CVVV		->	CVNN
- CVVV		->	CVVV

20191029
- add kconfig F2FS_FS_COMPRESSION to isolate compression related
codes, add kconfig F2FS_FS_{LZO,LZ4} to cover backend algorithm.
note that: will remove lzo backend if Jaegeuk agreed that too.
- update codes according to Eric's comments.

20191101
- apply fixes from Jaegeuk

20191113
- apply fixes from Jaegeuk
- split workqueue for fsverity

20191216
- apply fixes from Jaegeuk

20200117
- fix to avoid NULL pointer dereference

[Jaegeuk Kim]
- add tracepoint for f2fs_{,de}compress_pages()
- fix many bugs and add some compression stats
- fix overwrite/mmap bugs
- address 32bit build error, reported by Geert.
- bug fixes when handling errors and i_compressed_blocks

Reported-by: <noreply@ellerman.id.au>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2020-01-17 16:48:07 -08:00
..
caching
cifs various cifs/smb3 fixes (including for share deleted cases) and features including improved encrypted read performance, and various debugging improvements 2019-09-19 10:32:16 -07:00
configfs
ext4 Added new ext4 debugging ioctls to allow userspace to get information 2019-09-21 13:37:39 -07:00
nfs docs: fs: convert docs without extension to ReST 2019-07-31 13:31:05 -06:00
9p.txt
adfs.txt
affs.txt
afs.txt
api-summary.rst docs: no structured comments in fs/file_table.c 2019-05-24 15:03:39 -06:00
autofs-mount-control.txt autofs: update mount control expire desription with AUTOFS_EXP_FORCED 2019-05-14 19:52:50 -07:00
autofs.rst docs: filesystems: Add mount map description in Content 2019-11-18 12:19:59 -07:00
automount-support.txt
befs.txt
bfs.txt
btrfs.txt
ceph.txt ceph: auto reconnect after blacklisted 2019-09-16 12:06:24 +02:00
coda.txt coda: Fix typo in the struct CodaCred documentation 2019-07-30 14:19:41 -06:00
cramfs.txt
dax.txt Documentation: filesystem: Convert xfs.txt to ReST 2019-07-15 09:15:09 -07:00
debugfs.txt debugfs: Add debugfs_create_xul() for hexadecimal unsigned long 2019-11-03 18:08:53 +01:00
devpts.txt
directory-locking.rst docs: fs: convert docs without extension to ReST 2019-07-31 13:31:05 -06:00
dlmfs.txt
dnotify.txt
ecryptfs.txt
efivarfs.txt
erofs.txt erofs: kill use_vmap module parameter 2019-09-05 20:10:09 +02:00
ext2.txt doc: ext2: update description of quota options for ext2 2019-05-20 10:50:48 +02:00
ext3.txt
f2fs.txt f2fs: support data compression 2020-01-17 16:48:07 -08:00
fiemap.txt
files.txt
fscrypt.rst This merge window saw the the following new featuers added to ext4: 2019-11-30 10:53:02 -08:00
fsverity.rst docs: fs-verity: mention statx() support 2019-11-13 12:15:34 -08:00
fuse-io.txt
fuse.txt
gfs2-glocks.txt
gfs2-uevents.txt
gfs2.txt
hfs.txt
hfsplus.txt
hpfs.txt
index.rst docs: filesystems: convert autofs.txt to reST 2019-11-18 12:17:17 -07:00
inotify.txt
isofs.txt
journalling.rst
locking.rst Documentation: atomic_open called with shared lock on non-O_CREAT open 2019-11-07 13:17:25 -07:00
locks.txt
mandatory-locking.txt locks: print a warning when mount fails due to lack of "mand" support 2019-08-16 12:13:48 -04:00
mount_api.txt
nilfs2.txt
ntfs.txt
ocfs2-online-filecheck.txt
ocfs2.txt
omfs.txt
orangefs.txt
overlayfs.txt ovl: fix regression caused by overlapping layers detection 2019-07-16 13:23:40 +02:00
path-lookup.rst
path-lookup.txt
porting.rst docs: fs: porting.rst: fix a broken reference to another doc 2019-07-31 14:30:23 -06:00
proc.txt mm: thp: fix false negative of shmem vma's THP eligibility 2019-07-18 17:08:06 -07:00
qnx6.txt
quota.txt
ramfs-rootfs-initramfs.txt docs: early-userspace: move to driver-api guide 2019-07-15 11:03:01 -03:00
relay.txt
romfs.txt
seq_file.txt
sharedsubtree.txt
splice.rst
spufs.txt
squashfs.txt
sysfs-pci.txt
sysfs-tagging.txt
sysfs.txt docs: driver-model: move it to the driver-api book 2019-07-15 11:03:02 -03:00
sysv-fs.txt
tmpfs.txt docs: cgroup-v1: add it to the admin-guide book 2019-07-15 11:03:02 -03:00
ubifs-authentication.rst docs: ubifs-authentication.md: convert to ReST 2019-07-31 13:25:22 -06:00
ubifs.txt
udf.txt
vfat.txt
vfs.rst docs: fs: convert docs without extension to ReST 2019-07-31 13:31:05 -06:00
virtiofs.rst virtio-fs: add Documentation/filesystems/virtiofs.rst 2019-09-18 15:09:34 +02:00
xfs-delayed-logging-design.txt Documentation: xfs: Fix typo 2019-06-07 11:42:20 -06:00
xfs-self-describing-metadata.txt xfs: add struct xfs_mount pointer to struct xfs_buf 2019-06-28 19:27:29 -07:00