btrfs: stash ordered extent in dio_data during iomap dio
authorBoris Burkov <boris@bur.io>
Tue, 28 Mar 2023 05:19:49 +0000 (14:19 +0900)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Apr 2023 16:01:21 +0000 (18:01 +0200)
commit53f2c20687ba2cfce79d87f487c281ef7a4b25ce
tree483f9bff7ccdcc3d998c2c332d04e1883ef3c2e7
parent8725bddf30c1a22aa167419491994e17c5fec93c
btrfs: stash ordered extent in dio_data during iomap dio

While it is not feasible for an ordered extent to survive across the
calls btrfs_direct_write makes into __iomap_dio_rw, it is still helpful
to stash it on the dio_data in between creating it in iomap_begin and
finishing it in either end_io or iomap_end.

The specific use I have in mind is that we can check if a particular bio
is partial in submit_io without unconditionally looking up the ordered
extent. This is a preparatory patch for a later patch which does just
that.

Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Tested-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Boris Burkov <boris@bur.io>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c