...
Gliffy Diagram name UDSP_Storage_Structure pagePin 34
Kernel IOCTL Handling
| Code Block |
|---|
/*
* api-ni.c will be modified to handle adding a UDSP
* All UDSP operations are done under mutex and exclusive spin
* lock to avoid constructs changing during application of the
* policies.
*/
int
LNetCtl(unsigned int cmd, void *arg)
{
...
case IOC_LIBCFS_ADD_UDSP: {
struct lnet_ioctl_config_udsp *config_udsp = arg;
mutex_lock(&the_lnet.ln_api_mutex);
/*
* add and do initial flattening of the UDSP into
* internal structures.
*/
rc = lnet_add_and_flatten_udsp(config_udsp);
mutex_unlock(&the_lnet.ln_api_mutex);
return rc;
}
case IOC_LIBCFS_DEL_UDSP: {
struct lnet_ioctl_config_udsp *del_udsp = arg;
mutex_lock(&the_lnet.ln_api_mutex);
/*
* delete the rule identified by index
*/
rc = lnet_del_udsp(del_udsp->udsp_idx);
mutex_unlock(&the_lnet.ln_api_mutex);
return rc;
}
case IOC_LIBCFS_GET_UDSP_SIZE: {
struct lnet_ioctl_config_udsp *get_udsp = arg;
mutex_lock(&the_lnet.ln_api_mutex);
/*
* get the UDSP size specified by idx
*/
rc = lnet_get_udsp_num(get_udsp);
mutex_unlock(&the_lnet.ln_api_mutex);
return rc
}
case IOC_LIBCFS_GET_UDSP: {
struct lnet_ioctl_config_udsp *get_udsp = arg;
mutex_lock(&the_lnet.ln_api_mutex);
/*
* get the udsp at index provided. Return -ENOENT if
* no more UDSPs to get
*/
rc = lnet_add_udsp(get_udsp, get_udsp->udsp_idx);
mutex_unlock(&the_lnet.ln_api_mutex);
return rc
}
...
} |
...