From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: sandeen@sandeen.net, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/6] libfrog: introduce xfs_fd to wrap an fd to a file on an xfs filesystem
Date: Tue, 27 Aug 2019 16:41:57 +1000 [thread overview]
Message-ID: <20190827064157.GB1119@dread.disaster.area> (raw)
In-Reply-To: <156633304473.1215733.8975368605160374407.stgit@magnolia>
On Tue, Aug 20, 2019 at 01:30:44PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Introduce a new "xfs_fd" context structure where we can store a file
> descriptor and all the runtime fs context (geometry, which ioctls work,
> etc.) that goes with it. We're going to create wrappers for the
> bulkstat and inumbers ioctls in subsequent patches; and when we
> introduce the v5 bulkstat/inumbers ioctls we'll need all that context to
> downgrade gracefully on old kernels. Start the transition by adopting
> xfs_fd natively in scrub.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
> include/xfrog.h | 20 ++++++++++++++++++++
naming.
> libfrog/fsgeom.c | 25 +++++++++++++++++++++++++
> scrub/fscounters.c | 22 ++++++++++++----------
> scrub/inodes.c | 10 +++++-----
> scrub/phase1.c | 41 ++++++++++++++++++++---------------------
> scrub/phase2.c | 2 +-
> scrub/phase3.c | 4 ++--
> scrub/phase4.c | 8 ++++----
> scrub/phase5.c | 2 +-
> scrub/phase6.c | 6 +++---
> scrub/phase7.c | 2 +-
> scrub/repair.c | 4 ++--
> scrub/scrub.c | 12 ++++++------
> scrub/spacemap.c | 12 ++++++------
> scrub/vfs.c | 2 +-
> scrub/xfs_scrub.h | 7 ++++---
> 16 files changed, 113 insertions(+), 66 deletions(-)
>
>
> diff --git a/include/xfrog.h b/include/xfrog.h
> index 5420b47c..f3808911 100644
> --- a/include/xfrog.h
> +++ b/include/xfrog.h
> @@ -19,4 +19,24 @@
> struct xfs_fsop_geom;
> int xfrog_geometry(int fd, struct xfs_fsop_geom *fsgeo);
>
> +/*
> + * Structure for recording whatever observations we want about the level of
> + * xfs runtime support for this fd. Right now we only store the fd and fs
> + * geometry.
> + */
> +struct xfs_fd {
> + /* ioctl file descriptor */
> + int fd;
> +
> + /* filesystem geometry */
> + struct xfs_fsop_geom fsgeom;
> +};
> +
> +/* Static initializers */
> +#define XFS_FD_INIT(_fd) { .fd = (_fd), }
> +#define XFS_FD_INIT_EMPTY XFS_FD_INIT(-1)
> +
> +int xfrog_prepare_geometry(struct xfs_fd *xfd);
> +int xfrog_close(struct xfs_fd *xfd);
I'd much prefer to see these named xfd_prepare_geometry() and
xfd_close()...
> ci = calloc(1, sizeof(struct xfs_count_inodes) +
> - (ctx->geo.agcount * sizeof(uint64_t)));
> + (ctx->mnt.fsgeom.agcount * sizeof(uint64_t)));
This gets a bit verbose, but.... <shrug> .... doesn't make that much
of a mess...
Ok, apart from the naming thing, this looks ok.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2019-08-27 6:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-20 20:30 [PATCH 0/6] libxfrog: wrap version ioctl calls Darrick J. Wong
2019-08-20 20:30 ` [PATCH 1/6] libfrog: refactor online geometry queries Darrick J. Wong
2019-08-27 6:30 ` Dave Chinner
2019-08-28 17:08 ` Darrick J. Wong
2019-08-20 20:30 ` [PATCH 2/6] libfrog: introduce xfs_fd to wrap an fd to a file on an xfs filesystem Darrick J. Wong
2019-08-27 6:41 ` Dave Chinner [this message]
2019-08-28 17:15 ` Darrick J. Wong
2019-08-20 20:30 ` [PATCH 3/6] libfrog: store more inode and block geometry in struct xfs_fd Darrick J. Wong
2019-08-27 7:00 ` Dave Chinner
2019-08-20 20:30 ` [PATCH 4/6] libfrog: create online fs geometry converters Darrick J. Wong
2019-08-27 7:11 ` Dave Chinner
2019-08-28 17:35 ` Darrick J. Wong
2019-08-20 20:31 ` [PATCH 5/6] libfrog: refactor open-coded bulkstat calls Darrick J. Wong
2019-08-27 7:25 ` Dave Chinner
2019-08-20 20:31 ` [PATCH 6/6] libfrog: refactor open-coded INUMBERS calls Darrick J. Wong
2019-08-27 7:26 ` Dave Chinner
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=20190827064157.GB1119@dread.disaster.area \
--to=david@fromorbit.com \
--cc=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@sandeen.net \
/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).