From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/2] xfs: hoist xfs_scrub_agfl_walk to libxfs as xfs_agfl_walk
Date: Tue, 3 Apr 2018 11:53:48 +1000 [thread overview]
Message-ID: <20180403015348.GJ1150@dastard> (raw)
In-Reply-To: <152269894202.16253.2257249480679291752.stgit@magnolia>
On Mon, Apr 02, 2018 at 12:55:42PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> This function is basically a generic AGFL block iterator, so promote it
> to libxfs ahead of online repair wanting to use it.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
> fs/xfs/libxfs/xfs_alloc.c | 37 +++++++++++++++++++++
> fs/xfs/libxfs/xfs_alloc.h | 5 +++
> fs/xfs/scrub/agheader.c | 78 ++++++++-------------------------------------
> fs/xfs/scrub/common.h | 4 --
> 4 files changed, 55 insertions(+), 69 deletions(-)
>
>
> diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> index 4c03ec2..d860116 100644
> --- a/fs/xfs/libxfs/xfs_alloc.c
> +++ b/fs/xfs/libxfs/xfs_alloc.c
> @@ -3128,3 +3128,40 @@ xfs_alloc_has_record(
>
> return xfs_btree_has_record(cur, &low, &high, exists);
> }
> +
> +/*
> + * Walk all the blocks in the AGFL. The fn function can return any negative
> + * error code or XFS_BTREE_QUERY_RANGE_ABORT.
> + */
> +int
> +xfs_agfl_walk(
> + struct xfs_mount *mp,
> + struct xfs_agf *agf,
> + struct xfs_buf *agflbp,
> + xfs_agfl_walk_fn fn,
xfs_agfl_walk_fn walk_fn,
I don't really like "fn" as a variable - it's hard to pick out what
it does and where it's called in the code.
Also, the comment would make more sense as "The @walk_fn can return
any negative....
Otherwise looks OK.
-Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2018-04-03 1:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-02 19:55 [PATCH 0/2] xfs: online scrub fixes Darrick J. Wong
2018-04-02 19:55 ` [PATCH 1/2] xfs: skip scrub xref if corruption already noted Darrick J. Wong
2018-04-03 1:48 ` Dave Chinner
2018-04-03 3:00 ` [PATCH v2 " Darrick J. Wong
2018-04-02 19:55 ` [PATCH 2/2] xfs: hoist xfs_scrub_agfl_walk to libxfs as xfs_agfl_walk Darrick J. Wong
2018-04-03 1:53 ` Dave Chinner [this message]
2018-04-03 3:01 ` [PATCH v2 " Darrick J. Wong
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=20180403015348.GJ1150@dastard \
--to=david@fromorbit.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).