Hi Gao,
In the current design, for uncompressed files, we only maintain the starting block address.because rest of the data blocks will follow it (continuous allocation).
For sparse files we have to do following
1) We don't want to allocate space for holes (Holes will be multiple of EROFS_BLKSZ ?)
2) For read() operation on holes, return null data = '\0'.
I have few thoughts about it:
1) Without changing the current design much, we want to keep track of holes in file.
e.g maintaining some table OR bitmap(per inode), to check if given offset falls inside hole or real data.
2) Accordingly changing the readpage() aop.
Let me know you thoughts on this.
--Pratik.