These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / staging / lustre / lustre / ptlrpc / sec_null.c
index 4e13243..ebfa609 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_SEC
 
-
 #include "../include/obd_support.h"
 #include "../include/obd_cksum.h"
 #include "../include/obd_class.h"
 #include "../include/lustre_net.h"
 #include "../include/lustre_sec.h"
 
+#include "ptlrpc_internal.h"
+
 static struct ptlrpc_sec_policy null_policy;
 static struct ptlrpc_sec       null_sec;
 static struct ptlrpc_cli_ctx    null_cli_ctx;
@@ -82,6 +83,7 @@ int null_ctx_sign(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
 
        if (!req->rq_import->imp_dlm_fake) {
                struct obd_device *obd = req->rq_import->imp_obd;
+
                null_encode_sec_part(req->rq_reqbuf,
                                     obd->u.cli.cl_sp_me);
        }
@@ -92,7 +94,7 @@ int null_ctx_sign(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
 static
 int null_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
 {
-       __u32   cksums, cksumc;
+       __u32 cksums, cksumc;
 
        LASSERT(req->rq_repdata);
 
@@ -159,7 +161,7 @@ int null_alloc_reqbuf(struct ptlrpc_sec *sec,
                int alloc_size = size_roundup_power2(msgsize);
 
                LASSERT(!req->rq_pool);
-               OBD_ALLOC_LARGE(req->rq_reqbuf, alloc_size);
+               req->rq_reqbuf = libcfs_kvzalloc(alloc_size, GFP_NOFS);
                if (!req->rq_reqbuf)
                        return -ENOMEM;
 
@@ -186,7 +188,7 @@ void null_free_reqbuf(struct ptlrpc_sec *sec,
                         "req %p: reqlen %d should smaller than buflen %d\n",
                         req, req->rq_reqlen, req->rq_reqbuf_len);
 
-               OBD_FREE_LARGE(req->rq_reqbuf, req->rq_reqbuf_len);
+               kvfree(req->rq_reqbuf);
                req->rq_reqbuf = NULL;
                req->rq_reqbuf_len = 0;
        }
@@ -202,7 +204,7 @@ int null_alloc_repbuf(struct ptlrpc_sec *sec,
 
        msgsize = size_roundup_power2(msgsize);
 
-       OBD_ALLOC_LARGE(req->rq_repbuf, msgsize);
+       req->rq_repbuf = libcfs_kvzalloc(msgsize, GFP_NOFS);
        if (!req->rq_repbuf)
                return -ENOMEM;
 
@@ -216,7 +218,7 @@ void null_free_repbuf(struct ptlrpc_sec *sec,
 {
        LASSERT(req->rq_repbuf);
 
-       OBD_FREE_LARGE(req->rq_repbuf, req->rq_repbuf_len);
+       kvfree(req->rq_repbuf);
        req->rq_repbuf = NULL;
        req->rq_repbuf_len = 0;
 }
@@ -226,9 +228,9 @@ int null_enlarge_reqbuf(struct ptlrpc_sec *sec,
                        struct ptlrpc_request *req,
                        int segment, int newsize)
 {
-       struct lustre_msg      *newbuf;
-       struct lustre_msg      *oldbuf = req->rq_reqmsg;
-       int                  oldsize, newmsg_size, alloc_size;
+       struct lustre_msg *newbuf;
+       struct lustre_msg *oldbuf = req->rq_reqmsg;
+       int oldsize, newmsg_size, alloc_size;
 
        LASSERT(req->rq_reqbuf);
        LASSERT(req->rq_reqbuf == req->rq_reqmsg);
@@ -247,7 +249,7 @@ int null_enlarge_reqbuf(struct ptlrpc_sec *sec,
        if (req->rq_reqbuf_len < newmsg_size) {
                alloc_size = size_roundup_power2(newmsg_size);
 
-               OBD_ALLOC_LARGE(newbuf, alloc_size);
+               newbuf = libcfs_kvzalloc(alloc_size, GFP_NOFS);
                if (newbuf == NULL)
                        return -ENOMEM;
 
@@ -261,7 +263,7 @@ int null_enlarge_reqbuf(struct ptlrpc_sec *sec,
                        spin_lock(&req->rq_import->imp_lock);
                memcpy(newbuf, req->rq_reqbuf, req->rq_reqlen);
 
-               OBD_FREE_LARGE(req->rq_reqbuf, req->rq_reqbuf_len);
+               kvfree(req->rq_reqbuf);
                req->rq_reqbuf = req->rq_reqmsg = newbuf;
                req->rq_reqbuf_len = alloc_size;
 
@@ -316,7 +318,7 @@ int null_alloc_rs(struct ptlrpc_request *req, int msgsize)
                /* pre-allocated */
                LASSERT(rs->rs_size >= rs_size);
        } else {
-               OBD_ALLOC_LARGE(rs, rs_size);
+               rs = libcfs_kvzalloc(rs_size, GFP_NOFS);
                if (rs == NULL)
                        return -ENOMEM;
 
@@ -341,7 +343,7 @@ void null_free_rs(struct ptlrpc_reply_state *rs)
        atomic_dec(&rs->rs_svc_ctx->sc_refcount);
 
        if (!rs->rs_prealloc)
-               OBD_FREE_LARGE(rs, rs->rs_size);
+               kvfree(rs);
 }
 
 static