Defined in 1 files as a function:
Referenced in 4 files:
- drivers/nvdimm/label.c
- drivers/nvdimm/namespace_devs.c
- drivers/nvdimm/nd.h
- drivers/nvdimm/region_devs.c, line 355
Smatch caller information:
drivers/nvdimm/label.c __nd_label_validate() -> to_namespace_index()
| Type | Parameter | Key | Value |
|---|---|---|---|
| PARAM_VALUE | 0 | ndd | 4096-ptr_max |
| PARAM_VALUE | 0 | ndd->data | 16,4096-ptr_max |
| PARAM_VALUE | 0 | ndd->dev | 4096-ptr_max |
| PARAM_VALUE | 0 | ndd->dpa.end | u64max |
| PARAM_VALUE | 0 | ndd->dpa.start | 0 |
| PARAM_VALUE | 0 | ndd->kref.refcount.refs.counter | 1 |
| PARAM_VALUE | 0 | ndd->ns_current | (-1) |
| PARAM_VALUE | 0 | ndd->ns_next | (-1) |
| PARAM_VALUE | 0 | ndd->nsarea.config_size | 1-u32max |
| PARAM_VALUE | 0 | ndd->nsarea.max_xfer | 1-u32max |
| PARAM_VALUE | 0 | ndd->nsarea.status | 0 |
| PARAM_VALUE | 1 | i | 0 |
| BUF_SIZE | 0 | ndd->data | 1-s32max |
| BUF_SIZE | 0 | ndd->dev | (-1)-0,24-s32max |
| BUF_SIZE | 0 | ndd->dpa.name | s32min,(-10),1-s32max |
| CAPPED_DATA | 0 | ndd->nsarea.config_size | 1 |
| DATA_SOURCE | 0 | ndd | $0 |
| RX_PATH | |||
| TASK_NOT_RUNNING | |||
| HALF_LOCKED2 | &dev->mutex |
drivers/nvdimm/label.c __nd_label_validate() -> to_namespace_index()
| Type | Parameter | Key | Value |
|---|---|---|---|
| PARAM_VALUE | 0 | ndd | 4096-ptr_max |
| PARAM_VALUE | 0 | ndd->data | 16,4096-ptr_max |
| PARAM_VALUE | 0 | ndd->dev | 4096-ptr_max |
| PARAM_VALUE | 0 | ndd->dpa.end | u64max |
| PARAM_VALUE | 0 | ndd->dpa.start | 0 |
| PARAM_VALUE | 0 | ndd->kref.refcount.refs.counter | 1 |
| PARAM_VALUE | 0 | ndd->ns_current | (-1) |
| PARAM_VALUE | 0 | ndd->ns_next | (-1) |
| PARAM_VALUE | 0 | ndd->nsarea.config_size | 1-u32max |
| PARAM_VALUE | 0 | ndd->nsarea.max_xfer | 1-u32max |
| PARAM_VALUE | 0 | ndd->nsarea.status | 0 |
| PARAM_VALUE | 1 | i | 1 |
| BUF_SIZE | 0 | ndd->data | 1-s32max |
| BUF_SIZE | 0 | ndd->dev | (-1)-0,24-s32max |
| BUF_SIZE | 0 | ndd->dpa.name | s32min,(-10),1-s32max |
| CAPPED_DATA | 0 | ndd->nsarea.config_size | 1 |
| DATA_SOURCE | 0 | ndd | $0 |
| RX_PATH | |||
| TASK_NOT_RUNNING | |||
| HALF_LOCKED2 | &dev->mutex |
drivers/nvdimm/label.c init_labels() -> to_namespace_index()
| Type | Parameter | Key | Value |
|---|---|---|---|
| PARAM_VALUE | 0 | ndd | 4096-ptr_max |
| PARAM_VALUE | 1 | i | 0 |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| DATA_SOURCE | 0 | ndd | r to_ndd |
| RX_PATH | |||
| TASK_NOT_RUNNING | |||
| LOCK2 | &dev->mutex | ||
| LOCK2 | &of->mutex | ||
| HALF_LOCKED2 | &of->prealloc_mutex | ||
| HALF_LOCKED2 | &pool->lock | ||
| TYPE_LOCK | (struct device)->mutex | ||
| TYPE_LOCK | (struct kernfs_open_file)->mutex |
drivers/nvdimm/label.c nd_label_base() -> to_namespace_index()
| Type | Parameter | Key | Value |
|---|---|---|---|
| PARAM_VALUE | 1 | i | 0 |
| BUF_SIZE | 0 | ndd | s32min-(-1),1-s32max |
| BUF_SIZE | 0 | ndd | s32min-(-1),1-s32max |
| BUF_SIZE | 0 | ndd->dev | (-1)-0,24-s32max |
| BUF_SIZE | 0 | ndd->dpa.name | s32min,(-10),(-1),1-s32max |
| DATA_SOURCE | 0 | ndd | $0 |
| RX_PATH | |||
| TASK_NOT_RUNNING | |||
| HALF_LOCKED2 | &dev->mutex | ||
| HALF_LOCKED2 | &nd_mapping->lock | ||
| HALF_LOCKED2 | &of->mutex |
drivers/nvdimm/label.c nd_label_offset() -> to_namespace_index()
| Type | Parameter | Key | Value |
|---|---|---|---|
| PARAM_VALUE | 0 | ndd | 4096-ptr_max |
| PARAM_VALUE | 0 | ndd->ns_next | 0-s32max |
| PARAM_VALUE | 1 | i | 0 |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| DATA_SOURCE | 0 | ndd | $0 |
| RX_PATH | |||
| TASK_NOT_RUNNING | |||
| LOCK2 | &dev->mutex | ||
| LOCK2 | &of->mutex | ||
| HALF_LOCKED2 | &of->prealloc_mutex | ||
| HALF_LOCKED2 | &pool->lock | ||
| TYPE_LOCK | (struct device)->mutex | ||
| TYPE_LOCK | (struct kernfs_open_file)->mutex |
drivers/nvdimm/label.c nd_label_write_index() -> to_namespace_index()
| Type | Parameter | Key | Value |
|---|---|---|---|
| PARAM_VALUE | 0 | ndd | 4096-ptr_max |
| PARAM_VALUE | 1 | i | 0-s32max |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| DATA_SOURCE | 0 | ndd | $0 |
| DATA_SOURCE | 1 | i | $1 |
| FUZZY_MAX | 1 | i | 1 |
| RX_PATH | |||
| TASK_NOT_RUNNING | |||
| LOCK2 | &dev->mutex | ||
| LOCK2 | &of->mutex | ||
| HALF_LOCKED2 | &nd_mapping->lock | ||
| HALF_LOCKED2 | &of->prealloc_mutex | ||
| HALF_LOCKED2 | &pool->lock | ||
| TYPE_LOCK | (struct device)->mutex | ||
| TYPE_LOCK | (struct kernfs_open_file)->mutex |
drivers/nvdimm/label.c nd_label_write_index() -> to_namespace_index()
| Type | Parameter | Key | Value |
|---|---|---|---|
| PARAM_VALUE | 0 | ndd | 4096-ptr_max |
| PARAM_VALUE | 1 | i | 0 |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| DATA_SOURCE | 0 | ndd | $0 |
| RX_PATH | |||
| TASK_NOT_RUNNING | |||
| LOCK2 | &dev->mutex | ||
| LOCK2 | &of->mutex | ||
| HALF_LOCKED2 | &nd_mapping->lock | ||
| HALF_LOCKED2 | &of->prealloc_mutex | ||
| HALF_LOCKED2 | &pool->lock | ||
| TYPE_LOCK | (struct device)->mutex | ||
| TYPE_LOCK | (struct kernfs_open_file)->mutex |
drivers/nvdimm/label.c nd_label_write_index() -> to_namespace_index()
| Type | Parameter | Key | Value |
|---|---|---|---|
| PARAM_VALUE | 0 | ndd | 4096-ptr_max |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| DATA_SOURCE | 0 | ndd | $0 |
| RX_PATH | |||
| TASK_NOT_RUNNING | |||
| LOCK2 | &dev->mutex | ||
| LOCK2 | &of->mutex | ||
| HALF_LOCKED2 | &nd_mapping->lock | ||
| HALF_LOCKED2 | &of->prealloc_mutex | ||
| HALF_LOCKED2 | &pool->lock | ||
| TYPE_LOCK | (struct device)->mutex | ||
| TYPE_LOCK | (struct kernfs_open_file)->mutex |
drivers/nvdimm/label.c nd_label_write_index() -> to_namespace_index()
| Type | Parameter | Key | Value |
|---|---|---|---|
| PARAM_VALUE | 0 | ndd | 4096-ptr_max |
| PARAM_VALUE | 1 | i | 0 |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| DATA_SOURCE | 0 | ndd | $0 |
| RX_PATH | |||
| TASK_NOT_RUNNING | |||
| LOCK2 | &dev->mutex | ||
| LOCK2 | &of->mutex | ||
| HALF_LOCKED2 | &nd_mapping->lock | ||
| HALF_LOCKED2 | &of->prealloc_mutex | ||
| HALF_LOCKED2 | &pool->lock | ||
| TYPE_LOCK | (struct device)->mutex | ||
| TYPE_LOCK | (struct kernfs_open_file)->mutex |
drivers/nvdimm/label.c nd_label_write_index() -> to_namespace_index()
| Type | Parameter | Key | Value |
|---|---|---|---|
| PARAM_VALUE | 0 | ndd | 4096-ptr_max |
| PARAM_VALUE | 1 | i | 0 |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| DATA_SOURCE | 0 | ndd | $0 |
| RX_PATH | |||
| TASK_NOT_RUNNING | |||
| LOCK2 | &dev->mutex | ||
| LOCK2 | &of->mutex | ||
| HALF_LOCKED2 | &nd_mapping->lock | ||
| HALF_LOCKED2 | &of->prealloc_mutex | ||
| HALF_LOCKED2 | &pool->lock | ||
| TYPE_LOCK | (struct device)->mutex | ||
| TYPE_LOCK | (struct kernfs_open_file)->mutex |
drivers/nvdimm/label.c preamble_index() -> to_namespace_index()
| Type | Parameter | Key | Value |
|---|---|---|---|
| PARAM_VALUE | 0 | ndd | 4096-ptr_max |
| BUF_SIZE | 0 | ndd | s32min-(-1),1-s32max |
| BUF_SIZE | 0 | ndd | s32min-(-1),1-s32max |
| BUF_SIZE | 0 | ndd->dev | (-1)-0,24-s32max |
| BUF_SIZE | 0 | ndd->dpa.name | s32min,(-10),(-1),1-s32max |
| DATA_SOURCE | 0 | ndd | $0 |
| DATA_SOURCE | 1 | i | $1 |
| RX_PATH | |||
| TASK_NOT_RUNNING | |||
| HALF_LOCKED2 | &dev->mutex | ||
| HALF_LOCKED2 | &of->mutex |
drivers/nvdimm/label.c to_current_namespace_index() -> to_namespace_index()
| Type | Parameter | Key | Value |
|---|---|---|---|
| PARAM_VALUE | 0 | ndd | 4096-ptr_max |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| BUF_SIZE | 0 | ndd->data | (-1),1-s32max |
| BUF_SIZE | 0 | ndd->dev | (-1)-0,4,16,24-s32max |
| BUF_SIZE | 0 | ndd->dpa.name | s32min,(-10),(-1),1-s32max |
| DATA_SOURCE | 0 | ndd | $0 |
| RX_PATH | |||
| TASK_NOT_RUNNING | |||
| HALF_LOCKED2 | &dev->mutex | ||
| HALF_LOCKED2 | &of->mutex |
drivers/nvdimm/label.c to_next_namespace_index() -> to_namespace_index()
| Type | Parameter | Key | Value |
|---|---|---|---|
| PARAM_VALUE | 0 | ndd | 4096-ptr_max |
| PARAM_VALUE | 0 | ndd->data | 16,4096-ptr_max |
| PARAM_VALUE | 0 | ndd->dev | 4096-ptr_max |
| PARAM_VALUE | 0 | ndd->dpa.end | u64max |
| PARAM_VALUE | 0 | ndd->dpa.start | 0 |
| PARAM_VALUE | 0 | ndd->kref.refcount.refs.counter | 1 |
| PARAM_VALUE | 0 | ndd->ns_current | 0-1 |
| PARAM_VALUE | 0 | ndd->ns_next | 0-1 |
| PARAM_VALUE | 0 | ndd->nsarea.config_size | 1-u32max |
| PARAM_VALUE | 0 | ndd->nsarea.max_xfer | 1-u32max |
| PARAM_VALUE | 0 | ndd->nsarea.status | 0 |
| PARAM_VALUE | 1 | i | 0-1 |
| BUF_SIZE | 0 | ndd | 120 |
| BUF_SIZE | 0 | ndd->data | 1-s32max |
| BUF_SIZE | 0 | ndd->dev | (-1)-0,4,16,24-s32max |
| BUF_SIZE | 0 | ndd->dpa.name | s32min,(-10),1-s32max |
| DATA_SOURCE | 0 | ndd | $0 |
| RX_PATH | |||
| TASK_NOT_RUNNING | |||
| HALF_LOCKED2 | &dev->mutex |
drivers/nvdimm/namespace_devs.c btt_claim_class() -> to_namespace_index()
| Type | Parameter | Key | Value |
|---|---|---|---|
| PARAM_VALUE | 0 | ndd | 4096-ptr_max |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| DATA_SOURCE | 0 | ndd | r to_ndd |
| RX_PATH | |||
| TASK_NOT_RUNNING | |||
| LOCK2 | &dev->mutex | ||
| LOCK2 | &of->mutex | ||
| HALF_LOCKED2 | &of->prealloc_mutex | ||
| HALF_LOCKED2 | &pool->lock | ||
| TYPE_LOCK | (struct device)->mutex | ||
| TYPE_LOCK | (struct kernfs_open_file)->mutex |
drivers/nvdimm/namespace_devs.c create_namespace_pmem() -> to_namespace_index()
| Type | Parameter | Key | Value |
|---|---|---|---|
| PARAM_VALUE | 0 | ndd | 4096-ptr_max |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| DATA_SOURCE | 0 | ndd | r to_ndd |
| RX_PATH | |||
| TASK_NOT_RUNNING | |||
| LOCK2 | &nd_mapping->lock | ||
| HALF_LOCKED2 | &dev->mutex | ||
| TYPE_LOCK | (struct nd_mapping)->lock |
drivers/nvdimm/region_devs.c set_cookie_show() -> to_namespace_index()
| Type | Parameter | Key | Value |
|---|---|---|---|
| PARAM_VALUE | 0 | ndd | 4096-ptr_max |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| BUF_SIZE | 0 | ndd | s32min-(-2),1-s32max |
| DATA_SOURCE | 0 | ndd | r to_ndd |
| RX_PATH | |||
| TASK_NOT_RUNNING | |||
| LOCK2 | &dev->mutex | ||
| LOCK2 | &of->mutex | ||
| HALF_LOCKED2 | &of->prealloc_mutex | ||
| HALF_LOCKED2 | &pool->lock | ||
| TYPE_LOCK | (struct device)->mutex | ||
| TYPE_LOCK | (struct kernfs_open_file)->mutex |