xfs
[Top] [All Lists]

Re: [RFC] add FIEMAP ioctl to efficiently map file allocation

To: Mark Fasheh <mark.fasheh@xxxxxxxxxx>, linux-fsdevel@xxxxxxxxxxxxxxx, David Chinner <dgc@xxxxxxx>, linux-ext4@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, hch@xxxxxxxxxxxxx, Anton Altaparmakov <aia21@xxxxxxxxx>, Mike Waychison <mikew@xxxxxxxxxx>, ocfs2-devel@xxxxxxxxxxxxxx
Subject: Re: [RFC] add FIEMAP ioctl to efficiently map file allocation
From: Andreas Dilger <adilger@xxxxxxx>
Date: Mon, 29 Oct 2007 16:29:07 -0600
In-reply-to: <20071029221302.GD3042@xxxxxxxxxxxxxxxxxx>
Mail-followup-to: Mark Fasheh <mark.fasheh@xxxxxxxxxx>, linux-fsdevel@xxxxxxxxxxxxxxx, David Chinner <dgc@xxxxxxx>, linux-ext4@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, hch@xxxxxxxxxxxxx, Anton Altaparmakov <aia21@xxxxxxxxx>, Mike Waychison <mikew@xxxxxxxxxx>, ocfs2-devel@xxxxxxxxxxxxxx
References: <20070419002139.GK5967@xxxxxxxxxxxxxxxxxxxx> <20070419015426.GM48531920@xxxxxxxxxxxxxxxxx> <20070430224401.GX5967@xxxxxxxxxxxxxxxxxxxx> <20070501042254.GD77450368@xxxxxxxxxxxxxxxxx> <1FA8E92B-954D-4624-A089-80D4AA7399FD@xxxxxxxxx> <20070502000654.GK77450368@xxxxxxxxxxxxxxxxx> <8464EA47-03AC-4162-A2D0-683517568640@xxxxxxxxx> <20071029194507.GA8578@xxxxxxxxxxxxxxxxxx> <20071029205744.GB28607@xxxxxxxxxxxxxxxxxxxxxxxx> <20071029221302.GD3042@xxxxxxxxxxxxxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.16 (2007-06-09)
On Oct 29, 2007  16:13 -0600, Andreas Dilger wrote:
> On Oct 29, 2007  13:57 -0700, Mark Fasheh wrote:
> > I'm a little bit confused by fe_offset. Is it a physical offset, or a
> > logical offset? The reason I ask is that your description above says "FIEMAP
> > ioctl will return the logical to physical mapping for the extent that
> > contains the specified logical byte address." Which seems to imply physical,
> > but your math to get to the next logical start in a very fragmented file,
> > implies that fe_offset is a logical offset:
> > 
> >        fm_start = fm_extents[fm_extent_count - 1].fe_offset +
> >                          fm_extents[fm_extent_count - 1].fe_length + 1; 
> 
> Note the distinction between "fe_offset" (which is a physical offset for
> a single extent) and "fm_offset" (which is a logical offset for that file).

Actually, that is completely bunk.  What it should say is something like:
"filefrag can easily call the FIEMAP ioctls repeatedly using the returned
fm_start and fm_length as the start offset for the next ioctl:

        fiemap.fm_start = fiemap.fm_start + fiemap.fm_length + 1;

Cheers, Andreas
--
Andreas Dilger
Sr. Software Engineer, Lustre Group
Sun Microsystems of Canada, Inc.


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