From: Christoph Hellwig <hch@infradead.org>
To: Goldwyn Rodrigues <rgoldwyn@suse.de>
Cc: linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
hch@infradead.org, darrick.wong@oracle.com,
Goldwyn Rodrigues <rgoldwyn@suse.com>
Subject: Re: [PATCH 4/7] btrfs: Use iomap_dio_rw() for direct I/O
Date: Fri, 15 Nov 2019 09:06:55 -0800 [thread overview]
Message-ID: <20191115170655.GF26016@infradead.org> (raw)
In-Reply-To: <20191115161700.12305-5-rgoldwyn@suse.de>
On Fri, Nov 15, 2019 at 10:16:57AM -0600, Goldwyn Rodrigues wrote:
> From: Goldwyn Rodrigues <rgoldwyn@suse.com>
>
> This is the main patch to switch call from
> __blockdev_direct_IO() to iomap_dio_rw(). In this patch:
>
> Removed buffer_head references
> Removed inode_dio_begin() and inode_dio_end() functions since
> they are called in iomap_dio_rw().
> Renamed btrfs_get_blocks_direct() to direct_iomap_begin() and
> used it as iomap_begin()
> address_space.direct_IO now is a noop since direct_IO is called
> from __btrfs_write_direct().
>
> Removed flags parameter used for __blockdev_direct_IO(). iomap is
> capable of direct I/O reads from a hole, so we don't need to
> return -ENOENT.
There isn't really any need to describe the low-level changes,
but more what this changes at a high level, and more importantly
the reasons for that.
> static int btrfs_get_blocks_direct_write(struct extent_map **map,
> - struct buffer_head *bh_result,
> struct inode *inode,
> struct btrfs_dio_data *dio_data,
> u64 start, u64 len)
Should this function be renamed as well? btrfs_iomap_begin_write?
> +static int direct_iomap_begin(struct inode *inode, loff_t start,
> + loff_t length, unsigned flags, struct iomap *iomap,
> + struct iomap *srcmap)
This needs a btrfs_ prefix.
> + if ((em->block_start == EXTENT_MAP_HOLE) ||
No need for the inner braces.
> - dio_end_io(dio_bio);
You removed the only users of dio_end_io and the submit hook in the
old dio code. Please add a patch to remove those at the end of the
series.
> - btrfs_submit_direct, flags);
> + ret = iomap_dio_rw(iocb, iter, &dio_iomap_ops, NULL, is_sync_kiocb(iocb));
This adds a line > 80 chars.
next prev parent reply other threads:[~2019-11-15 17:06 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-15 16:16 btrfs direct-io using iomap Goldwyn Rodrigues
2019-11-15 16:16 ` [PATCH 1/7] fs: Export generic_file_buffered_read() Goldwyn Rodrigues
2019-11-15 16:16 ` [PATCH 2/7] btrfs: basic direct I/O read operation Goldwyn Rodrigues
2019-11-15 16:45 ` Christoph Hellwig
2019-11-15 16:16 ` [PATCH 3/7] iomap: use a function pointer for dio submits Goldwyn Rodrigues
2019-11-15 16:47 ` Christoph Hellwig
2019-11-15 20:11 ` Goldwyn Rodrigues
2019-11-15 16:16 ` [PATCH 4/7] btrfs: Use iomap_dio_rw() for direct I/O Goldwyn Rodrigues
2019-11-15 17:06 ` Christoph Hellwig [this message]
2019-11-18 15:54 ` Goldwyn Rodrigues
2019-11-18 16:54 ` Filipe Manana
2019-11-19 17:01 ` Goldwyn Rodrigues
2019-11-19 17:24 ` Darrick J. Wong
2019-11-15 16:16 ` [PATCH 5/7] btrfs: Use iomap_dio_ops.submit_io() Goldwyn Rodrigues
2019-11-15 16:47 ` Christoph Hellwig
2019-11-15 16:16 ` [PATCH 6/7] btrfs: flush dirty pages on compressed I/O for dio Goldwyn Rodrigues
2019-11-15 16:50 ` Christoph Hellwig
2019-11-15 16:17 ` [PATCH 7/7] btrfs: Wait for extent bits to release page Goldwyn Rodrigues
2019-11-15 16:56 ` 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=20191115170655.GF26016@infradead.org \
--to=hch@infradead.org \
--cc=darrick.wong@oracle.com \
--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 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).