On May 08, Rajagopal Ananthanarayanan wrote:
> Phil Schwan wrote:
> > Am I correct in seeing that xfs_bmapi() treats argument 3 (block
> > number) as pagesize blocks? (If not, the rest of my questions don't
> > really apply...)
>
> I don't think so. xfs_bmapi & in fact most of xfs works
> with 512-byte blocks. The exception is fs/page_buf.c,
> where the I/O paths work on PAGE_SIZE sized buffers.
Hmm, this is very odd then.
xfs_bmapi(bno=x) returns y, and xfs_bmapi(bno=x+1) returns y + 8, and
I continue along those lines and reach the end of the file 8 times
faster than expected.
In the end, I do something like this:
xfsblock = block >> 3;
error = xfs_bmapi(NULL, xfs_inode, xfsblock, 1, 0, NULL, 0, &mval,
&nmaps, NULL);
return XFS_FSB_TO_DB(xfs_inode, mval.br_startblock) + (block & 7);
and it seems to work. Oh well, I guess I can slather it in FIXMEs and
cross that bridge when we come to it.
-Phil
|