Re: [PATCH v3 02/11] iommufd: Rename _iommufd_object_alloc to iommufd_object_alloc_elm

2024-10-21 Thread Nicolin Chen
On Mon, Oct 21, 2024 at 12:26:54PM +1100, Alexey Kardashevskiy wrote: > On 18/10/24 02:37, Jason Gunthorpe wrote: > > On Thu, Oct 17, 2024 at 11:14:16AM -0300, Jason Gunthorpe wrote: > > > On Wed, Oct 09, 2024 at 09:38:02AM -0700, Nicolin Chen wrote: > > > > > > > @@ -217,12 +217,12 @@ iommufd_obj

Re: [PATCH v3 02/11] iommufd: Rename _iommufd_object_alloc to iommufd_object_alloc_elm

2024-10-20 Thread Alexey Kardashevskiy
On 18/10/24 02:37, Jason Gunthorpe wrote: On Thu, Oct 17, 2024 at 11:14:16AM -0300, Jason Gunthorpe wrote: On Wed, Oct 09, 2024 at 09:38:02AM -0700, Nicolin Chen wrote: @@ -217,12 +217,12 @@ iommufd_object_put_and_try_destroy(struct iommufd_ctx *ictx, iommufd_object_remove(ictx, obj,

Re: [PATCH v3 02/11] iommufd: Rename _iommufd_object_alloc to iommufd_object_alloc_elm

2024-10-17 Thread Jason Gunthorpe
On Thu, Oct 17, 2024 at 09:48:23AM -0700, Nicolin Chen wrote: > On Thu, Oct 17, 2024 at 01:35:07PM -0300, Jason Gunthorpe wrote: > > On Thu, Oct 17, 2024 at 09:12:03AM -0700, Nicolin Chen wrote: > > > > > > Then you can keep the pattern of _ being the allocation function of > > > > the macro > > >

Re: [PATCH v3 02/11] iommufd: Rename _iommufd_object_alloc to iommufd_object_alloc_elm

2024-10-17 Thread Nicolin Chen
On Thu, Oct 17, 2024 at 01:35:07PM -0300, Jason Gunthorpe wrote: > On Thu, Oct 17, 2024 at 09:12:03AM -0700, Nicolin Chen wrote: > > > > Then you can keep the pattern of _ being the allocation function of > > > the macro > > > > If I get it correctly, the change would be > > [From] > > level-0: i

Re: [PATCH v3 02/11] iommufd: Rename _iommufd_object_alloc to iommufd_object_alloc_elm

2024-10-17 Thread Jason Gunthorpe
On Thu, Oct 17, 2024 at 09:12:03AM -0700, Nicolin Chen wrote: > > Then you can keep the pattern of _ being the allocation function of > > the macro > > If I get it correctly, the change would be > [From] > level-0: iommufd_object_alloc() > level-1: __iommufd_object_alloc() > level-2:

Re: [PATCH v3 02/11] iommufd: Rename _iommufd_object_alloc to iommufd_object_alloc_elm

2024-10-17 Thread Nicolin Chen
On Thu, Oct 17, 2024 at 12:37:49PM -0300, Jason Gunthorpe wrote: > On Thu, Oct 17, 2024 at 11:14:16AM -0300, Jason Gunthorpe wrote: > > On Wed, Oct 09, 2024 at 09:38:02AM -0700, Nicolin Chen wrote: > > > > > @@ -217,12 +217,12 @@ iommufd_object_put_and_try_destroy(struct > > > iommufd_ctx *ictx,

Re: [PATCH v3 02/11] iommufd: Rename _iommufd_object_alloc to iommufd_object_alloc_elm

2024-10-17 Thread Jason Gunthorpe
On Thu, Oct 17, 2024 at 11:14:16AM -0300, Jason Gunthorpe wrote: > On Wed, Oct 09, 2024 at 09:38:02AM -0700, Nicolin Chen wrote: > > > @@ -217,12 +217,12 @@ iommufd_object_put_and_try_destroy(struct iommufd_ctx > > *ictx, > > iommufd_object_remove(ictx, obj, obj->id, 0); > > } > > > > -str

Re: [PATCH v3 02/11] iommufd: Rename _iommufd_object_alloc to iommufd_object_alloc_elm

2024-10-17 Thread Jason Gunthorpe
On Wed, Oct 09, 2024 at 09:38:02AM -0700, Nicolin Chen wrote: > @@ -217,12 +217,12 @@ iommufd_object_put_and_try_destroy(struct iommufd_ctx > *ictx, > iommufd_object_remove(ictx, obj, obj->id, 0); > } > > -struct iommufd_object *_iommufd_object_alloc(struct iommufd_ctx *ictx, > -

[PATCH v3 02/11] iommufd: Rename _iommufd_object_alloc to iommufd_object_alloc_elm

2024-10-09 Thread Nicolin Chen
Currently, the object allocation function calls: level-0: iommufd_object_alloc() level-1: __iommufd_object_alloc() level-2: _iommufd_object_alloc() So the level-1 and level-2 look inverted. The level-1 allocator is a container_of converter with a pointer sanity, backing the level-0 al