Re: [PATCH] NFS support for btrfs - v2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
>  }
>  
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux