Lines Matching refs:p
54 struct p9_idpool *p; in p9_idpool_create() local
56 p = kmalloc(sizeof(struct p9_idpool), GFP_KERNEL); in p9_idpool_create()
57 if (!p) in p9_idpool_create()
60 spin_lock_init(&p->lock); in p9_idpool_create()
61 idr_init(&p->pool); in p9_idpool_create()
63 return p; in p9_idpool_create()
72 void p9_idpool_destroy(struct p9_idpool *p) in p9_idpool_destroy() argument
74 idr_destroy(&p->pool); in p9_idpool_destroy()
75 kfree(p); in p9_idpool_destroy()
87 int p9_idpool_get(struct p9_idpool *p) in p9_idpool_get() argument
94 if (idr_pre_get(&p->pool, GFP_KERNEL) == 0) in p9_idpool_get()
97 spin_lock_irqsave(&p->lock, flags); in p9_idpool_get()
100 error = idr_get_new(&p->pool, p, &i); in p9_idpool_get()
101 spin_unlock_irqrestore(&p->lock, flags); in p9_idpool_get()
108 P9_DPRINTK(P9_DEBUG_MUX, " id %d pool %p\n", i, p); in p9_idpool_get()
122 void p9_idpool_put(int id, struct p9_idpool *p) in p9_idpool_put() argument
126 P9_DPRINTK(P9_DEBUG_MUX, " id %d pool %p\n", id, p); in p9_idpool_put()
128 spin_lock_irqsave(&p->lock, flags); in p9_idpool_put()
129 idr_remove(&p->pool, id); in p9_idpool_put()
130 spin_unlock_irqrestore(&p->lock, flags); in p9_idpool_put()
140 int p9_idpool_check(int id, struct p9_idpool *p) in p9_idpool_check() argument
142 return idr_find(&p->pool, id) != NULL; in p9_idpool_check()