xfs
[Top] [All Lists]

Re: xfs_bmapi

To: Rajagopal Ananthanarayanan <ananth@xxxxxxx>
Subject: Re: xfs_bmapi
From: Phil Schwan <phil@xxxxxxxxxxxxx>
Date: Mon, 8 May 2000 13:02:43 -0400
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <3916EEA5.CA068CB4@sgi.com>; from Rajagopal Ananthanarayanan on Mon, May 08, 2000 at 09:43:17AM -0700
References: <20000508121110.A2426@linuxcare.com> <3916EEA5.CA068CB4@sgi.com>
Sender: owner-linux-xfs@xxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>