cleanup for ublk
Subsystems (2)
cover cleanup for ublk
Hi, this series contain cleanup for code and comment of ublk including removing unnecessary NULL check, unused variable and comment fix.
Ziyang Zhang (3):
ublk: remove unnecessary NULL check in ublk_rq_has_data()
ublk: mention WRITE_ZEROES in comment of ublk_complete_rq()
ublk: pass NULL to blk_mq_alloc_disk() as queuedata
drivers/block/ublk_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.18.4
PATCH RESEND 1/3 ublk: remove unnecessary NULL check in ublk_rq_has_data()
bio_has_data() allows a NULL bio so the NULL check in ublk_rq_has_data() is unnecessary.
--- drivers/block/ublk_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/ublk_drv.c +1 -1
@@ -322,7 +322,7 @@ static inline struct ublk_queue *ublk_get_queue(struct ublk_device *dev,static inline bool ublk_rq_has_data (const struct request *rq) { -return rq->bio &&bio_has_data (rq->bio); +return bio_has_data (rq->bio); } static inline struct ublksrv_io_desc *ublk_get_iod(struct ublk_queue *ubq,
Signature · 1 line
2.18.4
Re: [PATCH RESEND 1/3] ublk: remove unnecessary NULL check in ublk_rq_has_data()
Quoted 4 lines · Ziyang Zhang
bio_has_data()allows a NULL bio so the NULL check inublk_rq_has_data()is unnecessary.Signed-off-by Ziyang Zhang <[email protected]>
Thanks,
Ming
PATCH RESEND 2/3 ublk: mention WRITE_ZEROES in comment of ublk_complete_rq()
In reply to Ziyang ZhangWRITE_ZEROES won't return bytes returned just like FLUSH and DISCARD, and we can end it directly. Add missing comment for it in ublk_complete_rq().
--- drivers/block/ublk_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/ublk_drv.c +1 -1
@@ -665,7 +665,7 @@ static void ublk_complete_rq(struct request *req) }/* -* FLUSH or DISCARD usually won't return bytes returned, so end them +* FLUSH, DISCARD or WRITE_ZEROES usually won't return bytes returned, so end them * directly. * * Both the two needn't unmap.
Signature · 1 line
2.18.4
Re: [PATCH RESEND 2/3] ublk: mention WRITE_ZEROES in comment of ublk_complete_rq()
Quoted 14 lines · Ziyang Zhang
WRITE_ZEROESwon't return bytes returned just like FLUSH and DISCARD, and we can end it directly. Add missing comment for it inublk_complete_rq().Signed-off-by Ziyang Zhang <[email protected]>--- drivers/block/ublk_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/block/ublk_drv.c +0
-0
drivers/block/ublk_drv.c static void ublk_complete_rq(struct request *req) · line 671
Quoted 8 lines
drivers/block/ublk_drv.c +1
-1@@ -665,7 +665,7 @@ static void ublk_complete_rq(struct request *req) }/* -* FLUSH or DISCARD usually won't return bytes returned, so end them +* FLUSH, DISCARD or WRITE_ZEROES usually won't return bytes returned, so end them * directly. * * Both the two needn't unmap.
Thanks,
Ming
PATCH RESEND 3/3 ublk: pass NULL to blk_mq_alloc_disk() as queuedata
In reply to Ziyang Zhangqueuedata is not referenced in ublk_drv and we can use driver_data instead. Pass NULL to blk_mq_alloc_disk() as queuedata while allocating ublk's gendisk.
--- drivers/block/ublk_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/ublk_drv.c +1 -1
@@ -1578,7 +1578,7 @@ static int ublk_ctrl_start_dev(struct ublk_device *ub, struct io_uring_cmd *cmd) goto out_unlock; } - disk =blk_mq_alloc_disk (&ub->tag_set, ub); + disk =blk_mq_alloc_disk (&ub->tag_set,NULL );if (IS_ERR (disk)) { ret =PTR_ERR (disk); goto out_unlock;
Signature · 1 line
2.18.4
Re: [PATCH RESEND 3/3] ublk: pass NULL to blk_mq_alloc_disk() as queuedata
Quoted 5 lines · Ziyang Zhang
queuedata is not referenced in
ublk_drvand we can usedriver_datainstead. Pass NULL toblk_mq_alloc_disk()as queuedata while allocating ublk's gendisk.Signed-off-by Ziyang Zhang <[email protected]>
Thanks,
Ming
Quoted 8 lines · Ziyang Zhang
removing unnecessary NULL check, unused variable and comment fix.
Ziyang Zhang (3):
ublk: remove unnecessary NULL check inublk_rq_has_data()
ublk: mentionWRITE_ZEROESin comment ofublk_complete_rq()
ublk: pass NULL toblk_mq_alloc_disk()as queuedata[...]
Applied, thanks!
[1/3] ublk: remove unnecessary NULL check in ublk_rq_has_data()
commit: 731e208d7b4b38d2bac4b7c53403c8abbf306d01
[2/3] ublk: mention WRITE_ZEROES in comment of ublk_complete_rq()
commit: b352389e7ba34bdb5bcf4254fa1e85319ba76352
[3/3] ublk: pass NULL to blk_mq_alloc_disk() as queuedata
commit: 1972d038a5401781377d3ce2d901bf7763a43589Best regards,
Signature · 1 line
Jens Axboe