hw/block/nvme: refactor nvme_select_ns_iocs
This patch has no functional changes. This patch just refactored nvme_select_ns_iocs() to iterate the attached namespaces of the controlller and make it invoke __nvme_select_ns_iocs(). Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com> Reviewed-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Klaus Jensen <k.jensen@samsung.com> Tested-by: Klaus Jensen <k.jensen@samsung.com> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
This commit is contained in:
parent
94d8d6d167
commit
1f46660788
@ -4042,16 +4042,8 @@ static void nvme_ctrl_shutdown(NvmeCtrl *n)
|
||||
}
|
||||
}
|
||||
|
||||
static void nvme_select_ns_iocs(NvmeCtrl *n)
|
||||
static void __nvme_select_ns_iocs(NvmeCtrl *n, NvmeNamespace *ns)
|
||||
{
|
||||
NvmeNamespace *ns;
|
||||
int i;
|
||||
|
||||
for (i = 1; i <= n->num_namespaces; i++) {
|
||||
ns = nvme_ns(n, i);
|
||||
if (!ns) {
|
||||
continue;
|
||||
}
|
||||
ns->iocs = nvme_cse_iocs_none;
|
||||
switch (ns->csi) {
|
||||
case NVME_CSI_NVM:
|
||||
@ -4068,6 +4060,20 @@ static void nvme_select_ns_iocs(NvmeCtrl *n)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void nvme_select_ns_iocs(NvmeCtrl *n)
|
||||
{
|
||||
NvmeNamespace *ns;
|
||||
int i;
|
||||
|
||||
for (i = 1; i <= n->num_namespaces; i++) {
|
||||
ns = nvme_ns(n, i);
|
||||
if (!ns) {
|
||||
continue;
|
||||
}
|
||||
|
||||
__nvme_select_ns_iocs(n, ns);
|
||||
}
|
||||
}
|
||||
|
||||
static int nvme_start_ctrl(NvmeCtrl *n)
|
||||
|
Loading…
Reference in New Issue
Block a user