aboutsummaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/ovl_entry.h
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@mykernel.net>2019-11-01 20:35:51 +0800
committerMiklos Szeredi <mszeredi@redhat.com>2020-01-22 20:11:41 +0100
commitb504c6540d1752c73e16548062c49bc9f447cb12 (patch)
tree4e18011188b62d98bcaa07164cd24dafc69338a3 /fs/overlayfs/ovl_entry.h
parentovl: use ovl_inode_lock in ovl_llseek() (diff)
downloadlinux-dev-b504c6540d1752c73e16548062c49bc9f447cb12.tar.xz
linux-dev-b504c6540d1752c73e16548062c49bc9f447cb12.zip
ovl: improving copy-up efficiency for big sparse file
Current copy-up is not efficient for big sparse file, It's not only slow but also wasting more disk space when the target lower file has huge hole inside. This patch tries to recognize file hole and skip it during copy-up. Detail logic of hole detection as below: When we detect next data position is larger than current position we will skip that hole, otherwise we copy data in the size of OVL_COPY_UP_CHUNK_SIZE. Actually, it may not recognize all kind of holes and sometimes only skips partial of hole area. However, it will be enough for most of the use cases. Additionally, this optimization relies on lseek(2) SEEK_DATA implementation, so for some specific filesystems which do not support this feature will behave as before on copy-up. Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Chengguang Xu <cgxu519@mykernel.net> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/ovl_entry.h')
0 files changed, 0 insertions, 0 deletions