How to check if a block is present in a sparse file (for easy copying to write)?

How to get a sparse block size and check if data is present at a given offset in a sparse file in reiserfs / ext3 on Linux?

I want to use it to implement a simple block copy-on-write device using FUSE.

Or am I better off saving the bitmap in a separate file?

+5
source share
3 answers

/ usr / src / linux / Documentation / File Systems /fiemap.txt

fiemap ioctl is an effective method for accessing a degree users file. Instead of block matching (e.g. bmap), fiemap returns a list of extents.

git://kernel.ubuntu.com/cking/debug-code/ fiemap/, "" .

+4

Linux 3.1, lseek SEEK_HOLE SEEK_DATA , <" > . , .

+2

All Articles