{
struct nx_info *new = NULL;
- nxdprintk("alloc_nx_info()\n");
+ vxdprintk(VXD_CBIT(nid, 1), "alloc_nx_info(%d)*", nid);
/* would this benefit from a slab cache? */
new = kmalloc(sizeof(struct nx_info), GFP_KERNEL);
/* rest of init goes here */
- nxdprintk("alloc_nx_info() = %p\n", new);
+ vxdprintk(VXD_CBIT(nid, 0),
+ "alloc_nx_info() = %p", new);
return new;
}
static void __dealloc_nx_info(struct nx_info *nxi)
{
- nxdprintk("dealloc_nx_info(%p)\n", nxi);
+ vxdprintk(VXD_CBIT(nid, 0),
+ "dealloc_nx_info(%p)", nxi);
nxi->nx_hlist.next = LIST_POISON1;
nxi->nx_id = -1;
{
struct hlist_head *head;
- nxdprintk("__hash_nx_info: %p[#%d]\n", nxi, nxi->nx_id);
+ vxdprintk(VXD_CBIT(nid, 4),
+ "__hash_nx_info: %p[#%d]", nxi, nxi->nx_id);
get_nx_info(nxi);
head = &nx_info_hash[__hashval(nxi->nx_id)];
hlist_add_head_rcu(&nxi->nx_hlist, head);
static inline void __unhash_nx_info(struct nx_info *nxi)
{
- nxdprintk("__unhash_nx_info: %p[#%d]\n", nxi, nxi->nx_id);
+ vxdprintk(VXD_CBIT(nid, 4),
+ "__unhash_nx_info: %p[#%d]", nxi, nxi->nx_id);
hlist_del_rcu(&nxi->nx_hlist);
put_nx_info(nxi);
}
do {
if (++seq > MAX_N_CONTEXT)
seq = MIN_D_CONTEXT;
- if (!__lookup_nx_info(seq))
+ if (!__lookup_nx_info(seq)) {
+ vxdprintk(VXD_CBIT(nid, 4),
+ "__nx_dynamic_id: [#%d]", seq);
return seq;
+ }
} while (barrier != seq);
return 0;
}
{
struct nx_info *new, *nxi = NULL;
- nxdprintk("loc_nx_info(%d)\n", id);
+ vxdprintk(VXD_CBIT(nid, 1), "loc_nx_info(%d)*", id);
if (!(new = __alloc_nx_info(id))) {
*err = -ENOMEM;
else if ((nxi = __lookup_nx_info(id))) {
/* context in setup is not available */
if (nxi->nx_flags & VXF_STATE_SETUP) {
- nxdprintk("loc_nx_info(%d) = %p (not available)\n", id, nxi);
+ vxdprintk(VXD_CBIT(nid, 0),
+ "loc_nx_info(%d) = %p (not available)", id, nxi);
nxi = NULL;
*err = -EBUSY;
} else {
- nxdprintk("loc_nx_info(%d) = %p (found)\n", id, nxi);
+ vxdprintk(VXD_CBIT(nid, 0),
+ "loc_nx_info(%d) = %p (found)", id, nxi);
get_nx_info(nxi);
*err = 0;
}
}
/* new context requested */
- nxdprintk("loc_nx_info(%d) = %p (new)\n", id, new);
+ vxdprintk(VXD_CBIT(nid, 0),
+ "loc_nx_info(%d) = %p (new)", id, new);
__hash_nx_info(get_nx_info(new));
nxi = new, new = NULL;
*err = 1;
-void rcu_free_nx_info(void *obj)
+void rcu_free_nx_info(struct rcu_head *head)
{
- struct nx_info *nxi = obj;
+ struct nx_info *nxi = container_of(head, struct nx_info, nx_rcu);
int usecnt, refcnt;
+ BUG_ON(!nxi || !head);
+
usecnt = atomic_read(&nxi->nx_usecnt);
BUG_ON(usecnt < 0);
refcnt = atomic_read(&nxi->nx_refcnt);
BUG_ON(refcnt < 0);
+ vxdprintk(VXD_CBIT(nid, 3),
+ "rcu_free_nx_info(%p): uc=%d", nxi, usecnt);
if (!usecnt)
__dealloc_nx_info(nxi);
else
struct nx_info *new;
int err;
- nxdprintk("create_nx_info()\n");
+ vxdprintk(VXD_CBIT(nid, 5), "create_nx_info(%s)", "void");
if (!(new = __loc_nx_info(NX_DYNAMIC_ID, &err)))
return NULL;
return new;
if (!p || !nxi)
BUG();
- nxdprintk("nx_migrate_task(%p,%p[#%d.%d.%d])\n",
+ vxdprintk(VXD_CBIT(nid, 5),
+ "nx_migrate_task(%p,%p[#%d.%d.%d])",
p, nxi, nxi->nx_id,
atomic_read(&nxi->nx_usecnt),
atomic_read(&nxi->nx_refcnt));