LASSERT(kiblnd_peer_idle(peer));
LASSERT(list_empty(&peer->ibp_tx_queue));
- LIBCFS_FREE(peer, sizeof(*peer));
+ kfree(peer);
/*
* NB a peer's connections keep a reference on their peer until
goto failed_2;
}
- LIBCFS_FREE(init_qp_attr, sizeof(*init_qp_attr));
+ kfree(init_qp_attr);
/* 1 ref for caller and each rxmsg */
atomic_set(&conn->ibc_refcount, 1 + IBLND_RX_MSGS(conn));
failed_2:
kiblnd_destroy_conn(conn, true);
failed_1:
- LIBCFS_FREE(init_qp_attr, sizeof(*init_qp_attr));
+ kfree(init_qp_attr);
failed_0:
return NULL;
}
IBLND_RX_MSGS(conn) * sizeof(struct kib_rx));
}
- if (conn->ibc_connvars)
- LIBCFS_FREE(conn->ibc_connvars, sizeof(*conn->ibc_connvars));
+ kfree(conn->ibc_connvars);
if (conn->ibc_hdev)
kiblnd_hdev_decref(conn->ibc_hdev);
atomic_dec(&net->ibn_nconns);
}
- LIBCFS_FREE(conn, sizeof(*conn));
+ kfree(conn);
}
int kiblnd_close_peer_conns_locked(struct kib_peer *peer, int why)
frd_list) {
list_del(&frd->frd_list);
ib_dereg_mr(frd->frd_mr);
- LIBCFS_FREE(frd, sizeof(*frd));
+ kfree(frd);
i++;
}
if (i < fpo->fast_reg.fpo_pool_size)
if (fpo->fpo_hdev)
kiblnd_hdev_decref(fpo->fpo_hdev);
- LIBCFS_FREE(fpo, sizeof(*fpo));
+ kfree(fpo);
}
static void kiblnd_destroy_fmr_pool_list(struct list_head *head)
out_middle:
if (frd->frd_mr)
ib_dereg_mr(frd->frd_mr);
- LIBCFS_FREE(frd, sizeof(*frd));
+ kfree(frd);
out:
list_for_each_entry_safe(frd, tmp, &fpo->fast_reg.fpo_pool_list,
frd_list) {
list_del(&frd->frd_list);
ib_dereg_mr(frd->frd_mr);
- LIBCFS_FREE(frd, sizeof(*frd));
+ kfree(frd);
}
return rc;
out_fpo:
kiblnd_hdev_decref(fpo->fpo_hdev);
- LIBCFS_FREE(fpo, sizeof(*fpo));
+ kfree(fpo);
return rc;
}
pool->po_size * sizeof(struct kib_tx));
out:
kiblnd_fini_pool(pool);
- LIBCFS_FREE(tpo, sizeof(*tpo));
+ kfree(tpo);
}
static int kiblnd_tx_pool_size(int ncpts)
npg = DIV_ROUND_UP(size * IBLND_MSG_SIZE, PAGE_SIZE);
if (kiblnd_alloc_pages(&tpo->tpo_tx_pages, ps->ps_cpt, npg)) {
CERROR("Can't allocate tx pages: %d\n", npg);
- LIBCFS_FREE(tpo, sizeof(*tpo));
+ kfree(tpo);
return -ENOMEM;
}
if (hdev->ibh_cmid)
rdma_destroy_id(hdev->ibh_cmid);
- LIBCFS_FREE(hdev, sizeof(*hdev));
+ kfree(hdev);
}
/* DUMMY */
goto out;
}
- LIBCFS_ALLOC(hdev, sizeof(*hdev));
+ hdev = kzalloc(sizeof(*hdev), GFP_NOFS);
if (!hdev) {
CERROR("Failed to allocate kib_hca_dev\n");
rdma_destroy_id(cmid);
if (dev->ibd_hdev)
kiblnd_hdev_decref(dev->ibd_hdev);
- LIBCFS_FREE(dev, sizeof(*dev));
+ kfree(dev);
}
static struct kib_dev *kiblnd_create_dev(char *ifname)
return NULL;
}
- LIBCFS_ALLOC(dev, sizeof(*dev));
+ dev = kzalloc(sizeof(*dev), GFP_NOFS);
if (!dev)
return NULL;
rc = kiblnd_dev_failover(dev);
if (rc) {
CERROR("Can't initialize device: %d\n", rc);
- LIBCFS_FREE(dev, sizeof(*dev));
+ kfree(dev);
return NULL;
}
net->ibn_init = IBLND_INIT_NOTHING;
ni->ni_data = NULL;
- LIBCFS_FREE(net, sizeof(*net));
+ kfree(net);
out:
if (list_empty(&kiblnd_data.kib_devs))
return rc;
}
- LIBCFS_ALLOC(net, sizeof(*net));
+ net = kzalloc(sizeof(*net), GFP_NOFS);
ni->ni_data = net;
if (!net)
goto net_failed;
(conn->ibc_state == IBLND_CONN_PASSIVE_WAIT &&
peer->ibp_accepting > 0));
- LIBCFS_FREE(conn->ibc_connvars, sizeof(*conn->ibc_connvars));
+ kfree(conn->ibc_connvars);
conn->ibc_connvars = NULL;
if (status) {
reconn += kiblnd_reconnect_peer(conn->ibc_peer);
kiblnd_peer_decref(conn->ibc_peer);
- LIBCFS_FREE(conn, sizeof(*conn));
+ kfree(conn);
spin_lock_irqsave(lock, flags);
}
* defaulted
*/
if (!ni->ni_lnd_tunables) {
- LIBCFS_ALLOC(ni->ni_lnd_tunables,
- sizeof(*ni->ni_lnd_tunables));
+ ni->ni_lnd_tunables = kzalloc(sizeof(*ni->ni_lnd_tunables),
+ GFP_NOFS);
if (!ni->ni_lnd_tunables)
return -ENOMEM;
{
struct ksock_route *route;
- LIBCFS_ALLOC(route, sizeof(*route));
+ route = kzalloc(sizeof(*route), GFP_NOFS);
if (!route)
return NULL;
if (route->ksnr_peer)
ksocknal_peer_decref(route->ksnr_peer);
- LIBCFS_FREE(route, sizeof(*route));
+ kfree(route);
}
static int
if (net->ksnn_shutdown) {
spin_unlock_bh(&net->ksnn_lock);
- LIBCFS_FREE(peer, sizeof(*peer));
+ kfree(peer);
CERROR("Can't create peer: network shutdown\n");
return -ESHUTDOWN;
}
LASSERT(list_empty(&peer->ksnp_tx_queue));
LASSERT(list_empty(&peer->ksnp_zc_req_list));
- LIBCFS_FREE(peer, sizeof(*peer));
+ kfree(peer);
/*
* NB a peer's connections and routes keep a reference on their peer
rc = lnet_sock_getaddr(sock, 1, &peer_ip, &peer_port);
LASSERT(!rc); /* we succeeded before */
- LIBCFS_ALLOC(cr, sizeof(*cr));
+ cr = kzalloc(sizeof(*cr), GFP_NOFS);
if (!cr) {
LCONSOLE_ERROR_MSG(0x12f, "Dropping connection request from %pI4h: memory exhausted\n",
&peer_ip);
LASSERT(active == (type != SOCKLND_CONN_NONE));
- LIBCFS_ALLOC(conn, sizeof(*conn));
+ conn = kzalloc(sizeof(*conn), GFP_NOFS);
if (!conn) {
rc = -ENOMEM;
goto failed_0;
LIBCFS_FREE(hello, offsetof(struct ksock_hello_msg,
kshm_ips[LNET_MAX_INTERFACES]));
- LIBCFS_FREE(conn, sizeof(*conn));
+ kfree(conn);
failed_0:
sock_release(sock);
ksocknal_peer_decref(conn->ksnc_peer);
- LIBCFS_FREE(conn, sizeof(*conn));
+ kfree(conn);
}
int
}
list_del(&net->ksnn_list);
- LIBCFS_FREE(net, sizeof(*net));
+ kfree(net);
ksocknal_data.ksnd_nnets--;
if (!ksocknal_data.ksnd_nnets)
return rc;
}
- LIBCFS_ALLOC(net, sizeof(*net));
+ net = kzalloc(sizeof(*net), GFP_NOFS);
if (!net)
goto fail_0;
return 0;
fail_1:
- LIBCFS_FREE(net, sizeof(*net));
+ kfree(net);
fail_0:
if (!ksocknal_data.ksnd_nnets)
ksocknal_base_shutdown();
ksocknal_create_conn(cr->ksncr_ni, NULL,
cr->ksncr_sock, SOCKLND_CONN_NONE);
lnet_ni_decref(cr->ksncr_ni);
- LIBCFS_FREE(cr, sizeof(*cr));
+ kfree(cr);
spin_lock_bh(connd_lock);
}
BUILD_BUG_ON(sizeof(struct lnet_magicversion) != offsetof(struct lnet_hdr, src_nid));
- LIBCFS_ALLOC(hdr, sizeof(*hdr));
+ hdr = kzalloc(sizeof(*hdr), GFP_NOFS);
if (!hdr) {
CERROR("Can't allocate struct lnet_hdr\n");
return -ENOMEM;
&conn->ksnc_ipaddr, conn->ksnc_port);
}
out:
- LIBCFS_FREE(hdr, sizeof(*hdr));
+ kfree(hdr);
return rc;
}
int rc;
int i;
- LIBCFS_ALLOC(hdr, sizeof(*hdr));
+ hdr = kzalloc(sizeof(*hdr), GFP_NOFS);
if (!hdr) {
CERROR("Can't allocate struct lnet_hdr\n");
return -ENOMEM;
}
}
out:
- LIBCFS_FREE(hdr, sizeof(*hdr));
+ kfree(hdr);
return rc;
}
return NULL;
}
- LIBCFS_ALLOC(cptab, sizeof(*cptab));
+ cptab = kzalloc(sizeof(*cptab), GFP_NOFS);
if (cptab) {
cptab->ctb_version = CFS_CPU_VERSION_MAGIC;
node_set(0, cptab->ctb_nodemask);
{
LASSERT(cptab->ctb_version == CFS_CPU_VERSION_MAGIC);
- LIBCFS_FREE(cptab, sizeof(*cptab));
+ kfree(cptab);
}
EXPORT_SYMBOL(cfs_cpt_table_free);
LASSERT(!pcl->pcl_locked);
cfs_percpt_free(pcl->pcl_locks);
- LIBCFS_FREE(pcl, sizeof(*pcl));
+ kfree(pcl);
}
EXPORT_SYMBOL(cfs_percpt_lock_free);
int i;
/* NB: cptab can be NULL, pcl will be for HW CPUs on that case */
- LIBCFS_ALLOC(pcl, sizeof(*pcl));
+ pcl = kzalloc(sizeof(*pcl), GFP_NOFS);
if (!pcl)
return NULL;
pcl->pcl_cptab = cptab;
pcl->pcl_locks = cfs_percpt_alloc(cptab, sizeof(*lock));
if (!pcl->pcl_locks) {
- LIBCFS_FREE(pcl, sizeof(*pcl));
+ kfree(pcl);
return NULL;
}
struct cfs_range_expr *re;
struct cfs_lstr tok;
- LIBCFS_ALLOC(re, sizeof(*re));
+ re = kzalloc(sizeof(*re), GFP_NOFS);
if (!re)
return -ENOMEM;
return 0;
failed:
- LIBCFS_FREE(re, sizeof(*re));
+ kfree(re);
return -EINVAL;
}
expr = list_entry(expr_list->el_exprs.next,
struct cfs_range_expr, re_link);
list_del(&expr->re_link);
- LIBCFS_FREE(expr, sizeof(*expr));
+ kfree(expr);
}
- LIBCFS_FREE(expr_list, sizeof(*expr_list));
+ kfree(expr_list);
}
EXPORT_SYMBOL(cfs_expr_list_free);
struct cfs_lstr src;
int rc;
- LIBCFS_ALLOC(expr_list, sizeof(*expr_list));
+ expr_list = kzalloc(sizeof(*expr_list), GFP_NOFS);
if (!expr_list)
return -ENOMEM;
for (i = 0; cptab->ctb_parts && i < cptab->ctb_nparts; i++) {
struct cfs_cpu_partition *part = &cptab->ctb_parts[i];
- if (part->cpt_nodemask) {
- LIBCFS_FREE(part->cpt_nodemask,
- sizeof(*part->cpt_nodemask));
- }
-
+ kfree(part->cpt_nodemask);
if (part->cpt_cpumask)
LIBCFS_FREE(part->cpt_cpumask, cpumask_size());
}
cptab->ctb_nparts * sizeof(cptab->ctb_parts[0]));
}
- if (cptab->ctb_nodemask)
- LIBCFS_FREE(cptab->ctb_nodemask, sizeof(*cptab->ctb_nodemask));
+ kfree(cptab->ctb_nodemask);
if (cptab->ctb_cpumask)
LIBCFS_FREE(cptab->ctb_cpumask, cpumask_size());
- LIBCFS_FREE(cptab, sizeof(*cptab));
+ kfree(cptab);
}
EXPORT_SYMBOL(cfs_cpt_table_free);
struct cfs_cpt_table *cptab;
int i;
- LIBCFS_ALLOC(cptab, sizeof(*cptab));
+ cptab = kzalloc(sizeof(*cptab), GFP_NOFS);
if (!cptab)
return NULL;
cptab->ctb_nparts = ncpt;
LIBCFS_ALLOC(cptab->ctb_cpumask, cpumask_size());
- LIBCFS_ALLOC(cptab->ctb_nodemask, sizeof(*cptab->ctb_nodemask));
+ cptab->ctb_nodemask = kzalloc(sizeof(*cptab->ctb_nodemask),
+ GFP_NOFS);
if (!cptab->ctb_cpumask || !cptab->ctb_nodemask)
goto failed;
struct cfs_cpu_partition *part = &cptab->ctb_parts[i];
LIBCFS_ALLOC(part->cpt_cpumask, cpumask_size());
- LIBCFS_ALLOC(part->cpt_nodemask, sizeof(*part->cpt_nodemask));
+ part->cpt_nodemask = kzalloc(sizeof(*part->cpt_nodemask),
+ GFP_NOFS);
if (!part->cpt_cpumask || !part->cpt_nodemask)
goto failed;
}
spin_unlock(&cfs_wi_data.wi_glock);
LASSERT(!sched->ws_nscheduled);
- LIBCFS_FREE(sched, sizeof(*sched));
+ kfree(sched);
}
EXPORT_SYMBOL(cfs_wi_sched_destroy);
LASSERT(!cptab || cpt == CFS_CPT_ANY ||
(cpt >= 0 && cpt < cfs_cpt_number(cptab)));
- LIBCFS_ALLOC(sched, sizeof(*sched));
+ sched = kzalloc(sizeof(*sched), GFP_NOFS);
if (!sched)
return -ENOMEM;
if (strlen(name) > sizeof(sched->ws_name) - 1) {
- LIBCFS_FREE(sched, sizeof(*sched));
+ kfree(sched);
return -E2BIG;
}
strncpy(sched->ws_name, name, sizeof(sched->ws_name));
}
list_for_each_entry_safe(sched, temp, &cfs_wi_data.wi_scheds, ws_list) {
list_del(&sched->ws_list);
- LIBCFS_FREE(sched, sizeof(*sched));
+ kfree(sched);
}
cfs_wi_data.wi_stopping = 0;
lnd_tunables = (struct lnet_ioctl_config_lnd_tunables *)conf->cfg_bulk;
if (lnd_tunables) {
- LIBCFS_ALLOC(ni->ni_lnd_tunables,
- sizeof(*ni->ni_lnd_tunables));
+ ni->ni_lnd_tunables = kzalloc(sizeof(*ni->ni_lnd_tunables),
+ GFP_NOFS);
if (!ni->ni_lnd_tunables) {
mutex_unlock(&the_lnet.ln_lnd_mutex);
rc = -ENOMEM;
if (ni->ni_cpts)
cfs_expr_list_values_free(ni->ni_cpts, ni->ni_ncpts);
- if (ni->ni_lnd_tunables)
- LIBCFS_FREE(ni->ni_lnd_tunables, sizeof(*ni->ni_lnd_tunables));
+ kfree(ni->ni_lnd_tunables);
for (i = 0; i < LNET_MAX_INTERFACES && ni->ni_interfaces[i]; i++) {
LIBCFS_FREE(ni->ni_interfaces[i],
if (ni->ni_net_ns)
put_net(ni->ni_net_ns);
- LIBCFS_FREE(ni, sizeof(*ni));
+ kfree(ni);
}
struct lnet_ni *
return NULL;
}
- LIBCFS_ALLOC(ni, sizeof(*ni));
+ ni = kzalloc(sizeof(*ni), GFP_NOFS);
if (!ni) {
CERROR("Out of memory creating network %s\n",
libcfs_net2str(net));
/* NB: use lnet_net_lock(0) to serialize operations on test peers */
if (threshold) {
/* Adding a new entry */
- LIBCFS_ALLOC(tp, sizeof(*tp));
+ tp = kzalloc(sizeof(*tp), GFP_NOFS);
if (!tp)
return -ENOMEM;
list_for_each_entry_safe(tp, temp, &cull, tp_list) {
list_del(&tp->tp_list);
- LIBCFS_FREE(tp, sizeof(*tp));
+ kfree(tp);
}
return 0;
}
list_for_each_entry_safe(tp, temp, &cull, tp_list) {
list_del(&tp->tp_list);
- LIBCFS_FREE(tp, sizeof(*tp));
+ kfree(tp);
}
return fail;
return 0;
}
- LIBCFS_ALLOC(addrrange, sizeof(struct addrrange));
+ addrrange = kzalloc(sizeof(struct addrrange), GFP_NOFS);
if (!addrrange)
return -ENOMEM;
list_add_tail(&addrrange->ar_link, &nidrange->nr_addrranges);
return nr;
}
- LIBCFS_ALLOC(nr, sizeof(struct nidrange));
+ nr = kzalloc(sizeof(struct nidrange), GFP_NOFS);
if (!nr)
return NULL;
list_add_tail(&nr->nr_link, nidlist);
cfs_expr_list_free_list(&ar->ar_numaddr_ranges);
list_del(&ar->ar_link);
- LIBCFS_FREE(ar, sizeof(struct addrrange));
+ kfree(ar);
}
}
nr = list_entry(pos, struct nidrange, nr_link);
free_addrranges(&nr->nr_addrranges);
list_del(pos);
- LIBCFS_FREE(nr, sizeof(struct nidrange));
+ kfree(nr);
}
}
EXPORT_SYMBOL(cfs_free_nidlist);
list_for_each_entry_safe(lp, temp, &deathrow, lp_hashlist) {
list_del(&lp->lp_hashlist);
- LIBCFS_FREE(lp, sizeof(*lp));
+ kfree(lp);
}
}
return -EEXIST;
/* Assume net, route, all new */
- LIBCFS_ALLOC(route, sizeof(*route));
- LIBCFS_ALLOC(rnet, sizeof(*rnet));
+ route = kzalloc(sizeof(*route), GFP_NOFS);
+ rnet = kzalloc(sizeof(*rnet), GFP_NOFS);
if (!route || !rnet) {
CERROR("Out of memory creating route %s %d %s\n",
libcfs_net2str(net), hops, libcfs_nid2str(gateway));
- if (route)
- LIBCFS_FREE(route, sizeof(*route));
- if (rnet)
- LIBCFS_FREE(rnet, sizeof(*rnet));
+ kfree(route);
+ kfree(rnet);
return -ENOMEM;
}
if (rc) {
lnet_net_unlock(LNET_LOCK_EX);
- LIBCFS_FREE(route, sizeof(*route));
- LIBCFS_FREE(rnet, sizeof(*rnet));
+ kfree(route);
+ kfree(rnet);
if (rc == -EHOSTUNREACH) /* gateway is not on a local net */
return rc; /* ignore the route entry */
if (!add_route) {
rc = -EEXIST;
- LIBCFS_FREE(route, sizeof(*route));
+ kfree(route);
}
if (rnet != rnet2)
- LIBCFS_FREE(rnet, sizeof(*rnet));
+ kfree(rnet);
/* indicate to startup the router checker if configured */
wake_up(&the_lnet.ln_rc_waitq);
lnet_net_unlock(LNET_LOCK_EX);
- LIBCFS_FREE(route, sizeof(*route));
-
- if (rnet)
- LIBCFS_FREE(rnet, sizeof(*rnet));
+ kfree(route);
+ kfree(rnet);
rc = 0;
lnet_net_lock(LNET_LOCK_EX);
if (rcd->rcd_pinginfo)
LIBCFS_FREE(rcd->rcd_pinginfo, LNET_PINGINFO_SIZE);
- LIBCFS_FREE(rcd, sizeof(*rcd));
+ kfree(rcd);
}
static struct lnet_rc_data *
lnet_net_unlock(gateway->lp_cpt);
- LIBCFS_ALLOC(rcd, sizeof(*rcd));
+ rcd = kzalloc(sizeof(*rcd), GFP_NOFS);
if (!rcd)
goto out;
/* read */
- LIBCFS_ALLOC(ctrs, sizeof(*ctrs));
+ ctrs = kzalloc(sizeof(*ctrs), GFP_NOFS);
if (!ctrs)
return -ENOMEM;
LIBCFS_ALLOC(tmpstr, tmpsiz);
if (!tmpstr) {
- LIBCFS_FREE(ctrs, sizeof(*ctrs));
+ kfree(ctrs);
return -ENOMEM;
}
tmpstr + pos, "\n");
LIBCFS_FREE(tmpstr, tmpsiz);
- LIBCFS_FREE(ctrs, sizeof(*ctrs));
+ kfree(ctrs);
return rc;
}
spin_unlock(&console_session.ses_rpc_lock);
if (!crpc) {
- LIBCFS_ALLOC(crpc, sizeof(*crpc));
+ crpc = kzalloc(sizeof(*crpc), GFP_NOFS);
if (!crpc)
return -ENOMEM;
}
return 0;
}
- LIBCFS_FREE(crpc, sizeof(*crpc));
+ kfree(crpc);
return rc;
}
}
/* create a trans group */
- LIBCFS_ALLOC(trans, sizeof(*trans));
+ trans = kzalloc(sizeof(*trans), GFP_NOFS);
if (!trans)
return -ENOMEM;
CDEBUG(D_NET, "Transaction %s destroyed with %d pending RPCs\n",
lstcon_rpc_trans_name(trans->tas_opc), count);
- LIBCFS_FREE(trans, sizeof(*trans));
+ kfree(trans);
}
int
list_for_each_entry_safe(crpc, temp, &zlist, crp_link) {
list_del(&crpc->crp_link);
- LIBCFS_FREE(crpc, sizeof(struct lstcon_rpc));
+ kfree(crpc);
}
}
if (rc)
return rc;
- LIBCFS_ALLOC(ndl, sizeof(struct lstcon_ndlink));
+ ndl = kzalloc(sizeof(struct lstcon_ndlink), GFP_NOFS);
if (!ndl) {
lstcon_node_put(nd);
return -ENOMEM;
list_del(&ndl->ndl_hlink); /* delete from hash */
lstcon_node_put(ndl->ndl_node);
- LIBCFS_FREE(ndl, sizeof(*ndl));
+ kfree(ndl);
}
static int
}
/* non-verbose query */
- LIBCFS_ALLOC(gentp, sizeof(struct lstcon_ndlist_ent));
+ gentp = kzalloc(sizeof(struct lstcon_ndlist_ent), GFP_NOFS);
if (!gentp) {
CERROR("Can't allocate ndlist_ent\n");
lstcon_group_decref(grp);
rc = copy_to_user(gents_p, gentp,
sizeof(struct lstcon_ndlist_ent)) ? -EFAULT : 0;
- LIBCFS_FREE(gentp, sizeof(struct lstcon_ndlist_ent));
+ kfree(gentp);
lstcon_group_decref(grp);
return rc;
}
- LIBCFS_ALLOC(bat, sizeof(struct lstcon_batch));
+ bat = kzalloc(sizeof(struct lstcon_batch), GFP_NOFS);
if (!bat) {
CERROR("Can't allocate descriptor for batch %s\n", name);
return -ENOMEM;
sizeof(struct list_head) * LST_NODE_HASHSIZE);
if (!bat->bat_cli_hash) {
CERROR("Can't allocate hash for batch %s\n", name);
- LIBCFS_FREE(bat, sizeof(struct lstcon_batch));
+ kfree(bat);
return -ENOMEM;
}
if (!bat->bat_srv_hash) {
CERROR("Can't allocate hash for batch %s\n", name);
LIBCFS_FREE(bat->bat_cli_hash, LST_NODE_HASHSIZE);
- LIBCFS_FREE(bat, sizeof(struct lstcon_batch));
+ kfree(bat);
return -ENOMEM;
}
if (strlen(name) > sizeof(bat->bat_name) - 1) {
LIBCFS_FREE(bat->bat_srv_hash, LST_NODE_HASHSIZE);
LIBCFS_FREE(bat->bat_cli_hash, LST_NODE_HASHSIZE);
- LIBCFS_FREE(bat, sizeof(struct lstcon_batch));
+ kfree(bat);
return -E2BIG;
}
strncpy(bat->bat_name, name, sizeof(bat->bat_name));
}
/* non-verbose query */
- LIBCFS_ALLOC(entp, sizeof(struct lstcon_test_batch_ent));
+ entp = kzalloc(sizeof(struct lstcon_test_batch_ent), GFP_NOFS);
if (!entp)
return -ENOMEM;
rc = copy_to_user(ent_up, entp,
sizeof(struct lstcon_test_batch_ent)) ? -EFAULT : 0;
- LIBCFS_FREE(entp, sizeof(struct lstcon_test_batch_ent));
+ kfree(entp);
return rc;
}
sizeof(struct list_head) * LST_NODE_HASHSIZE);
LIBCFS_FREE(bat->bat_srv_hash,
sizeof(struct list_head) * LST_NODE_HASHSIZE);
- LIBCFS_FREE(bat, sizeof(struct lstcon_batch));
+ kfree(bat);
}
static int
if (console_session.ses_state != LST_SESSION_ACTIVE)
return -ESRCH;
- LIBCFS_ALLOC(entp, sizeof(*entp));
+ entp = kzalloc(sizeof(*entp), GFP_NOFS);
if (!entp)
return -ENOMEM;
copy_to_user(name_up, console_session.ses_name, len))
rc = -EFAULT;
- LIBCFS_FREE(entp, sizeof(*entp));
+ kfree(entp);
return rc;
}
return -EEXIST;
}
- LIBCFS_ALLOC(tsc, sizeof(struct sfw_test_case));
+ tsc = kzalloc(sizeof(struct sfw_test_case), GFP_NOFS);
if (!tsc)
return -ENOMEM;
if (bat)
return bat;
- LIBCFS_ALLOC(bat, sizeof(struct sfw_batch));
+ bat = kzalloc(sizeof(struct sfw_batch), GFP_NOFS);
if (!bat)
return NULL;
}
/* brand new or create by force */
- LIBCFS_ALLOC(sn, sizeof(struct sfw_session));
+ sn = kzalloc(sizeof(struct sfw_session), GFP_NOFS);
if (!sn) {
CERROR("dropping RPC mksn under memory pressure\n");
return -ENOMEM;
tsu = list_entry(tsi->tsi_units.next,
struct sfw_test_unit, tsu_list);
list_del(&tsu->tsu_list);
- LIBCFS_FREE(tsu, sizeof(*tsu));
+ kfree(tsu);
}
while (!list_empty(&tsi->tsi_free_rpcs)) {
clean:
sfw_unload_test(tsi);
- LIBCFS_FREE(tsi, sizeof(*tsi));
+ kfree(tsi);
}
static void
sfw_destroy_test_instance(tsi);
}
- LIBCFS_FREE(tsb, sizeof(struct sfw_batch));
+ kfree(tsb);
}
void
sfw_destroy_batch(batch);
}
- LIBCFS_FREE(sn, sizeof(*sn));
+ kfree(sn);
atomic_dec(&sfw_data.fw_nzombies);
}
int i;
int rc;
- LIBCFS_ALLOC(tsi, sizeof(*tsi));
+ tsi = kzalloc(sizeof(*tsi), GFP_NOFS);
if (!tsi) {
CERROR("Can't allocate test instance for batch: %llu\n",
tsb->bat_id.bat_id);
rc = sfw_load_test(tsi);
if (rc) {
- LIBCFS_FREE(tsi, sizeof(*tsi));
+ kfree(tsi);
return rc;
}
sfw_unpack_id(id);
for (j = 0; j < tsi->tsi_concur; j++) {
- LIBCFS_ALLOC(tsu, sizeof(struct sfw_test_unit));
+ tsu = kzalloc(sizeof(struct sfw_test_unit), GFP_NOFS);
if (!tsu) {
rc = -ENOMEM;
CERROR("Can't allocate tsu for %d\n",
srpc_wait_service_shutdown(tsc->tsc_srv_service);
list_del(&tsc->tsc_list);
- LIBCFS_FREE(tsc, sizeof(*tsc));
+ kfree(tsc);
}
}
buf = list_entry(q->next, struct srpc_buffer,
buf_list);
list_del(&buf->buf_list);
- LIBCFS_FREE(buf, sizeof(*buf));
+ kfree(buf);
}
}
struct srpc_server_rpc,
srpc_list);
list_del(&rpc->srpc_list);
- LIBCFS_FREE(rpc, sizeof(*rpc));
+ kfree(rpc);
}
}
list_del(&buf->buf_list);
spin_unlock(&scd->scd_lock);
- LIBCFS_FREE(buf, sizeof(*buf));
+ kfree(buf);
spin_lock(&scd->scd_lock);
return rc;
spin_unlock(&scd->scd_lock);
- LIBCFS_ALLOC(buf, sizeof(*buf));
+ buf = kzalloc(sizeof(*buf), GFP_NOFS);
if (!buf) {
CERROR("Failed to add new buf to service: %s\n",
scd->scd_svc->sv_name);
spin_lock(&scd->scd_lock);
if (scd->scd_svc->sv_shuttingdown) {
spin_unlock(&scd->scd_lock);
- LIBCFS_FREE(buf, sizeof(*buf));
+ kfree(buf);
spin_lock(&scd->scd_lock);
rc = -ESHUTDOWN;
}
spin_unlock(&scd->scd_lock);
- LIBCFS_FREE(buf, sizeof(*buf));
+ kfree(buf);
spin_lock(&scd->scd_lock);
}