Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8313c10f authored by Jason Gunthorpe's avatar Jason Gunthorpe
Browse files

RDMA/uverbs: Replace ib_uverbs_file with uverbs_attr_bundle for write



Now that we can add meta-data to the description of write() methods we
need to pass the uverbs_attr_bundle into all write based handlers so
future patches can use it as a container for any new data transferred out
of the core.

This is the first step to bringing the write() and ioctl() methods to a
common interface signature.

This is a simple search/replace, and we push the attr down into the uobj
and other APIs to keep changes minimal.

Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
parent 1b09577b
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -224,12 +224,14 @@ int uobj_destroy(struct ib_uobject *uobj)
 * uverbs_put_destroy.
 */
struct ib_uobject *__uobj_get_destroy(const struct uverbs_api_object *obj,
				      u32 id, struct ib_uverbs_file *ufile)
				      u32 id,
				      const struct uverbs_attr_bundle *attrs)
{
	struct ib_uobject *uobj;
	int ret;

	uobj = rdma_lookup_get_uobject(obj, ufile, id, UVERBS_LOOKUP_DESTROY);
	uobj = rdma_lookup_get_uobject(obj, attrs->ufile, id,
				       UVERBS_LOOKUP_DESTROY);
	if (IS_ERR(uobj))
		return uobj;

@@ -248,11 +250,12 @@ struct ib_uobject *__uobj_get_destroy(const struct uverbs_api_object *obj,
 * the uobj.
 */
int __uobj_perform_destroy(const struct uverbs_api_object *obj, u32 id,
			   struct ib_uverbs_file *ufile, int success_res)
			   const struct uverbs_attr_bundle *attrs,
			   int success_res)
{
	struct ib_uobject *uobj;

	uobj = __uobj_get_destroy(obj, id, ufile);
	uobj = __uobj_get_destroy(obj, id, attrs);
	if (IS_ERR(uobj))
		return PTR_ERR(uobj);

@@ -267,7 +270,7 @@ static struct ib_uobject *alloc_uobj(struct ib_uverbs_file *ufile,
	struct ib_uobject *uobj;
	struct ib_ucontext *ucontext;

	ucontext = ib_uverbs_get_ucontext(ufile);
	ucontext = ib_uverbs_get_ucontext_file(ufile);
	if (IS_ERR(ucontext))
		return ERR_CAST(ucontext);

+4 −4
Original line number Diff line number Diff line
@@ -137,10 +137,10 @@ struct uverbs_api_ioctl_method {
};

struct uverbs_api_write_method {
	ssize_t (*handler)(struct ib_uverbs_file *file, const char __user *buf,
			   int in_len, int out_len);
	int (*handler_ex)(struct ib_uverbs_file *file, struct ib_udata *ucore,
			  struct ib_udata *uhw);
	ssize_t (*handler)(struct uverbs_attr_bundle *attrs,
			   const char __user *buf, int in_len, int out_len);
	int (*handler_ex)(struct uverbs_attr_bundle *attrs,
			  struct ib_udata *ucore, struct ib_udata *uhw);
	u8 disabled:1;
	u8 is_ex:1;
};
Loading