aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma/uverbs_ioctl.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/rdma/uverbs_ioctl.h')
-rw-r--r--include/rdma/uverbs_ioctl.h10
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);