From: Dave Chinner <david@fromorbit.com>
To: Brian Foster <bfoster@redhat.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 1/3] xfs: helper to set flags on uncached buffer reads
Date: Thu, 14 Jul 2016 10:01:04 +1000 [thread overview]
Message-ID: <20160714000103.GR1922@dastard> (raw)
In-Reply-To: <1468426595-35032-2-git-send-email-bfoster@redhat.com>
On Wed, Jul 13, 2016 at 12:16:33PM -0400, Brian Foster wrote:
> xfs_buf_read_uncached() allocates an uncached buffer and performs a read
> in one go. As part of the upcoming buftarg I/O accounting mechanism,
> some sites may need to set flags on a buffer before I/O submission.
>
> Create a new helper to support the ability to set flags on a buffer
> before it is submitted for I/O. This use case is the exception, so
> create a wrapper for the original xfs_buf_read_uncached().
>
> Signed-off-by: Brian Foster <bfoster@redhat.com>
> ---
> fs/xfs/xfs_buf.c | 20 +++++++++++++++++---
> fs/xfs/xfs_buf.h | 4 ++++
> 2 files changed, 21 insertions(+), 3 deletions(-)
>
> diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
> index 4665ff6..f007713 100644
> --- a/fs/xfs/xfs_buf.c
> +++ b/fs/xfs/xfs_buf.c
> @@ -693,13 +693,14 @@ xfs_buf_readahead_map(
> * buffer containing the disk contents or nothing.
> */
> int
> -xfs_buf_read_uncached(
> +xfs_buf_read_uncached_flags(
> struct xfs_buftarg *target,
> xfs_daddr_t daddr,
> size_t numblks,
> int flags,
> struct xfs_buf **bpp,
> - const struct xfs_buf_ops *ops)
> + const struct xfs_buf_ops *ops,
> + int bflags)
> {
We already have a flags field being passed in. Why can't that be
used to pass the XBF_NO_IOACCT flag? i.e:
> ASSERT(bp->b_map_count == 1);
> bp->b_bn = XFS_BUF_DADDR_NULL; /* always null for uncached buffers */
> bp->b_maps[0].bm_bn = daddr;
> - bp->b_flags |= XBF_READ;
> + bp->b_flags |= XBF_READ | bflags;
bp->b_flags |= XBF_READ;
bp->b_flags |= (flags & XBF_NO_IOACCT);
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2016-07-14 0:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-13 16:16 [PATCH 0/3] serialize unmount against new buffer I/O Brian Foster
2016-07-13 16:16 ` [PATCH 1/3] xfs: helper to set flags on uncached buffer reads Brian Foster
2016-07-14 0:01 ` Dave Chinner [this message]
2016-07-14 10:52 ` Brian Foster
2016-07-13 16:16 ` [PATCH 2/3] xfs: exclude never-released buffers from buftarg I/O accounting Brian Foster
2016-07-13 16:16 ` [PATCH 3/3] xfs: track and serialize in-flight async buffers against unmount Brian Foster
2016-07-14 0:05 ` Dave Chinner
2016-07-14 17:29 ` [PATCH 0/3] serialize unmount against new buffer I/O Brian Foster
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=20160714000103.GR1922@dastard \
--to=david@fromorbit.com \
--cc=bfoster@redhat.com \
--cc=xfs@oss.sgi.com \
/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