From: Christoph Hellwig <hch@lst.de>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>,
Chandan Babu R <chandan.babu@oracle.com>,
linux-xfs@vger.kernel.org
Subject: Re: [PATCH 5/5] xfs: embedd struct xfbtree into the owning structure
Date: Thu, 4 Jan 2024 07:32:18 +0100 [thread overview]
Message-ID: <20240104063218.GI29215@lst.de> (raw)
In-Reply-To: <20240104012133.GM361584@frogsfrogsfrogs>
On Wed, Jan 03, 2024 at 05:21:33PM -0800, Darrick J. Wong wrote:
> > -int xfbtree_create(struct xfs_mount *mp, const struct xfbtree_config *cfg,
> > - struct xfbtree **xfbtreep);
> > +int xfbtree_init(struct xfs_mount *mp, struct xfbtree *xfbt,
> > + const struct xfs_btree_ops *btree_ops);
>
> Why not pass the xfs_buftarg and the owner into the init function? It
> feels a little funny that the callsites are:
>
> xfbt->target = buftarg;
> xfbt->owner = agno;
> return xfbtree_init(mp, &xfbt, btree_ops);
>
> vs:
>
> return xfbtree_init(mp, &xfbt, buftarg, agno, btree_ops);
Yes, but..
The owner assignment should really just move into the caller of the
helpers, which would clean things up.
And the target one I need to fully understand, but maybe let's bring
this up here and ask the question I was going to ask elsewhere after
doing a bit more research.
The way the in-memory buftargs work right now look weird to me.
Why do we keep the target as a separate concept from the xfbtree?
My logical assumption would be that the xfbtree creates the target
internally and the caller shouldn't have to bother with it.
This also goes further and makes me wonder why the
xfs_buf_cache is embdded in the xfile and not just allocated when
allocating a file-backed buftarg?
Btw, once you start touching the xfbtree can we think a bit about
the naming? Right now we have xfbtree but also a xfs_btree_mem.h,
which seems very confusing. I think just doing a xfs_btree_mem
naming and moving it out of scrub/ would make sense as the concept
isn't really scrub/repair specific. But if we want to stick with
it I'd prefer to not also have _mem-based naming.
next prev parent reply other threads:[~2024-01-04 6:32 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-03 20:38 RFC: in-memory btree simplifications Christoph Hellwig
2024-01-03 20:38 ` [PATCH 1/5] xfs: remove the in-memory btree header block Christoph Hellwig
2024-01-04 1:24 ` Darrick J. Wong
2024-01-04 6:27 ` Christoph Hellwig
2024-01-04 17:25 ` Darrick J. Wong
2024-01-03 20:38 ` [PATCH 2/5] xfs: remove struct xfboff_bitmap Christoph Hellwig
2024-01-03 20:38 ` [PATCH 3/5] xfs: remove bc_ino.flags Christoph Hellwig
2024-01-04 1:10 ` Darrick J. Wong
2024-01-03 20:38 ` [PATCH 4/5] xfs: factor out a xfs_btree_owner helper Christoph Hellwig
2024-01-04 1:14 ` Darrick J. Wong
2024-01-04 6:28 ` Christoph Hellwig
2024-01-03 20:38 ` [PATCH 5/5] xfs: embedd struct xfbtree into the owning structure Christoph Hellwig
2024-01-04 1:21 ` Darrick J. Wong
2024-01-04 6:32 ` Christoph Hellwig [this message]
2024-01-04 7:14 ` Darrick J. Wong
2024-01-04 7:17 ` Christoph Hellwig
2024-01-04 7:22 ` Darrick J. Wong
2024-01-04 19:28 ` Darrick J. Wong
2024-01-05 4:27 ` Christoph Hellwig
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=20240104063218.GI29215@lst.de \
--to=hch@lst.de \
--cc=chandan.babu@oracle.com \
--cc=djwong@kernel.org \
--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).