How to get sparse block size and check if data is present at the given offset in sparse file in reiserfs/ext3 in Linux?
I want to use it to implement simple copy-on-write block device using FUSE.
Or I should better keep a bitmap in a separate file?
How to get sparse block size and check if data is present at the given offset in sparse file in reiserfs/ext3 in Linux?
I want to use it to implement simple copy-on-write block device using FUSE.
Or I should better keep a bitmap in a separate file?
/usr/src/linux/Documentation/filesystems/fiemap.txt
fiemap ioctl 是用户空间获取文件范围映射的有效方法。fiemap 不是逐块映射(例如 bmap),而是返回范围列表。
在git://kernel.ubuntu.com/cking/debug-code/fiemap/中有一个简单的使用示例。稀疏文件将缺少“缺失”部分的范围。
好吧, http: //lxr.linux.no/#linux+v2.6.33/arch/um/drivers/cow_user.c表明用户模式Linux为此使用了一个明确的位图,FWIW。