]> git.openfabrics.org - ~shefty/libibverbs.git/commitdiff
Refresh of verbs-ext
authorSean Hefty <sean.hefty@intel.com>
Wed, 17 Oct 2012 00:49:27 +0000 (17:49 -0700)
committerSean Hefty <sean.hefty@intel.com>
Wed, 17 Oct 2012 00:49:27 +0000 (17:49 -0700)
include/infiniband/verbs.h

index b196b83132b6effddaa58130c64869d86f8e8b1a..e4361aae9063fa4ad0d51982ebb0c87da0a20175 100644 (file)
@@ -745,6 +745,11 @@ static inline struct verbs_context *verbs_get_ctx(
                NULL : container_of(ctx, struct verbs_context, context);
 }
 
+#define verbs_get_ctx_op(ctx, op) ({ \
+       struct verbs_context *vctx = verbs_get_ctx(ctx); \
+       (!vctx || (vctx->sz < sizeof(*vctx) - offsetof(struct verbs_context, op)) || \
+        !vctx->op) ? NULL : vctx; })
+
 static inline struct verbs_device *verbs_get_device(
                                        const struct ibv_device *dev)
 {