Skip to content

Commit 8313c10

Browse files
committed
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: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
1 parent 1b09577 commit 8313c10

9 files changed

Lines changed: 208 additions & 192 deletions

File tree

‎drivers/infiniband/core/rdma_core.c‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,14 @@ int uobj_destroy(struct ib_uobject *uobj)
224224
* uverbs_put_destroy.
225225
*/
226226
struct ib_uobject *__uobj_get_destroy(const struct uverbs_api_object *obj,
227-
u32 id, struct ib_uverbs_file *ufile)
227+
u32 id,
228+
const struct uverbs_attr_bundle *attrs)
228229
{
229230
struct ib_uobject *uobj;
230231
int ret;
231232

232-
uobj = rdma_lookup_get_uobject(obj, ufile, id, UVERBS_LOOKUP_DESTROY);
233+
uobj = rdma_lookup_get_uobject(obj, attrs->ufile, id,
234+
UVERBS_LOOKUP_DESTROY);
233235
if (IS_ERR(uobj))
234236
return uobj;
235237

@@ -248,11 +250,12 @@ struct ib_uobject *__uobj_get_destroy(const struct uverbs_api_object *obj,
248250
* the uobj.
249251
*/
250252
int __uobj_perform_destroy(const struct uverbs_api_object *obj, u32 id,
251-
struct ib_uverbs_file *ufile, int success_res)
253+
const struct uverbs_attr_bundle *attrs,
254+
int success_res)
252255
{
253256
struct ib_uobject *uobj;
254257

255-
uobj = __uobj_get_destroy(obj, id, ufile);
258+
uobj = __uobj_get_destroy(obj, id, attrs);
256259
if (IS_ERR(uobj))
257260
return PTR_ERR(uobj);
258261

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

270-
ucontext = ib_uverbs_get_ucontext(ufile);
273+
ucontext = ib_uverbs_get_ucontext_file(ufile);
271274
if (IS_ERR(ucontext))
272275
return ERR_CAST(ucontext);
273276

‎drivers/infiniband/core/rdma_core.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ struct uverbs_api_ioctl_method {
137137
};
138138

139139
struct uverbs_api_write_method {
140-
ssize_t (*handler)(struct ib_uverbs_file *file, const char __user *buf,
141-
int in_len, int out_len);
142-
int (*handler_ex)(struct ib_uverbs_file *file, struct ib_udata *ucore,
143-
struct ib_udata *uhw);
140+
ssize_t (*handler)(struct uverbs_attr_bundle *attrs,
141+
const char __user *buf, int in_len, int out_len);
142+
int (*handler_ex)(struct uverbs_attr_bundle *attrs,
143+
struct ib_udata *ucore, struct ib_udata *uhw);
144144
u8 disabled:1;
145145
u8 is_ex:1;
146146
};

0 commit comments

Comments
 (0)