All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: Goldwyn Rodrigues <rgoldwyn@suse.de>, linux-btrfs@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org, hch@infradead.org,
	darrick.wong@oracle.com, fdmanana@kernel.org,
	Goldwyn Rodrigues <rgoldwyn@suse.com>
Subject: Re: [PATCH 1/5] fs: Export generic_file_buffered_read()
Date: Tue, 26 Nov 2019 11:43:41 +0100	[thread overview]
Message-ID: <b55f6033-a062-badc-32d7-0bb5bb2d45cb@suse.de> (raw)
In-Reply-To: <f3b4b146-face-98d6-70c8-cbb9f9696036@suse.de>

On 26/11/2019 11:10, Johannes Thumshirn wrote:
> Apart from Willy's comment
> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

On the other hand, you could as well do:

static ssize_t btrfs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
+{
+	ssize_t ret = 0;
+	if (iocb->ki_flags & IOCB_DIRECT)
+		ret = btrfs_dio_read(iocb, to);
+	if (ret < 0)
+		return ret;
+
+	return generic_file_read_iter(iocb, ret);
+}

In patch 3/5, if IOCB_DIRECT is set we're branching into
btrfs_dio_read() above and if not generic_file_read_iter() will then
directly call generic_file_buffered_read()

-- 
Johannes Thumshirn                            SUSE Labs Filesystems
jthumshirn@suse.de                                +49 911 74053 689
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5
90409 Nürnberg
Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

  reply	other threads:[~2019-11-26 10:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26  3:14 [PATCH 0/5 v2] btrfs direct-io using iomap Goldwyn Rodrigues
2019-11-26  3:14 ` [PATCH 1/5] fs: Export generic_file_buffered_read() Goldwyn Rodrigues
2019-11-26  3:43   ` Matthew Wilcox
2019-11-26 10:10   ` Johannes Thumshirn
2019-11-26 10:43     ` Johannes Thumshirn [this message]
2019-11-26  3:14 ` [PATCH 2/5] iomap: add a filesystem hook for direct I/O bio submission Goldwyn Rodrigues
2019-11-26 10:53   ` Nikolay Borisov
2019-11-26 11:51   ` Johannes Thumshirn
2019-11-26  3:14 ` [PATCH 3/5] btrfs: Switch to iomap_dio_rw() for dio Goldwyn Rodrigues
2019-11-26 11:54   ` Nikolay Borisov
2019-11-26 12:13   ` Nikolay Borisov
2019-11-26  3:14 ` [PATCH 4/5] btrfs: Wait for extent bits to release page Goldwyn Rodrigues
2019-11-26 12:38   ` Nikolay Borisov
2019-11-26 12:42   ` Johannes Thumshirn
2019-11-26  3:14 ` [PATCH 5/5] fs: Remove dio_end_io() Goldwyn Rodrigues
2019-11-26 12:39   ` Nikolay Borisov
2019-11-26 12:50   ` Johannes Thumshirn
2019-11-27 15:51 ` [PATCH 0/5 v2] btrfs direct-io using iomap David Sterba

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=b55f6033-a062-badc-32d7-0bb5bb2d45cb@suse.de \
    --to=jthumshirn@suse.de \
    --cc=darrick.wong@oracle.com \
    --cc=fdmanana@kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=rgoldwyn@suse.com \
    --cc=rgoldwyn@suse.de \
    /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.