Lines Matching refs:xrcd

647 	struct ib_xrcd *xrcd;  member
653 struct ib_xrcd *xrcd) in xrcd_table_insert() argument
663 entry->xrcd = xrcd; in xrcd_table_insert()
714 return entry->xrcd; in find_xrcd()
739 struct ib_xrcd *xrcd = NULL; in ib_uverbs_open_xrcd() local
766 xrcd = find_xrcd(file->device, inode); in ib_uverbs_open_xrcd()
767 if (!xrcd && !(cmd.oflags & O_CREAT)) { in ib_uverbs_open_xrcd()
773 if (xrcd && cmd.oflags & O_EXCL) { in ib_uverbs_open_xrcd()
789 if (!xrcd) { in ib_uverbs_open_xrcd()
790 xrcd = ib_dev->alloc_xrcd(ib_dev, file->ucontext, &udata); in ib_uverbs_open_xrcd()
791 if (IS_ERR(xrcd)) { in ib_uverbs_open_xrcd()
792 ret = PTR_ERR(xrcd); in ib_uverbs_open_xrcd()
796 xrcd->inode = inode; in ib_uverbs_open_xrcd()
797 xrcd->device = ib_dev; in ib_uverbs_open_xrcd()
798 atomic_set(&xrcd->usecnt, 0); in ib_uverbs_open_xrcd()
799 mutex_init(&xrcd->tgt_qp_mutex); in ib_uverbs_open_xrcd()
800 INIT_LIST_HEAD(&xrcd->tgt_qp_list); in ib_uverbs_open_xrcd()
805 obj->uobject.object = xrcd; in ib_uverbs_open_xrcd()
816 ret = xrcd_table_insert(file->device, inode, xrcd); in ib_uverbs_open_xrcd()
820 atomic_inc(&xrcd->usecnt); in ib_uverbs_open_xrcd()
846 atomic_dec(&xrcd->usecnt); in ib_uverbs_open_xrcd()
853 ib_dealloc_xrcd(xrcd); in ib_uverbs_open_xrcd()
874 struct ib_xrcd *xrcd = NULL; in ib_uverbs_close_xrcd() local
890 xrcd = uobj->object; in ib_uverbs_close_xrcd()
891 inode = xrcd->inode; in ib_uverbs_close_xrcd()
899 if (!inode || atomic_dec_and_test(&xrcd->usecnt)) { in ib_uverbs_close_xrcd()
907 atomic_inc(&xrcd->usecnt); in ib_uverbs_close_xrcd()
931 struct ib_xrcd *xrcd) in ib_uverbs_dealloc_xrcd() argument
935 inode = xrcd->inode; in ib_uverbs_dealloc_xrcd()
936 if (inode && !atomic_dec_and_test(&xrcd->usecnt)) in ib_uverbs_dealloc_xrcd()
939 ib_dealloc_xrcd(xrcd); in ib_uverbs_dealloc_xrcd()
1759 struct ib_xrcd *xrcd = NULL; in create_qp() local
1781 xrcd = idr_read_xrcd(cmd->pd_handle, file->ucontext, in create_qp()
1783 if (!xrcd) { in create_qp()
1787 device = xrcd->device; in create_qp()
1828 attr.xrcd = xrcd; in create_qp()
1912 if (xrcd) { in create_qp()
1944 if (xrcd) in create_qp()
2074 struct ib_xrcd *xrcd; in ib_uverbs_open_qp() local
2097 xrcd = idr_read_xrcd(cmd.pd_handle, file->ucontext, &xrcd_uobj); in ib_uverbs_open_qp()
2098 if (!xrcd) { in ib_uverbs_open_qp()
2112 qp = ib_open_qp(xrcd, &attr); in ib_uverbs_open_qp()
3294 attr.ext.xrc.xrcd = idr_read_xrcd(cmd->xrcd_handle, file->ucontext, &xrcd_uobj); in __uverbs_create_xsrq()
3295 if (!attr.ext.xrc.xrcd) { in __uverbs_create_xsrq()
3341 srq->ext.xrc.xrcd = attr.ext.xrc.xrcd; in __uverbs_create_xsrq()
3343 atomic_inc(&attr.ext.xrc.xrcd->usecnt); in __uverbs_create_xsrq()