Skip to content

Commit f6224b8

Browse files
keithbuschChristoph Hellwig
authored andcommitted
nvme: directly cache command effects log
Remove the struct used for tracking known command effects logs in a list. This is now saved in an xarray that doesn't use these elements. Instead, store the log directly instead of the wrapper struct. Signed-off-by: Keith Busch <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 0f0d2c8 commit f6224b8

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

drivers/nvme/host/core.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2929,7 +2929,7 @@ int nvme_get_log(struct nvme_ctrl *ctrl, u32 nsid, u8 log_page, u8 lsp, u8 csi,
29292929
static int nvme_get_effects_log(struct nvme_ctrl *ctrl, u8 csi,
29302930
struct nvme_effects_log **log)
29312931
{
2932-
struct nvme_cel *cel = xa_load(&ctrl->cels, csi);
2932+
struct nvme_effects_log *cel = xa_load(&ctrl->cels, csi);
29332933
int ret;
29342934

29352935
if (cel)
@@ -2940,16 +2940,15 @@ static int nvme_get_effects_log(struct nvme_ctrl *ctrl, u8 csi,
29402940
return -ENOMEM;
29412941

29422942
ret = nvme_get_log(ctrl, 0x00, NVME_LOG_CMD_EFFECTS, 0, csi,
2943-
&cel->log, sizeof(cel->log), 0);
2943+
cel, sizeof(*cel), 0);
29442944
if (ret) {
29452945
kfree(cel);
29462946
return ret;
29472947
}
29482948

2949-
cel->csi = csi;
2950-
xa_store(&ctrl->cels, cel->csi, cel, GFP_KERNEL);
2949+
xa_store(&ctrl->cels, csi, cel, GFP_KERNEL);
29512950
out:
2952-
*log = &cel->log;
2951+
*log = cel;
29532952
return 0;
29542953
}
29552954

drivers/nvme/host/nvme.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,6 @@ struct nvme_fault_inject {
226226
#endif
227227
};
228228

229-
struct nvme_cel {
230-
struct list_head entry;
231-
struct nvme_effects_log log;
232-
u8 csi;
233-
};
234-
235229
struct nvme_ctrl {
236230
bool comp_seen;
237231
enum nvme_ctrl_state state;

0 commit comments

Comments
 (0)