Searched hist:"3 a1f7c79ae6d3dfdc16082daa44b3cf8dbe4f238" (Results 1 – 3 of 3) sorted by relevance
/openbmc/linux/drivers/nvme/target/ |
H A D | nvmet.h | diff 3a1f7c79ae6d3dfdc16082daa44b3cf8dbe4f238 Tue Feb 09 23:47:54 CST 2021 Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> nvmet: make nvmet_find_namespace() req based
The six callers of nvmet_find_namespace() duplicate the error log page update and status setting code for each call on failure.
All callers are nvmet requests based functions, so we can pass req to the nvmet_find_namesapce() & derive ctrl from req, that'll allow us to update the error log page in nvmet_find_namespace(). Now that we pass the request we can also get rid of the local variable in nvmet_find_namespace() and use the req->ns and return the error code.
Replace the ctrl parameter with nvmet_req for nvmet_find_namespace(), centralize the error log page update for non allocated namesapces, and return uniform error for non-allocated namespace.
The nvmet_find_namespace() takes nsid parameter which is from NVMe commands structures such as get_log_page, identify, rw and common. All these commands have same offset for the nsid field.
Derive nsid from req->cmd->common.nsid) & remove the extra parameter from the nvmet_find_namespace().
Lastly now we associate the ns to the req parameter that we pass to the nvmet_find_namespace(), rename nvmet_find_namespace() to nvmet_req_find_ns().
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
|
H A D | admin-cmd.c | diff 3a1f7c79ae6d3dfdc16082daa44b3cf8dbe4f238 Tue Feb 09 23:47:54 CST 2021 Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> nvmet: make nvmet_find_namespace() req based
The six callers of nvmet_find_namespace() duplicate the error log page update and status setting code for each call on failure.
All callers are nvmet requests based functions, so we can pass req to the nvmet_find_namesapce() & derive ctrl from req, that'll allow us to update the error log page in nvmet_find_namespace(). Now that we pass the request we can also get rid of the local variable in nvmet_find_namespace() and use the req->ns and return the error code.
Replace the ctrl parameter with nvmet_req for nvmet_find_namespace(), centralize the error log page update for non allocated namesapces, and return uniform error for non-allocated namespace.
The nvmet_find_namespace() takes nsid parameter which is from NVMe commands structures such as get_log_page, identify, rw and common. All these commands have same offset for the nsid field.
Derive nsid from req->cmd->common.nsid) & remove the extra parameter from the nvmet_find_namespace().
Lastly now we associate the ns to the req parameter that we pass to the nvmet_find_namespace(), rename nvmet_find_namespace() to nvmet_req_find_ns().
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
|
H A D | core.c | diff 3a1f7c79ae6d3dfdc16082daa44b3cf8dbe4f238 Tue Feb 09 23:47:54 CST 2021 Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> nvmet: make nvmet_find_namespace() req based
The six callers of nvmet_find_namespace() duplicate the error log page update and status setting code for each call on failure.
All callers are nvmet requests based functions, so we can pass req to the nvmet_find_namesapce() & derive ctrl from req, that'll allow us to update the error log page in nvmet_find_namespace(). Now that we pass the request we can also get rid of the local variable in nvmet_find_namespace() and use the req->ns and return the error code.
Replace the ctrl parameter with nvmet_req for nvmet_find_namespace(), centralize the error log page update for non allocated namesapces, and return uniform error for non-allocated namespace.
The nvmet_find_namespace() takes nsid parameter which is from NVMe commands structures such as get_log_page, identify, rw and common. All these commands have same offset for the nsid field.
Derive nsid from req->cmd->common.nsid) & remove the extra parameter from the nvmet_find_namespace().
Lastly now we associate the ns to the req parameter that we pass to the nvmet_find_namespace(), rename nvmet_find_namespace() to nvmet_req_find_ns().
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
|