diff mbox series

[v3,18/27] btrfs: support direct write IO in HMZONED

Message ID 20190808093038.4163421-19-naohiro.aota@wdc.com (mailing list archive)
State New, archived
Headers show
Series btrfs zoned block device support | expand

Commit Message

Naohiro Aota Aug. 8, 2019, 9:30 a.m. UTC
As same as with other IO submission, we must unlock a block group for the
next allocation.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
 fs/btrfs/inode.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 283ac11849b1..d7be97c6a069 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -8519,6 +8519,7 @@  static void btrfs_submit_direct(struct bio *dio_bio, struct inode *inode,
 	struct btrfs_io_bio *io_bio;
 	bool write = (bio_op(dio_bio) == REQ_OP_WRITE);
 	int ret = 0;
+	u64 disk_bytenr;
 
 	bio = btrfs_bio_clone(dio_bio);
 
@@ -8562,7 +8563,11 @@  static void btrfs_submit_direct(struct bio *dio_bio, struct inode *inode,
 			dio_data->unsubmitted_oe_range_end;
 	}
 
+	disk_bytenr = dip->disk_bytenr;
 	ret = btrfs_submit_direct_hook(dip);
+	if (write)
+		btrfs_hmzoned_data_io_unlock_logical(
+			btrfs_sb(inode->i_sb), disk_bytenr);
 	if (!ret)
 		return;