diff options
author | Phillip Lougher <phillip@squashfs.org.uk> | 2025-09-23 23:06:52 +0100 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2025-09-28 11:36:14 -0700 |
commit | dec91e7ab10ec465d59144aabe69c01723ddd1c4 (patch) | |
tree | c788c81c88a3387b25ad5162052072e6c8a5605d /fs/squashfs/squashfs_fs.h | |
parent | 9ee94bfbe930a1b39df53fa2d7b31141b780eb5a (diff) |
Squashfs: add SEEK_DATA/SEEK_HOLE support
Add support for SEEK_DATA and SEEK_HOLE lseek() whence values.
These allow much faster searches for holes and data in sparse files, which
can significantly speed up file copying, e.g.
before (GNU coreutils, Debian 13):
cp --sparse=always big-file /
took real 11m58s, user 0m5.764s, sys 11m48s
after:
real 0.047s, user 0.000s, sys 0.027s
Where big-file has a 256 GB hole followed by 47 KB of data.
Link: https://lkml.kernel.org/r/20250923220652.568416-3-phillip@squashfs.org.uk
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs/squashfs/squashfs_fs.h')
-rw-r--r-- | fs/squashfs/squashfs_fs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/squashfs/squashfs_fs.h b/fs/squashfs/squashfs_fs.h index 95f8e8901768..a955d9369749 100644 --- a/fs/squashfs/squashfs_fs.h +++ b/fs/squashfs/squashfs_fs.h @@ -208,6 +208,7 @@ static inline int squashfs_block_size(__le32 raw) #define SQUASHFS_META_INDEXES (SQUASHFS_METADATA_SIZE / sizeof(unsigned int)) #define SQUASHFS_META_ENTRIES 127 #define SQUASHFS_META_SLOTS 8 +#define SQUASHFS_SCAN_INDEXES 1024 struct meta_entry { u64 data_block; |