sunrpc: move rq_splice_ok flag into rq_flags
authorJeff Layton <jlayton@primarydata.com>
Wed, 19 Nov 2014 12:51:18 +0000 (07:51 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 9 Dec 2014 16:22:21 +0000 (11:22 -0500)
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4proc.c
fs/nfsd/nfs4xdr.c
fs/nfsd/vfs.c
include/linux/sunrpc/svc.h
include/trace/events/sunrpc.h
net/sunrpc/auth_gss/svcauth_gss.c
net/sunrpc/svc.c

index 6f98393..ac71d13 100644 (file)
@@ -773,7 +773,7 @@ nfsd4_read(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
         * the client wants us to do more in this compound:
         */
        if (!nfsd4_last_compound_op(rqstp))
-               rqstp->rq_splice_ok = false;
+               clear_bit(RQ_SPLICE_OK, &rqstp->rq_flags);
 
        /* check stateid */
        if ((status = nfs4_preprocess_stateid_op(SVC_NET(rqstp),
index 0622d4f..8880ec8 100644 (file)
@@ -1731,7 +1731,7 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
        argp->rqstp->rq_cachetype = cachethis ? RC_REPLBUFF : RC_NOCACHE;
 
        if (readcount > 1 || max_reply > PAGE_SIZE - auth_slack)
-               argp->rqstp->rq_splice_ok = false;
+               clear_bit(RQ_SPLICE_OK, &argp->rqstp->rq_flags);
 
        DECODE_TAIL;
 }
@@ -3253,10 +3253,10 @@ nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr,
 
        p = xdr_reserve_space(xdr, 8); /* eof flag and byte count */
        if (!p) {
-               WARN_ON_ONCE(resp->rqstp->rq_splice_ok);
+               WARN_ON_ONCE(test_bit(RQ_SPLICE_OK, &resp->rqstp->rq_flags));
                return nfserr_resource;
        }
-       if (resp->xdr.buf->page_len && resp->rqstp->rq_splice_ok) {
+       if (resp->xdr.buf->page_len && test_bit(RQ_SPLICE_OK, &resp->rqstp->rq_flags)) {
                WARN_ON_ONCE(1);
                return nfserr_resource;
        }
@@ -3273,7 +3273,7 @@ nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr,
                        goto err_truncate;
        }
 
-       if (file->f_op->splice_read && resp->rqstp->rq_splice_ok)
+       if (file->f_op->splice_read && test_bit(RQ_SPLICE_OK, &resp->rqstp->rq_flags))
                err = nfsd4_encode_splice_read(resp, read, file, maxcount);
        else
                err = nfsd4_encode_readv(resp, read, file, maxcount);
index 60c2585..cb00e48 100644 (file)
@@ -902,7 +902,7 @@ static __be32
 nfsd_vfs_read(struct svc_rqst *rqstp, struct file *file,
              loff_t offset, struct kvec *vec, int vlen, unsigned long *count)
 {
-       if (file->f_op->splice_read && rqstp->rq_splice_ok)
+       if (file->f_op->splice_read && test_bit(RQ_SPLICE_OK, &rqstp->rq_flags))
                return nfsd_splice_read(rqstp, file, offset, count);
        else
                return nfsd_readv(file, offset, vec, vlen, count);
index d4ea3e5..2714287 100644 (file)
@@ -256,6 +256,9 @@ struct svc_rqst {
 #define        RQ_LOCAL        (1)                     /* local request */
 #define        RQ_USEDEFERRAL  (2)                     /* use deferral */
 #define        RQ_DROPME       (3)                     /* drop current reply */
+#define        RQ_SPLICE_OK    (4)                     /* turned off in gss privacy
+                                                * to prevent encrypting page
+                                                * cache pages */
        unsigned long           rq_flags;       /* flags field */
 
        void *                  rq_argp;        /* decoded arguments */
@@ -277,9 +280,6 @@ struct svc_rqst {
        struct auth_domain *    rq_gssclient;   /* "gss/"-style peer info */
        int                     rq_cachetype;
        struct svc_cacherep *   rq_cacherep;    /* cache info */
-       bool                    rq_splice_ok;   /* turned off in gss privacy
-                                                * to prevent encrypting page
-                                                * cache pages */
        struct task_struct      *rq_task;       /* service thread */
 };
 
index 355671f..5848fc2 100644 (file)
@@ -417,7 +417,8 @@ TRACE_EVENT(xs_tcp_data_recv,
                { (1UL << RQ_SECURE),           "RQ_SECURE"},           \
                { (1UL << RQ_LOCAL),            "RQ_LOCAL"},            \
                { (1UL << RQ_USEDEFERRAL),      "RQ_USEDEFERRAL"},      \
-               { (1UL << RQ_DROPME),           "RQ_DROPME"})
+               { (1UL << RQ_DROPME),           "RQ_DROPME"},           \
+               { (1UL << RQ_SPLICE_OK),        "RQ_SPLICE_OK"})
 
 TRACE_EVENT(svc_recv,
        TP_PROTO(struct svc_rqst *rqst, int status),
index de856dd..224a82f 100644 (file)
@@ -886,7 +886,7 @@ unwrap_priv_data(struct svc_rqst *rqstp, struct xdr_buf *buf, u32 seq, struct gs
        u32 priv_len, maj_stat;
        int pad, saved_len, remaining_len, offset;
 
-       rqstp->rq_splice_ok = false;
+       clear_bit(RQ_SPLICE_OK, &rqstp->rq_flags);
 
        priv_len = svc_getnl(&buf->head[0]);
        if (rqstp->rq_deferred) {
index d8a9d60..2c1c49e 100644 (file)
@@ -1088,7 +1088,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
                goto err_short_len;
 
        /* Will be turned off only in gss privacy case: */
-       rqstp->rq_splice_ok = true;
+       set_bit(RQ_SPLICE_OK, &rqstp->rq_flags);
        /* Will be turned off only when NFSv4 Sessions are used */
        set_bit(RQ_USEDEFERRAL, &rqstp->rq_flags);
        clear_bit(RQ_DROPME, &rqstp->rq_flags);