From: Sean Hefty Date: Wed, 17 Oct 2012 00:49:27 +0000 (-0700) Subject: Refresh of verbs-ext X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=997dfec5ba1c5dd7f0b95290810168301825ff73;p=~shefty%2Flibibverbs.git Refresh of verbs-ext --- diff --git a/include/infiniband/verbs.h b/include/infiniband/verbs.h index b196b83..e4361aa 100644 --- a/include/infiniband/verbs.h +++ b/include/infiniband/verbs.h @@ -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) {