All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] null_blk: simplify null_handle_cmd()
@ 2019-06-29  5:04 Chaitanya Kulkarni
  2019-06-29  5:04 ` [PATCH 1/5] null_blk: create a helper for throttling Chaitanya Kulkarni
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Chaitanya Kulkarni @ 2019-06-29  5:04 UTC (permalink / raw)
  To: linux-block; +Cc: hch, bvanassche, axboe, Chaitanya Kulkarni

Hi,

The core function where we handle the request null_handle_cmd() in the
null_blk does various things based on how null_blk is configured :-

1. Handle throttling.
2. Handle badblocks.
3. Handle Memory backed device operations.
4. Handle Zoned Block device operations.
5. Completion of the requests.

With all the above functionality present in the one function,
null_handle_cmd() is growing and becoming unreasonably lengthy when
we want to add more features such as new Zone requests which is being
worked on (See [1], [2]).

This is a cleanup patch-series which refactors the code in the
null_handle_cmd(). We create a clear interface for each of the above
mentioned functionality which leads to having null_handle_cmd() more
clear and easy to manage with future changes. Please have a look at
NVMe PCIe Driver (nvme_queue_rq()) (See [3]) which has a similar code
structure and nicely structured code for doing various things such as
setting up commands, mapping of the block layer requests, mapping
PRPs/SGLs, handling integrity requests and finally submitting the
NVMe Command etc.

With this patch-series we fix the following issues with the current 
code :-

1. Get rid of the multiple nesting levels (> 2).
2. Easy to read, debug and extend the code for specific feature.
3. Get rid of the various line foldings which are there in the code
   due to multiple level of nesting under if conditions.
4. Precise definition for the null_handle_cmd() and clear error
   handling as helpers are responsible for handling errors.

Please consider this for 5.3.

Regards,
Chaitanya

Chaitanya Kulkarni (5):
  null_blk: create a helper for throttling
  null_blk: create a helper for badblocks
  null_blk: create a helper for mem-backed ops
  null_blk: create a helper for zoned devices
  null_blk: create a helper for req completion

 drivers/block/null_blk_main.c | 189 +++++++++++++++++++++-------------
 1 file changed, 120 insertions(+), 69 deletions(-)

-- 
2.21.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-07-01  6:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-29  5:04 [PATCH 0/5] null_blk: simplify null_handle_cmd() Chaitanya Kulkarni
2019-06-29  5:04 ` [PATCH 1/5] null_blk: create a helper for throttling Chaitanya Kulkarni
2019-07-01  6:22   ` Christoph Hellwig
2019-06-29  5:04 ` [PATCH 2/5] null_blk: create a helper for badblocks Chaitanya Kulkarni
2019-07-01  6:29   ` Christoph Hellwig
2019-06-29  5:04 ` [PATCH 3/5] null_blk: create a helper for mem-backed ops Chaitanya Kulkarni
2019-06-29  5:04 ` [PATCH 4/5] null_blk: create a helper for zoned devices Chaitanya Kulkarni
2019-07-01  6:30   ` Christoph Hellwig
2019-06-29  5:04 ` [PATCH 5/5] null_blk: create a helper for req completion Chaitanya Kulkarni
2019-07-01  6:31   ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.