From: Christoph Hellwig <hch@lst.de>
To: Dave Chinner <david@fromorbit.com>
Cc: Christoph Hellwig <hch@lst.de>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/5] xfs: replace xfs_buf_incore with an XBF_NOALLOC flag to xfs_buf_get*
Date: Wed, 6 Apr 2022 18:24:42 +0200 [thread overview]
Message-ID: <20220406162441.GA590@lst.de> (raw)
In-Reply-To: <20220405212133.GY1544202@dread.disaster.area>
On Wed, Apr 06, 2022 at 07:21:33AM +1000, Dave Chinner wrote:
> > I had that earlier, but having xfs_buf_incore as the odd one out that
> > still returns a buffer (like most XFS buffer cache routines did back
> > a long time ago) just did seem pretty odd compared tothe rest.
>
> Then let's fix that to use the same interface as everything else,
> and that simplifies the implementation down to just:
>
> static inline int
> xfs_buf_incore(
> struct xfs_buftarg *target,
> xfs_daddr_t blkno,
> size_t numblks,
> xfs_buf_flags_t flags,
> struct xfs_buf **bpp)
> {
> DEFINE_SINGLE_BUF_MAP(map, blkno, numblks);
>
> return xfs_buf_get_map(target, &map, 1, _XBF_INCORE | flags,
> NULL, bpp);
> }
>
> And, FWIW, the _XBF_NOALLOC flag really wants to be _XBF_INCORE - we
> need it to describe the lookup behaviour the flag provides, not the
> internal implementation detail that acheives the desired
> behaviour....
At least in my mental model a 'find but do not allocate' matches
the lookup behavior more than the somewhat odd 'incore' name. I know
it is something traditional Unix including IRIX has used forever,
but it is a bit of an odd choice with no history in Linux.
That being said the flag and the wrapper should match, so IFF we keep
xfs_buf_incore the flag should also be _XBF_INCORE. Still not my
preference, though.
next prev parent reply other threads:[~2022-04-06 17:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-03 12:01 lockless and cleaned up buffer lookup Christoph Hellwig
2022-04-03 12:01 ` [PATCH 1/5] xfs: add a flags argument to xfs_buf_get Christoph Hellwig
2022-04-03 12:01 ` [PATCH 2/5] xfs: replace xfs_buf_incore with an XBF_NOALLOC flag to xfs_buf_get* Christoph Hellwig
2022-04-03 21:54 ` Dave Chinner
2022-04-05 14:55 ` Christoph Hellwig
2022-04-05 21:21 ` Dave Chinner
2022-04-06 16:24 ` Christoph Hellwig [this message]
2022-04-03 12:01 ` [PATCH 3/5] xfs: remove a superflous hash lookup when inserting new buffers Christoph Hellwig
2022-04-03 23:04 ` Dave Chinner
2022-04-05 15:00 ` Christoph Hellwig
2022-04-05 22:01 ` Dave Chinner
2022-04-06 16:26 ` Christoph Hellwig
2022-04-03 12:01 ` [PATCH 4/5] xfs: reduce the number of atomic when locking a buffer after lookup Christoph Hellwig
2022-04-03 12:01 ` [PATCH 5/5] xfs: lockless buffer lookup 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=20220406162441.GA590@lst.de \
--to=hch@lst.de \
--cc=david@fromorbit.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.