diff options
author | Jason Gunthorpe <jgg@nvidia.com> | 2023-08-15 10:01:26 -0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2023-08-15 10:01:26 -0300 |
commit | a35762dd14adb952442e487d8dad4bb50b614b2b (patch) | |
tree | 4d21de11837f293860db8abbea8db161f1018edb /drivers/iommu/iommufd/iommufd_private.h | |
parent | 23a1b46f15d57583927742738579363f179942b1 (diff) | |
parent | 2ccdd1b13c591d306f0401d98dedc4bdcd02b421 (diff) |
Merge tag 'v6.5-rc6' into iommufd for-next
Required for following patches.
Resolve merge conflict by using the hunk from the for-next branch and
shifting the iommufd_object_deref_user() into iommufd_hw_pagetable_put()
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/iommu/iommufd/iommufd_private.h')
-rw-r--r-- | drivers/iommu/iommufd/iommufd_private.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/iommu/iommufd/iommufd_private.h b/drivers/iommu/iommufd/iommufd_private.h index d82986ad10ae..15596a08a057 100644 --- a/drivers/iommu/iommufd/iommufd_private.h +++ b/drivers/iommu/iommufd/iommufd_private.h @@ -177,8 +177,19 @@ void iommufd_object_abort_and_destroy(struct iommufd_ctx *ictx, struct iommufd_object *obj); void iommufd_object_finalize(struct iommufd_ctx *ictx, struct iommufd_object *obj); -bool iommufd_object_destroy_user(struct iommufd_ctx *ictx, - struct iommufd_object *obj); +void __iommufd_object_destroy_user(struct iommufd_ctx *ictx, + struct iommufd_object *obj, bool allow_fail); +static inline void iommufd_object_destroy_user(struct iommufd_ctx *ictx, + struct iommufd_object *obj) +{ + __iommufd_object_destroy_user(ictx, obj, false); +} +static inline void iommufd_object_deref_user(struct iommufd_ctx *ictx, + struct iommufd_object *obj) +{ + __iommufd_object_destroy_user(ictx, obj, true); +} + struct iommufd_object *_iommufd_object_alloc(struct iommufd_ctx *ictx, size_t size, enum iommufd_object_type type); @@ -269,7 +280,7 @@ static inline void iommufd_hw_pagetable_put(struct iommufd_ctx *ictx, { lockdep_assert_not_held(&hwpt->ioas->mutex); if (hwpt->auto_domain) - iommufd_object_destroy_user(ictx, &hwpt->obj); + iommufd_object_deref_user(ictx, &hwpt->obj); else refcount_dec(&hwpt->obj.users); } |