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

Commit 15a1b4be authored by Jason Gunthorpe's avatar Jason Gunthorpe
Browse files

RDMA/uverbs: Do not pass ib_uverbs_file to ioctl methods



The uverbs_attr_bundle already contains this pointer, and most methods
don't actually need it. Get rid of the redundant function argument.

Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
parent 7106a976
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -125,8 +125,7 @@ struct uverbs_api_object {
};

struct uverbs_api_ioctl_method {
	int (__rcu *handler)(struct ib_uverbs_file *ufile,
			     struct uverbs_attr_bundle *ctx);
	int(__rcu *handler)(struct uverbs_attr_bundle *attrs);
	DECLARE_BITMAP(attr_mandatory, UVERBS_API_ATTR_BKEY_LEN);
	u16 bundle_size;
	u8 use_stack:1;
+3 −4
Original line number Diff line number Diff line
@@ -404,8 +404,7 @@ static int uverbs_set_attr(struct bundle_priv *pbundle,
static int ib_uverbs_run_method(struct bundle_priv *pbundle,
				unsigned int num_attrs)
{
	int (*handler)(struct ib_uverbs_file *ufile,
		       struct uverbs_attr_bundle *ctx);
	int (*handler)(struct uverbs_attr_bundle *attrs);
	size_t uattrs_size = array_size(sizeof(*pbundle->uattrs), num_attrs);
	unsigned int destroy_bkey = pbundle->method_elm->destroy_bkey;
	unsigned int i;
@@ -445,10 +444,10 @@ static int ib_uverbs_run_method(struct bundle_priv *pbundle,
			return ret;
		__clear_bit(destroy_bkey, pbundle->uobj_finalize);

		ret = handler(pbundle->bundle.ufile, &pbundle->bundle);
		ret = handler(&pbundle->bundle);
		uobj_put_destroy(destroy_attr->uobject);
	} else {
		ret = handler(pbundle->bundle.ufile, &pbundle->bundle);
		ret = handler(&pbundle->bundle);
	}

	/*
+1 −2
Original line number Diff line number Diff line
@@ -210,8 +210,7 @@ static int uverbs_hot_unplug_completion_event_file(struct ib_uobject *uobj,
	return 0;
};

int uverbs_destroy_def_handler(struct ib_uverbs_file *file,
			       struct uverbs_attr_bundle *attrs)
int uverbs_destroy_def_handler(struct uverbs_attr_bundle *attrs)
{
	return 0;
}
+2 −2
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ static int uverbs_free_counters(struct ib_uobject *uobject,
}

static int UVERBS_HANDLER(UVERBS_METHOD_COUNTERS_CREATE)(
	struct ib_uverbs_file *file, struct uverbs_attr_bundle *attrs)
	struct uverbs_attr_bundle *attrs)
{
	struct ib_uobject *uobj = uverbs_attr_get_uobject(
		attrs, UVERBS_ATTR_CREATE_COUNTERS_HANDLE);
@@ -82,7 +82,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_COUNTERS_CREATE)(
}

static int UVERBS_HANDLER(UVERBS_METHOD_COUNTERS_READ)(
	struct ib_uverbs_file *file, struct uverbs_attr_bundle *attrs)
	struct uverbs_attr_bundle *attrs)
{
	struct ib_counters_read_attr read_attr = {};
	const struct uverbs_attr *uattr;
+3 −3
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ static int uverbs_free_cq(struct ib_uobject *uobject,
}

static int UVERBS_HANDLER(UVERBS_METHOD_CQ_CREATE)(
	struct ib_uverbs_file *file, struct uverbs_attr_bundle *attrs)
	struct uverbs_attr_bundle *attrs)
{
	struct ib_ucq_object *obj = container_of(
		uverbs_attr_get_uobject(attrs, UVERBS_ATTR_CREATE_CQ_HANDLE),
@@ -101,7 +101,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_CQ_CREATE)(
		uverbs_uobject_get(ev_file_uobj);
	}

	if (attr.comp_vector >= file->device->num_comp_vectors) {
	if (attr.comp_vector >= attrs->ufile->device->num_comp_vectors) {
		ret = -EINVAL;
		goto err_event_file;
	}
@@ -173,7 +173,7 @@ DECLARE_UVERBS_NAMED_METHOD(
	UVERBS_ATTR_UHW());

static int UVERBS_HANDLER(UVERBS_METHOD_CQ_DESTROY)(
	struct ib_uverbs_file *file, struct uverbs_attr_bundle *attrs)
	struct uverbs_attr_bundle *attrs)
{
	struct ib_uobject *uobj =
		uverbs_attr_get_uobject(attrs, UVERBS_ATTR_DESTROY_CQ_HANDLE);
Loading