From: Allison Collins <allison.henderson@oracle.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/2] xfs: refactor free space btree record initialization
Date: Fri, 21 Jun 2019 09:55:10 -0700 [thread overview]
Message-ID: <3a5790e5-6d80-706b-a67e-64c2083f1737@oracle.com> (raw)
In-Reply-To: <156105617569.1200596.13164807309283607454.stgit@magnolia>
On 6/20/19 11:42 AM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Refactor the code that populates the free space btrees of a new AG so
> that we can avoid code duplication once things start getting
> complicated.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Looks fine
Reviewed-by: Allison Collins <allison.henderson@oracle.com>
> ---
> fs/xfs/libxfs/xfs_ag.c | 27 ++++++++++++++++-----------
> 1 file changed, 16 insertions(+), 11 deletions(-)
>
>
> diff --git a/fs/xfs/libxfs/xfs_ag.c b/fs/xfs/libxfs/xfs_ag.c
> index 5efb82744664..80a3df7ccab3 100644
> --- a/fs/xfs/libxfs/xfs_ag.c
> +++ b/fs/xfs/libxfs/xfs_ag.c
> @@ -56,37 +56,42 @@ xfs_btroot_init(
> xfs_btree_init_block(mp, bp, id->type, 0, 0, id->agno);
> }
>
> -/*
> - * Alloc btree root block init functions
> - */
> +/* Finish initializing a free space btree. */
> static void
> -xfs_bnoroot_init(
> +xfs_freesp_init_recs(
> struct xfs_mount *mp,
> struct xfs_buf *bp,
> struct aghdr_init_data *id)
> {
> struct xfs_alloc_rec *arec;
>
> - xfs_btree_init_block(mp, bp, XFS_BTNUM_BNO, 0, 1, id->agno);
> arec = XFS_ALLOC_REC_ADDR(mp, XFS_BUF_TO_BLOCK(bp), 1);
> arec->ar_startblock = cpu_to_be32(mp->m_ag_prealloc_blocks);
> arec->ar_blockcount = cpu_to_be32(id->agsize -
> be32_to_cpu(arec->ar_startblock));
> }
>
> +/*
> + * Alloc btree root block init functions
> + */
> static void
> -xfs_cntroot_init(
> +xfs_bnoroot_init(
> struct xfs_mount *mp,
> struct xfs_buf *bp,
> struct aghdr_init_data *id)
> {
> - struct xfs_alloc_rec *arec;
> + xfs_btree_init_block(mp, bp, XFS_BTNUM_BNO, 0, 1, id->agno);
> + xfs_freesp_init_recs(mp, bp, id);
> +}
>
> +static void
> +xfs_cntroot_init(
> + struct xfs_mount *mp,
> + struct xfs_buf *bp,
> + struct aghdr_init_data *id)
> +{
> xfs_btree_init_block(mp, bp, XFS_BTNUM_CNT, 0, 1, id->agno);
> - arec = XFS_ALLOC_REC_ADDR(mp, XFS_BUF_TO_BLOCK(bp), 1);
> - arec->ar_startblock = cpu_to_be32(mp->m_ag_prealloc_blocks);
> - arec->ar_blockcount = cpu_to_be32(id->agsize -
> - be32_to_cpu(arec->ar_startblock));
> + xfs_freesp_init_recs(mp, bp, id);
> }
>
> /*
>
next prev parent reply other threads:[~2019-06-21 16:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-20 18:42 [PATCH 0/2] xfs: help mkfs shed its AG initialization code Darrick J. Wong
2019-06-20 18:42 ` [PATCH 1/2] xfs: refactor free space btree record initialization Darrick J. Wong
2019-06-21 16:55 ` Allison Collins [this message]
2019-06-20 18:43 ` [PATCH 2/2] xfs: account for log space when formatting new AGs Darrick J. Wong
2019-06-21 16:55 ` Allison Collins
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3a5790e5-6d80-706b-a67e-64c2083f1737@oracle.com \
--to=allison.henderson@oracle.com \
--cc=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).