[Top] [All Lists]

Re: Meeting

To: Somdeep Dey <somdeepdey10@xxxxxxxxx>
Subject: Re: Meeting
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Mon, 8 Dec 2014 09:42:07 +1100
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <CAJAKVEETXGiaNKwG=kfDWPoBRqJ0MyjhJLyyPTsMA53oGhQiBQ@xxxxxxxxxxxxxx>
References: <CAFhuFEd3eVhKy1Jg7qL-ycw4XHnAd16kkstpOhOUpwVsAPN5mw@xxxxxxxxxxxxxx> <CAJAKVEHs=FczXUnAYfhbdav1o6JONmD7y0Kgc1xUo1t9g3=63Q@xxxxxxxxxxxxxx> <CAJAKVEFk5oc98gqF8CnGzz7Vsat-i=0da+aYwJh-EGX8eX9sgw@xxxxxxxxxxxxxx> <CAFhuFEc+mbGqZtDVY_wT99dd=FPUKDKZkHN3FYaBgzaVEb=q_A@xxxxxxxxxxxxxx> <CAJAKVEFD0PuFW0eF_Csk1oQJnzZ2eYW=pywHFKJb-ArroRq_cA@xxxxxxxxxxxxxx> <CAJAKVEE2Lu=MReV9fdg0L4OvWAymJJv9qteNDm_1oHyNNcdKVw@xxxxxxxxxxxxxx> <CAF3jHnqRp9HCuXcgv7SBE=kNJ036GysLAx+dgL6v2V_jN2Nrng@xxxxxxxxxxxxxx> <CAJAKVEEAAaf-sA+jbTr8A_HAUMcToo6Esd8ithPvE4tY4TW2NA@xxxxxxxxxxxxxx> <20141201043155.GH16151@dastard> <CAJAKVEETXGiaNKwG=kfDWPoBRqJ0MyjhJLyyPTsMA53oGhQiBQ@xxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Sun, Dec 07, 2014 at 05:27:16PM +0530, Somdeep Dey wrote:
> Hi,
> Good to hear about the progress related to rmap. We'll continue
> working here on our side.
> As we mentioned previously, we've familiarized ourselves
> with the fiemap interface and developed an understanding
> of how the ioctl works.
> We also went through different discussions on the mailing
> list related to fiemap, as well as obtained the latest patches.
> While working on the rmap, would it be possible for you to
> give us some essential details about the required fiemap
> interface, so that we can obtain a clearer understanding of
>  what we are required to do.

Turn FS_IOC_FIEMAPFS into an XFS specific ioctl that uses the fiemap
plumbing. Here's the original kernel patch that I wrote that
implemented FS_IOC_FIEMAPFS. This was the original fiemap extension


And I mentioned that it needed to be converted to FS_IOC_FIEMAPFS
due to review suggesting that it should be separate from file based
fiemap commands. I never posted those patches; I just forward ported
them to a current 3.18-rc7+for-next XFS tree and pushed them to the
fiemapfs fiemapfs branch in my kernel tree at:


The original xfs_spaceman tool that I wrote to call the fiemap
interface and make use of it is here:


I just updated it to the 3.2.2 code base and pushed it to the
spaceman branch in this tree:


This code mostly works:

$ uname -a
Linux test4 3.18.0-rc7-dgc+ #629 SMP Mon Dec 8 09:20:09 EST 2014 x86_64 
$ sudo xfs_spaceman -V
xfs_spaceman version 3.2.2
$ sudo xfs_db -V
xfs_db version 3.2.2
$ sudo xfs_db -r -c "freesp" /dev/vdc
   from      to extents  blocks    pct
      1       1    2018    2018   0.00
      2       3      23      64   0.00
4194304 8388607      64 536595213   0.40
134217728 268435455     500 133680330088  99.60
$ sudo xfs_spaceman -c "freesp" /mnt/scratch
   from      to extents  blocks    pct
      1       1      18      18   0.00
      2       3      23      64   0.00
4194304 8388607      64 536595213   0.40
134217728 268435455     500 133680330088  99.60

It looks like FS_IOC_FIEMAPFS isn't accounting blocks in teh AGFL
(4 per AG, and there are 500 AGs in that filesystem), so that
will need to be added to the kernel code that iterates the free

Christoph has (more recently) suggested that this should be
implemented as an XFS specific ioctl (XFS_IOC_FIEMAPFS) that makes
use of all the existing fiemap infrastructure to implement it. That
means we can review it and push it as we need, and that makes the
process much simpler.

This means the kernel patches need to change - the ioctl
infrastructure for XFS_IOC_FIEMAPFS needs to be added to
fs/xfs/xfs_ioctl.c and the new ioctl definition and flags added to
fs/xfs/xfs_fs.h rather than to include/linux/....  i.e. the first
patch needs to be reworked to do this. It can also call the
xfs_fs_fiemapfs() function implemented in the second patch directly
rather than through an operations vector.

The change to the userspace code should just be to use the new ioctl
definition and flags, as the rest of the code is unchanged. I
strongly suggest that you work on the kernel patches to get the API
and ioctl code correct ASAP so we can get this into the tree ASAP;
that will make your life easier if you don't have to run patched
kernels just to test everything you are doing in userspace. Not to
mention having the code already committed upstream will look really
good in your final reports. :)


Dave Chinner

<Prev in Thread] Current Thread [Next in Thread>
  • Re: Meeting, Somdeep Dey
    • Re: Meeting, Dave Chinner <=