Re: [PATCH 08/71] xfs: introduce refcount btree definitions

Christoph Hellwig <[email protected]>
Newsgroups gmane.comp.file-systems.xfs.general
Message-ID <[email protected]>
On Thu, Aug 25, 2016 at 04:32:50PM -0700, Darrick J. Wong wrote:
> Add new per-AG refcount btree definitions to the per-AG structures.
> 
> v2: Move the reflink inode flag out of the way of the DAX flag, and
> add the new cowextsize flag.
> 
> v3: Don't allow pNFS to export reflinked files; this will be removed
> some day when the Linux pNFS server supports it.
> 
> [hch: don't allow pNFS export of reflinked files]
> [darrick: fix the feature test in hch's patch]

This was such a tiny check in the grand scheme of things, feel free to drop any mention of it

>  /*
>   * For logging record fields.
> @@ -105,6 +106,7 @@ do {    \
>  	case XFS_BTNUM_INO: __XFS_BTREE_STATS_INC(__mp, ibt, stat); break; \
>  	case XFS_BTNUM_FINO: __XFS_BTREE_STATS_INC(__mp, fibt, stat); break; \
>  	case XFS_BTNUM_RMAP: __XFS_BTREE_STATS_INC(__mp, rmap, stat); break; \
> +	case XFS_BTNUM_REFC: break; \

I'd merge the refcount stats into this patch, it's a fairly tiny
addition to an already small patch.

> +static inline bool xfs_sb_version_hasreflink(struct xfs_sb *sbp)
> +{
> +	return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5) &&

no need for the braces here..

>  {
> -	mp->m_rmap_maxlevels = xfs_btree_compute_maxlevels(mp,
> -			mp->m_rmap_mnr, mp->m_sb.sb_agblocks);
> +	if (xfs_sb_version_hasreflink(&mp->m_sb))
> +		mp->m_rmap_maxlevels = XFS_BTREE_MAXLEVELS;
> +	else

Hmm, any good explanation for the magic XFS_BTREE_MAXLEVELS value
here?  Maybe even one that could go into a comment?

> diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
> index a3c2e2d..6141d68 100644
> --- a/fs/xfs/xfs_mount.h
> +++ b/fs/xfs/xfs_mount.h
> @@ -393,6 +393,9 @@ typedef struct xfs_perag {
>  	struct xfs_ag_resv	pag_meta_resv;
>  	/* Blocks reserved for just AGFL-based metadata. */
>  	struct xfs_ag_resv	pag_agfl_resv;
> +
> +	/* reference count */
> +	__uint8_t	pagf_refcount_level;
>  } xfs_perag_t;

The indentation doesn't seem to match the fields above.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.