diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2018-11-25 20:51:13 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-11-26 16:48:07 -0700 |
commit | 8313c10fa8be032fccc1e757bccc21207f533127 (patch) | |
tree | 83df5841953b27023aa65ab8a6b5ed790dba5765 /include/rdma/uverbs_ioctl.h | |
parent | 1b09577bef3ac135ed02115943c9ab53f2129555 (diff) |
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>
Diffstat (limited to 'include/rdma/uverbs_ioctl.h')
-rw-r--r-- | include/rdma/uverbs_ioctl.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/rdma/uverbs_ioctl.h b/include/rdma/uverbs_ioctl.h index 963dd6b70cde..f744691cd9ae 100644 --- a/include/rdma/uverbs_ioctl.h +++ b/include/rdma/uverbs_ioctl.h @@ -368,10 +368,10 @@ struct uapi_definition { union { bool (*func_is_supported)(struct ib_device *device); - ssize_t (*func_write)(struct ib_uverbs_file *file, + ssize_t (*func_write)(struct uverbs_attr_bundle *attrs, const char __user *buf, int in_len, int out_len); - int (*func_write_ex)(struct ib_uverbs_file *file, + int (*func_write_ex)(struct uverbs_attr_bundle *attrs, struct ib_udata *ucore, struct ib_udata *uhw); const struct uapi_definition *chain; @@ -806,6 +806,12 @@ static inline int _uverbs_copy_from_or_zero(void *to, #define uverbs_copy_from_or_zero(to, attrs_bundle, idx) \ _uverbs_copy_from_or_zero(to, attrs_bundle, idx, sizeof(*to)) +static inline struct ib_ucontext * +ib_uverbs_get_ucontext(const struct uverbs_attr_bundle *attrs) +{ + return ib_uverbs_get_ucontext_file(attrs->ufile); +} + #if IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS) int uverbs_get_flags64(u64 *to, const struct uverbs_attr_bundle *attrs_bundle, size_t idx, u64 allowed_bits); |