From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Mason Subject: Re: [PATCH] NFS support for btrfs - v2 Date: Mon, 18 Aug 2008 15:15:48 -0400 Message-ID: <1219086948.14063.17.camel@think.oraclecorp.com> References: <200807210201.56690.balajirrao@gmail.com> <1218974002.3184.278.camel@pmac.infradead.org> <200808171821.43874.balajirrao@gmail.com> <1219060264.3184.366.camel@pmac.infradead.org> <1219061414.3184.368.camel@pmac.infradead.org> Mime-Version: 1.0 Content-Type: text/plain Cc: Balaji Rao , linux-btrfs@vger.kernel.org To: David Woodhouse Return-path: In-Reply-To: <1219061414.3184.368.camel@pmac.infradead.org> List-ID: On Mon, 2008-08-18 at 13:10 +0100, David Woodhouse wrote: > On Mon, 2008-08-18 at 12:51 +0100, David Woodhouse wrote: > > The patch below works OK, but doesn't yet handle > > subvolumes -- it gives the same fsid for all subvolumes. > > Is this the correct fix? > This looks sane: -chris > diff --git a/super.c b/super.c > index 6446ab7..55f4d00 100644 > --- a/super.c > +++ b/super.c > @@ -503,6 +503,10 @@ static int btrfs_statfs(struct dentry *dentry, struct kstatfs *buf) > on a big-endian or little-endian host */ > buf->f_fsid.val[0] = be32_to_cpu(fsid[0]) ^ be32_to_cpu(fsid[2]); > buf->f_fsid.val[1] = be32_to_cpu(fsid[1]) ^ be32_to_cpu(fsid[3]); > + /* Mask in the root object ID too, to disambiguate subvols */ > + buf->f_fsid.val[0] ^= BTRFS_I(dentry->d_inode)->root->objectid >> 32; > + buf->f_fsid.val[1] ^= BTRFS_I(dentry->d_inode)->root->objectid; > + > return 0; > } > >