summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
94d1ce4)
LNET_MUTEX_LOCK and LNET_MUTEX_UNLOCK are verbose wrappers to mutex_lock and
mutex_unlock. Get rid of these.
Change-Id: Icdb029441d57ce080ce4b1e7990d38d4ff0edf26
Signed-off-by: Mike Shuey <shuey@purdue.edu>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-on: http://review.whamcloud.com/18985
Tested-by: Jenkins
Reviewed-by: Frank Zago <fzago@cray.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
#define lnet_eq_wait_unlock() spin_unlock(&the_lnet.ln_eq_wait_lock)
#define lnet_ni_lock(ni) spin_lock(&(ni)->ni_lock)
#define lnet_ni_unlock(ni) spin_unlock(&(ni)->ni_lock)
#define lnet_eq_wait_unlock() spin_unlock(&the_lnet.ln_eq_wait_lock)
#define lnet_ni_lock(ni) spin_lock(&(ni)->ni_lock)
#define lnet_ni_unlock(ni) spin_unlock(&(ni)->ni_lock)
-#define LNET_MUTEX_LOCK(m) mutex_lock(m)
-#define LNET_MUTEX_UNLOCK(m) mutex_unlock(m)
void
lnet_register_lnd (lnd_t *lnd)
{
void
lnet_register_lnd (lnd_t *lnd)
{
- LNET_MUTEX_LOCK(&the_lnet.ln_lnd_mutex);
+ mutex_lock(&the_lnet.ln_lnd_mutex);
LASSERT(libcfs_isknown_lnd(lnd->lnd_type));
LASSERT(lnet_find_lnd_by_type(lnd->lnd_type) == NULL);
LASSERT(libcfs_isknown_lnd(lnd->lnd_type));
LASSERT(lnet_find_lnd_by_type(lnd->lnd_type) == NULL);
CDEBUG(D_NET, "%s LND registered\n", libcfs_lnd2str(lnd->lnd_type));
CDEBUG(D_NET, "%s LND registered\n", libcfs_lnd2str(lnd->lnd_type));
- LNET_MUTEX_UNLOCK(&the_lnet.ln_lnd_mutex);
+ mutex_unlock(&the_lnet.ln_lnd_mutex);
}
EXPORT_SYMBOL(lnet_register_lnd);
void
lnet_unregister_lnd (lnd_t *lnd)
{
}
EXPORT_SYMBOL(lnet_register_lnd);
void
lnet_unregister_lnd (lnd_t *lnd)
{
- LNET_MUTEX_LOCK(&the_lnet.ln_lnd_mutex);
+ mutex_lock(&the_lnet.ln_lnd_mutex);
LASSERT(lnet_find_lnd_by_type(lnd->lnd_type) == lnd);
LASSERT(lnd->lnd_refcount == 0);
LASSERT(lnet_find_lnd_by_type(lnd->lnd_type) == lnd);
LASSERT(lnd->lnd_refcount == 0);
list_del(&lnd->lnd_list);
CDEBUG(D_NET, "%s LND unregistered\n", libcfs_lnd2str(lnd->lnd_type));
list_del(&lnd->lnd_list);
CDEBUG(D_NET, "%s LND unregistered\n", libcfs_lnd2str(lnd->lnd_type));
- LNET_MUTEX_UNLOCK(&the_lnet.ln_lnd_mutex);
+ mutex_unlock(&the_lnet.ln_lnd_mutex);
}
EXPORT_SYMBOL(lnet_unregister_lnd);
}
EXPORT_SYMBOL(lnet_unregister_lnd);
- LNET_MUTEX_LOCK(&the_lnet.ln_lnd_mutex);
+ mutex_lock(&the_lnet.ln_lnd_mutex);
lnd = lnet_find_lnd_by_type(lnd_type);
if (lnd == NULL) {
lnd = lnet_find_lnd_by_type(lnd_type);
if (lnd == NULL) {
- LNET_MUTEX_UNLOCK(&the_lnet.ln_lnd_mutex);
+ mutex_unlock(&the_lnet.ln_lnd_mutex);
rc = request_module("%s", libcfs_lnd2modname(lnd_type));
rc = request_module("%s", libcfs_lnd2modname(lnd_type));
- LNET_MUTEX_LOCK(&the_lnet.ln_lnd_mutex);
+ mutex_lock(&the_lnet.ln_lnd_mutex);
lnd = lnet_find_lnd_by_type(lnd_type);
if (lnd == NULL) {
lnd = lnet_find_lnd_by_type(lnd_type);
if (lnd == NULL) {
- LNET_MUTEX_UNLOCK(&the_lnet.ln_lnd_mutex);
+ mutex_unlock(&the_lnet.ln_lnd_mutex);
CERROR("Can't load LND %s, module %s, rc=%d\n",
libcfs_lnd2str(lnd_type),
libcfs_lnd2modname(lnd_type), rc);
CERROR("Can't load LND %s, module %s, rc=%d\n",
libcfs_lnd2str(lnd_type),
libcfs_lnd2modname(lnd_type), rc);
LIBCFS_ALLOC(ni->ni_lnd_tunables,
sizeof(*ni->ni_lnd_tunables));
if (ni->ni_lnd_tunables == NULL) {
LIBCFS_ALLOC(ni->ni_lnd_tunables,
sizeof(*ni->ni_lnd_tunables));
if (ni->ni_lnd_tunables == NULL) {
- LNET_MUTEX_UNLOCK(&the_lnet.ln_lnd_mutex);
+ mutex_unlock(&the_lnet.ln_lnd_mutex);
rc = -ENOMEM;
goto failed0;
}
rc = -ENOMEM;
goto failed0;
}
rc = (lnd->lnd_startup)(ni);
rc = (lnd->lnd_startup)(ni);
- LNET_MUTEX_UNLOCK(&the_lnet.ln_lnd_mutex);
+ mutex_unlock(&the_lnet.ln_lnd_mutex);
if (rc != 0) {
LCONSOLE_ERROR_MSG(0x105, "Error %d starting up LNI %s\n",
if (rc != 0) {
LCONSOLE_ERROR_MSG(0x105, "Error %d starting up LNI %s\n",
INIT_LIST_HEAD(&net_head);
INIT_LIST_HEAD(&net_head);
- LNET_MUTEX_LOCK(&the_lnet.ln_api_mutex);
+ mutex_lock(&the_lnet.ln_api_mutex);
CDEBUG(D_OTHER, "refs %d\n", the_lnet.ln_refcount);
if (the_lnet.ln_refcount > 0) {
rc = the_lnet.ln_refcount++;
CDEBUG(D_OTHER, "refs %d\n", the_lnet.ln_refcount);
if (the_lnet.ln_refcount > 0) {
rc = the_lnet.ln_refcount++;
- LNET_MUTEX_UNLOCK(&the_lnet.ln_api_mutex);
+ mutex_unlock(&the_lnet.ln_api_mutex);
return rc;
}
rc = lnet_prepare(requested_pid);
if (rc != 0) {
return rc;
}
rc = lnet_prepare(requested_pid);
if (rc != 0) {
- LNET_MUTEX_UNLOCK(&the_lnet.ln_api_mutex);
+ mutex_unlock(&the_lnet.ln_api_mutex);
lnet_fault_init();
lnet_proc_init();
lnet_fault_init();
lnet_proc_init();
- LNET_MUTEX_UNLOCK(&the_lnet.ln_api_mutex);
+ mutex_unlock(&the_lnet.ln_api_mutex);
failed0:
lnet_unprepare();
LASSERT(rc < 0);
failed0:
lnet_unprepare();
LASSERT(rc < 0);
- LNET_MUTEX_UNLOCK(&the_lnet.ln_api_mutex);
+ mutex_unlock(&the_lnet.ln_api_mutex);
while (!list_empty(&net_head)) {
struct lnet_ni *ni;
ni = list_entry(net_head.next, struct lnet_ni, ni_list);
while (!list_empty(&net_head)) {
struct lnet_ni *ni;
ni = list_entry(net_head.next, struct lnet_ni, ni_list);
- LNET_MUTEX_LOCK(&the_lnet.ln_api_mutex);
+ mutex_lock(&the_lnet.ln_api_mutex);
LASSERT (the_lnet.ln_refcount > 0);
LASSERT (the_lnet.ln_refcount > 0);
- LNET_MUTEX_UNLOCK(&the_lnet.ln_api_mutex);
+ mutex_unlock(&the_lnet.ln_api_mutex);
return 0;
}
EXPORT_SYMBOL(LNetNIFini);
return 0;
}
EXPORT_SYMBOL(LNetNIFini);
if (rc <= 0)
return rc == 0 ? -EINVAL : rc;
if (rc <= 0)
return rc == 0 ? -EINVAL : rc;
- LNET_MUTEX_LOCK(&the_lnet.ln_api_mutex);
+ mutex_lock(&the_lnet.ln_api_mutex);
if (rc > 1) {
rc = -EINVAL; /* only add one interface per call */
if (rc > 1) {
rc = -EINVAL; /* only add one interface per call */
}
lnet_ping_target_update(pinfo, md_handle);
}
lnet_ping_target_update(pinfo, md_handle);
- LNET_MUTEX_UNLOCK(&the_lnet.ln_api_mutex);
+ mutex_unlock(&the_lnet.ln_api_mutex);
lnet_ping_md_unlink(pinfo, &md_handle);
lnet_ping_info_free(pinfo);
failed0:
lnet_ping_md_unlink(pinfo, &md_handle);
lnet_ping_info_free(pinfo);
failed0:
- LNET_MUTEX_UNLOCK(&the_lnet.ln_api_mutex);
+ mutex_unlock(&the_lnet.ln_api_mutex);
while (!list_empty(&net_head)) {
ni = list_entry(net_head.next, struct lnet_ni, ni_list);
list_del_init(&ni->ni_list);
while (!list_empty(&net_head)) {
ni = list_entry(net_head.next, struct lnet_ni, ni_list);
list_del_init(&ni->ni_list);
if (LNET_NETTYP(net) == LOLND)
return -EINVAL;
if (LNET_NETTYP(net) == LOLND)
return -EINVAL;
- LNET_MUTEX_LOCK(&the_lnet.ln_api_mutex);
+ mutex_lock(&the_lnet.ln_api_mutex);
/* create and link a new ping info, before removing the old one */
rc = lnet_ping_info_setup(&pinfo, &md_handle,
lnet_get_ni_count() - 1, false);
/* create and link a new ping info, before removing the old one */
rc = lnet_ping_info_setup(&pinfo, &md_handle,
lnet_get_ni_count() - 1, false);
lnet_ping_md_unlink(pinfo, &md_handle);
lnet_ping_info_free(pinfo);
out:
lnet_ping_md_unlink(pinfo, &md_handle);
lnet_ping_info_free(pinfo);
out:
- LNET_MUTEX_UNLOCK(&the_lnet.ln_api_mutex);
+ mutex_unlock(&the_lnet.ln_api_mutex);
if (config->cfg_hdr.ioc_len < sizeof(*config))
return -EINVAL;
if (config->cfg_hdr.ioc_len < sizeof(*config))
return -EINVAL;
- LNET_MUTEX_LOCK(&the_lnet.ln_api_mutex);
+ mutex_lock(&the_lnet.ln_api_mutex);
rc = lnet_add_route(config->cfg_net,
config->cfg_config_u.cfg_route.rtr_hop,
config->cfg_nid,
rc = lnet_add_route(config->cfg_net,
config->cfg_config_u.cfg_route.rtr_hop,
config->cfg_nid,
lnet_del_route(config->cfg_net,
config->cfg_nid);
}
lnet_del_route(config->cfg_net,
config->cfg_nid);
}
- LNET_MUTEX_UNLOCK(&the_lnet.ln_api_mutex);
+ mutex_unlock(&the_lnet.ln_api_mutex);
return rc;
case IOC_LIBCFS_DEL_ROUTE:
return rc;
case IOC_LIBCFS_DEL_ROUTE:
if (config->cfg_hdr.ioc_len < sizeof(*config))
return -EINVAL;
if (config->cfg_hdr.ioc_len < sizeof(*config))
return -EINVAL;
- LNET_MUTEX_LOCK(&the_lnet.ln_api_mutex);
+ mutex_lock(&the_lnet.ln_api_mutex);
rc = lnet_del_route(config->cfg_net, config->cfg_nid);
rc = lnet_del_route(config->cfg_net, config->cfg_nid);
- LNET_MUTEX_UNLOCK(&the_lnet.ln_api_mutex);
+ mutex_unlock(&the_lnet.ln_api_mutex);
return rc;
case IOC_LIBCFS_GET_ROUTE:
return rc;
case IOC_LIBCFS_GET_ROUTE:
if (config->cfg_hdr.ioc_len < sizeof(*config))
return -EINVAL;
if (config->cfg_hdr.ioc_len < sizeof(*config))
return -EINVAL;
- LNET_MUTEX_LOCK(&the_lnet.ln_api_mutex);
+ mutex_lock(&the_lnet.ln_api_mutex);
if (config->cfg_config_u.cfg_buffers.buf_enable) {
rc = lnet_rtrpools_enable();
if (config->cfg_config_u.cfg_buffers.buf_enable) {
rc = lnet_rtrpools_enable();
- LNET_MUTEX_UNLOCK(&the_lnet.ln_api_mutex);
+ mutex_unlock(&the_lnet.ln_api_mutex);
return rc;
}
lnet_rtrpools_disable();
return rc;
}
lnet_rtrpools_disable();
- LNET_MUTEX_UNLOCK(&the_lnet.ln_api_mutex);
+ mutex_unlock(&the_lnet.ln_api_mutex);
return 0;
case IOC_LIBCFS_ADD_BUF:
return 0;
case IOC_LIBCFS_ADD_BUF:
if (config->cfg_hdr.ioc_len < sizeof(*config))
return -EINVAL;
if (config->cfg_hdr.ioc_len < sizeof(*config))
return -EINVAL;
- LNET_MUTEX_LOCK(&the_lnet.ln_api_mutex);
+ mutex_lock(&the_lnet.ln_api_mutex);
rc = lnet_rtrpools_adjust(config->cfg_config_u.cfg_buffers.
buf_tiny,
config->cfg_config_u.cfg_buffers.
buf_small,
config->cfg_config_u.cfg_buffers.
buf_large);
rc = lnet_rtrpools_adjust(config->cfg_config_u.cfg_buffers.
buf_tiny,
config->cfg_config_u.cfg_buffers.
buf_small,
config->cfg_config_u.cfg_buffers.
buf_large);
- LNET_MUTEX_UNLOCK(&the_lnet.ln_api_mutex);
+ mutex_unlock(&the_lnet.ln_api_mutex);
return rc;
case IOC_LIBCFS_GET_BUF: {
return rc;
case IOC_LIBCFS_GET_BUF: {
/* 'arg' only there so I can be passed to cfs_create_thread() */
int rc = 0;
/* 'arg' only there so I can be passed to cfs_create_thread() */
int rc = 0;
- LNET_MUTEX_LOCK(&lnet_config_mutex);
+ mutex_lock(&lnet_config_mutex);
if (!the_lnet.ln_niinit_self) {
rc = try_module_get(THIS_MODULE);
if (!the_lnet.ln_niinit_self) {
rc = try_module_get(THIS_MODULE);
- LNET_MUTEX_UNLOCK(&lnet_config_mutex);
+ mutex_unlock(&lnet_config_mutex);
- LNET_MUTEX_LOCK(&lnet_config_mutex);
+ mutex_lock(&lnet_config_mutex);
if (the_lnet.ln_niinit_self) {
the_lnet.ln_niinit_self = 0;
if (the_lnet.ln_niinit_self) {
the_lnet.ln_niinit_self = 0;
module_put(THIS_MODULE);
}
module_put(THIS_MODULE);
}
- LNET_MUTEX_LOCK(&the_lnet.ln_api_mutex);
+ mutex_lock(&the_lnet.ln_api_mutex);
refcount = the_lnet.ln_refcount;
refcount = the_lnet.ln_refcount;
- LNET_MUTEX_UNLOCK(&the_lnet.ln_api_mutex);
+ mutex_unlock(&the_lnet.ln_api_mutex);
- LNET_MUTEX_UNLOCK(&lnet_config_mutex);
+ mutex_unlock(&lnet_config_mutex);
return (refcount == 0) ? 0 : -EBUSY;
}
return (refcount == 0) ? 0 : -EBUSY;
}
(struct lnet_ioctl_config_data *)hdr;
int rc;
(struct lnet_ioctl_config_data *)hdr;
int rc;
- LNET_MUTEX_LOCK(&lnet_config_mutex);
+ mutex_lock(&lnet_config_mutex);
if (the_lnet.ln_niinit_self)
rc = lnet_dyn_add_ni(LNET_PID_LUSTRE, conf);
else
rc = -EINVAL;
if (the_lnet.ln_niinit_self)
rc = lnet_dyn_add_ni(LNET_PID_LUSTRE, conf);
else
rc = -EINVAL;
- LNET_MUTEX_UNLOCK(&lnet_config_mutex);
+ mutex_unlock(&lnet_config_mutex);
(struct lnet_ioctl_config_data *) hdr;
int rc;
(struct lnet_ioctl_config_data *) hdr;
int rc;
- LNET_MUTEX_LOCK(&lnet_config_mutex);
+ mutex_lock(&lnet_config_mutex);
if (the_lnet.ln_niinit_self)
rc = lnet_dyn_del_ni(conf->cfg_net);
else
rc = -EINVAL;
if (the_lnet.ln_niinit_self)
rc = lnet_dyn_del_ni(conf->cfg_net);
else
rc = -EINVAL;
- LNET_MUTEX_UNLOCK(&lnet_config_mutex);
+ mutex_unlock(&lnet_config_mutex);