Skip to contentSkip to conversation

btrfs: simplify code with bio_io_error

PATCH In review Guoqing Jiang 2 participants 2 messages Jun 2, 2017 – Jun 5, 2017 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: simplify code with bio_io_error

bio_io_error was introduced in the commit 4246a0b
("block: add a bi_error field to struct bio"), so
use it to simplify code.

---
 fs/btrfs/inode.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/btrfs/inode.c +1 -2
index 17cbe93..57335f5 100644
@@ -8649,8 +8649,7 @@ static void btrfs_submit_direct(struct bio *dio_bio, struct inode *inode,
 	 * callbacks - they require an allocated dip and a clone of dio_bio.
 	 */
 	if (io_bio && dip) {
-		io_bio->bi_error = -EIO;
-		bio_endio(io_bio);
+		bio_io_error(io_bio);
 		/*
 		 * The end io callbacks free our dip, do the final put on io_bio
 		 * and all the cleanup and final put for dio_bio (through
Signature · 1 line
2.10.0