Re: [PATCH rdma-next v7 6/8] RDMA/core: Add resource tracking for create and destroy PDs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 28, 2018 at 01:48:58PM -0700, Jason Gunthorpe wrote:
> On Sun, Jan 28, 2018 at 11:17:23AM +0200, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> >
> > Track create and destroy operations of PD objects.
> >
> > Reviewed-by: Mark Bloch <markb@xxxxxxxxxxxx>
> > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> > Reviewed-by: Steve Wise <swise@xxxxxxxxxxxxxxxxxxxxx>
> >  drivers/infiniband/core/uverbs_cmd.c | 2 ++
> >  drivers/infiniband/core/verbs.c      | 5 +++++
> >  2 files changed, 7 insertions(+)
> >
> > diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
> > index 3e95acd29de7..256934d1f64f 100644
> > +++ b/drivers/infiniband/core/uverbs_cmd.c
> > @@ -340,6 +340,8 @@ ssize_t ib_uverbs_alloc_pd(struct ib_uverbs_file *file,
> >  	uobj->object = pd;
> >  	memset(&resp, 0, sizeof resp);
> >  	resp.pd_handle = uobj->id;
> > +	pd->res.type = RDMA_RESTRACK_PD;
> > +	rdma_restrack_add(&pd->res);
>
> This pattern happens a lot, any reason not to add type to the
> signature of rdma_restrack_add ?

In early versions, I used the suggested signature, but found it clumsy
and liked more this patter, where all restrack functions operates or on
the entry or on the root.

>
> Jason

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux