Whamcloud - gitweb
LU-13004 ptlrpc: simplify bd_vec access.
[fs/lustre-release.git] / lustre / ptlrpc / gss / gss_bulk.c
index 69525ec..59fbd21 100644 (file)
@@ -23,7 +23,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2014, 2015, Intel Corporation.
+ * Copyright (c) 2015, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -46,7 +46,6 @@
 #include <obd.h>
 #include <obd_class.h>
 #include <obd_support.h>
-#include <lustre/lustre_idl.h>
 #include <lustre_net.h>
 #include <lustre_import.h>
 #include <lustre_sec.h>
@@ -70,7 +69,6 @@ int gss_cli_ctx_wrap_bulk(struct ptlrpc_cli_ctx *ctx,
 
        LASSERT(req->rq_pack_bulk);
        LASSERT(req->rq_bulk_read || req->rq_bulk_write);
-       LASSERT(ptlrpc_is_bulk_desc_kiov(desc->bd_type));
 
        gctx = container_of(ctx, struct gss_cli_ctx, gc_base);
        LASSERT(gctx->gc_mechctx);
@@ -128,7 +126,7 @@ int gss_cli_ctx_wrap_bulk(struct ptlrpc_cli_ctx *ctx,
 
                        maj = lgss_get_mic(gctx->gc_mechctx, 0, NULL,
                                           desc->bd_iov_count,
-                                          GET_KIOV(desc),
+                                          desc->bd_vec,
                                           &token);
                        if (maj != GSS_S_COMPLETE) {
                                CWARN("failed to sign bulk data: %x\n", maj);
@@ -175,7 +173,6 @@ int gss_cli_ctx_unwrap_bulk(struct ptlrpc_cli_ctx *ctx,
 
         LASSERT(req->rq_pack_bulk);
         LASSERT(req->rq_bulk_read || req->rq_bulk_write);
-       LASSERT(ptlrpc_is_bulk_desc_kiov(desc->bd_type));
 
         switch (SPTLRPC_FLVR_SVC(req->rq_flvr.sf_rpc)) {
         case SPTLRPC_SVC_NULL:
@@ -254,12 +251,12 @@ int gss_cli_ctx_unwrap_bulk(struct ptlrpc_cli_ctx *ctx,
 
                        /* fix the actual data size */
                        for (i = 0, nob = 0; i < desc->bd_iov_count; i++) {
-                               if (BD_GET_KIOV(desc, i).kiov_len + nob >
+                               if (desc->bd_vec[i].kiov_len + nob >
                                    desc->bd_nob_transferred) {
-                                       BD_GET_KIOV(desc, i).kiov_len =
+                                       desc->bd_vec[i].kiov_len =
                                                desc->bd_nob_transferred - nob;
                                }
-                               nob += BD_GET_KIOV(desc, i).kiov_len;
+                               nob += desc->bd_vec[i].kiov_len;
                        }
 
                        token.data = bsdv->bsd_data;
@@ -268,7 +265,7 @@ int gss_cli_ctx_unwrap_bulk(struct ptlrpc_cli_ctx *ctx,
 
                        maj = lgss_verify_mic(gctx->gc_mechctx, 0, NULL,
                                              desc->bd_iov_count,
-                                             GET_KIOV(desc),
+                                             desc->bd_vec,
                                              &token);
                         if (maj != GSS_S_COMPLETE) {
                                 CERROR("failed to verify bulk read: %x\n", maj);
@@ -379,7 +376,6 @@ int gss_svc_unwrap_bulk(struct ptlrpc_request *req,
         LASSERT(req->rq_svc_ctx);
         LASSERT(req->rq_pack_bulk);
         LASSERT(req->rq_bulk_write);
-       LASSERT(ptlrpc_is_bulk_desc_kiov(desc->bd_type));
 
         grctx = gss_svc_ctx2reqctx(req->rq_svc_ctx);
 
@@ -404,7 +400,7 @@ int gss_svc_unwrap_bulk(struct ptlrpc_request *req,
 
                maj = lgss_verify_mic(grctx->src_ctx->gsc_mechctx, 0, NULL,
                                      desc->bd_iov_count,
-                                     GET_KIOV(desc), &token);
+                                     desc->bd_vec, &token);
                 if (maj != GSS_S_COMPLETE) {
                         bsdv->bsd_flags |= BSD_FL_ERR;
                         CERROR("failed to verify bulk signature: %x\n", maj);
@@ -457,7 +453,6 @@ int gss_svc_wrap_bulk(struct ptlrpc_request *req,
         LASSERT(req->rq_svc_ctx);
         LASSERT(req->rq_pack_bulk);
         LASSERT(req->rq_bulk_read);
-       LASSERT(ptlrpc_is_bulk_desc_kiov(desc->bd_type));
 
         grctx = gss_svc_ctx2reqctx(req->rq_svc_ctx);
 
@@ -482,7 +477,7 @@ int gss_svc_wrap_bulk(struct ptlrpc_request *req,
 
                maj = lgss_get_mic(grctx->src_ctx->gsc_mechctx, 0, NULL,
                                   desc->bd_iov_count,
-                                  GET_KIOV(desc), &token);
+                                  desc->bd_vec, &token);
                if (maj != GSS_S_COMPLETE) {
                         bsdv->bsd_flags |= BSD_FL_ERR;
                         CERROR("failed to sign bulk data: %x\n", maj);