From: Caleb Sander Mateos Date: Fri, 28 Feb 2025 22:30:56 +0000 (-0700) Subject: io_uring/rsrc: use rq_data_dir() to compute bvec dir X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=2fced37638a897be4e0ac724d93a23a4e38633a6;p=users%2Fjedix%2Flinux-maple.git io_uring/rsrc: use rq_data_dir() to compute bvec dir The macro rq_data_dir() already computes a request's data direction. Use it in place of the if-else to set imu->dir. Signed-off-by: Caleb Sander Mateos Link: https://lore.kernel.org/r/20250228223057.615284-1-csander@purestorage.com Signed-off-by: Jens Axboe --- diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c index 45bfb37bca1e..3107a03d56b8 100644 --- a/io_uring/rsrc.c +++ b/io_uring/rsrc.c @@ -959,11 +959,7 @@ int io_buffer_register_bvec(struct io_uring_cmd *cmd, struct request *rq, imu->release = release; imu->priv = rq; imu->is_kbuf = true; - - if (op_is_write(req_op(rq))) - imu->dir = IO_IMU_SOURCE; - else - imu->dir = IO_IMU_DEST; + imu->dir = 1 << rq_data_dir(rq); bvec = imu->bvec; rq_for_each_bvec(bv, rq, rq_iter)