Skip to content

Commit

Permalink
ANDROID: dm-user: Remove bio recount in I/O path
Browse files Browse the repository at this point in the history
When I/O is submitted to dm-user target, bio already
has a referance. Additional referance is not needed
in the I/O path.

Bug: 229696117
Test: OTA on Pixel
Change-Id: I8db6802e751336d7a10c6de0bc7a247a6d7f6b37
Signed-off-by: Akilesh Kailash <[email protected]>
  • Loading branch information
Akilesh Kailash committed Nov 10, 2022
1 parent 69e2e92 commit 6cbaa88
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/md/dm-user.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ static void message_kill(struct message *m, mempool_t *pool)
{
m->bio->bi_status = BLK_STS_IOERR;
bio_endio(m->bio);
bio_put(m->bio);
mempool_free(m, pool);
}

Expand Down Expand Up @@ -989,7 +988,6 @@ static ssize_t dev_write(struct kiocb *iocb, struct iov_iter *from)
*/
WARN_ON(bio_size(c->cur_from_user->bio) != 0);
bio_endio(c->cur_from_user->bio);
bio_put(c->cur_from_user->bio);

/*
* We don't actually need to take the target lock here, as all
Expand Down Expand Up @@ -1227,7 +1225,6 @@ static int user_map(struct dm_target *ti, struct bio *bio)
return DM_MAPIO_REQUEUE;
}

bio_get(bio);
entry->msg.type = bio_type_to_user_type(bio);
entry->msg.flags = bio_flags_to_user_flags(bio);
entry->msg.sector = bio->bi_iter.bi_sector;
Expand Down

0 comments on commit 6cbaa88

Please sign in to comment.