diff options
author | Jeff Layton <jlayton@primarydata.com> | 2014-11-19 07:51:18 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-12-09 11:22:21 -0500 |
commit | 779fb0f3af3089daa2e88cf8ef0ef0c5d2fecb40 (patch) | |
tree | d16a4b46bc75018d45c4304f1fbf74721d7bb4de | |
parent | 78b65eb3fda95c6d131c4bbb0536e21f0bd7a7d4 (diff) |
sunrpc: move rq_splice_ok flag into rq_flags
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r-- | fs/nfsd/nfs4proc.c | 2 | ||||
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 8 | ||||
-rw-r--r-- | fs/nfsd/vfs.c | 2 | ||||
-rw-r--r-- | include/linux/sunrpc/svc.h | 6 | ||||
-rw-r--r-- | include/trace/events/sunrpc.h | 3 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/svcauth_gss.c | 2 | ||||
-rw-r--r-- | net/sunrpc/svc.c | 2 |
7 files changed, 13 insertions, 12 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 6f98393ad0d9..ac71d13c69ef 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -773,7 +773,7 @@ nfsd4_read(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
773 | * the client wants us to do more in this compound: | 773 | * the client wants us to do more in this compound: |
774 | */ | 774 | */ |
775 | if (!nfsd4_last_compound_op(rqstp)) | 775 | if (!nfsd4_last_compound_op(rqstp)) |
776 | rqstp->rq_splice_ok = false; | 776 | clear_bit(RQ_SPLICE_OK, &rqstp->rq_flags); |
777 | 777 | ||
778 | /* check stateid */ | 778 | /* check stateid */ |
779 | if ((status = nfs4_preprocess_stateid_op(SVC_NET(rqstp), | 779 | if ((status = nfs4_preprocess_stateid_op(SVC_NET(rqstp), |
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 0622d4f4a9a2..8880ec8cfd11 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -1731,7 +1731,7 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp) | |||
1731 | argp->rqstp->rq_cachetype = cachethis ? RC_REPLBUFF : RC_NOCACHE; | 1731 | argp->rqstp->rq_cachetype = cachethis ? RC_REPLBUFF : RC_NOCACHE; |
1732 | 1732 | ||
1733 | if (readcount > 1 || max_reply > PAGE_SIZE - auth_slack) | 1733 | if (readcount > 1 || max_reply > PAGE_SIZE - auth_slack) |
1734 | argp->rqstp->rq_splice_ok = false; | 1734 | clear_bit(RQ_SPLICE_OK, &argp->rqstp->rq_flags); |
1735 | 1735 | ||
1736 | DECODE_TAIL; | 1736 | DECODE_TAIL; |
1737 | } | 1737 | } |
@@ -3253,10 +3253,10 @@ nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr, | |||
3253 | 3253 | ||
3254 | p = xdr_reserve_space(xdr, 8); /* eof flag and byte count */ | 3254 | p = xdr_reserve_space(xdr, 8); /* eof flag and byte count */ |
3255 | if (!p) { | 3255 | if (!p) { |
3256 | WARN_ON_ONCE(resp->rqstp->rq_splice_ok); | 3256 | WARN_ON_ONCE(test_bit(RQ_SPLICE_OK, &resp->rqstp->rq_flags)); |
3257 | return nfserr_resource; | 3257 | return nfserr_resource; |
3258 | } | 3258 | } |
3259 | if (resp->xdr.buf->page_len && resp->rqstp->rq_splice_ok) { | 3259 | if (resp->xdr.buf->page_len && test_bit(RQ_SPLICE_OK, &resp->rqstp->rq_flags)) { |
3260 | WARN_ON_ONCE(1); | 3260 | WARN_ON_ONCE(1); |
3261 | return nfserr_resource; | 3261 | return nfserr_resource; |
3262 | } | 3262 | } |
@@ -3273,7 +3273,7 @@ nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr, | |||
3273 | goto err_truncate; | 3273 | goto err_truncate; |
3274 | } | 3274 | } |
3275 | 3275 | ||
3276 | if (file->f_op->splice_read && resp->rqstp->rq_splice_ok) | 3276 | if (file->f_op->splice_read && test_bit(RQ_SPLICE_OK, &resp->rqstp->rq_flags)) |
3277 | err = nfsd4_encode_splice_read(resp, read, file, maxcount); | 3277 | err = nfsd4_encode_splice_read(resp, read, file, maxcount); |
3278 | else | 3278 | else |
3279 | err = nfsd4_encode_readv(resp, read, file, maxcount); | 3279 | err = nfsd4_encode_readv(resp, read, file, maxcount); |
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 60c25850fb16..cb00e48bc2b0 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -902,7 +902,7 @@ static __be32 | |||
902 | nfsd_vfs_read(struct svc_rqst *rqstp, struct file *file, | 902 | nfsd_vfs_read(struct svc_rqst *rqstp, struct file *file, |
903 | loff_t offset, struct kvec *vec, int vlen, unsigned long *count) | 903 | loff_t offset, struct kvec *vec, int vlen, unsigned long *count) |
904 | { | 904 | { |
905 | if (file->f_op->splice_read && rqstp->rq_splice_ok) | 905 | if (file->f_op->splice_read && test_bit(RQ_SPLICE_OK, &rqstp->rq_flags)) |
906 | return nfsd_splice_read(rqstp, file, offset, count); | 906 | return nfsd_splice_read(rqstp, file, offset, count); |
907 | else | 907 | else |
908 | return nfsd_readv(file, offset, vec, vlen, count); | 908 | return nfsd_readv(file, offset, vec, vlen, count); |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index d4ea3e5246b0..2714287fc4f6 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -256,6 +256,9 @@ struct svc_rqst { | |||
256 | #define RQ_LOCAL (1) /* local request */ | 256 | #define RQ_LOCAL (1) /* local request */ |
257 | #define RQ_USEDEFERRAL (2) /* use deferral */ | 257 | #define RQ_USEDEFERRAL (2) /* use deferral */ |
258 | #define RQ_DROPME (3) /* drop current reply */ | 258 | #define RQ_DROPME (3) /* drop current reply */ |
259 | #define RQ_SPLICE_OK (4) /* turned off in gss privacy | ||
260 | * to prevent encrypting page | ||
261 | * cache pages */ | ||
259 | unsigned long rq_flags; /* flags field */ | 262 | unsigned long rq_flags; /* flags field */ |
260 | 263 | ||
261 | void * rq_argp; /* decoded arguments */ | 264 | void * rq_argp; /* decoded arguments */ |
@@ -277,9 +280,6 @@ struct svc_rqst { | |||
277 | struct auth_domain * rq_gssclient; /* "gss/"-style peer info */ | 280 | struct auth_domain * rq_gssclient; /* "gss/"-style peer info */ |
278 | int rq_cachetype; | 281 | int rq_cachetype; |
279 | struct svc_cacherep * rq_cacherep; /* cache info */ | 282 | struct svc_cacherep * rq_cacherep; /* cache info */ |
280 | bool rq_splice_ok; /* turned off in gss privacy | ||
281 | * to prevent encrypting page | ||
282 | * cache pages */ | ||
283 | struct task_struct *rq_task; /* service thread */ | 283 | struct task_struct *rq_task; /* service thread */ |
284 | }; | 284 | }; |
285 | 285 | ||
diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h index 355671f19a9f..5848fc235869 100644 --- a/include/trace/events/sunrpc.h +++ b/include/trace/events/sunrpc.h | |||
@@ -417,7 +417,8 @@ TRACE_EVENT(xs_tcp_data_recv, | |||
417 | { (1UL << RQ_SECURE), "RQ_SECURE"}, \ | 417 | { (1UL << RQ_SECURE), "RQ_SECURE"}, \ |
418 | { (1UL << RQ_LOCAL), "RQ_LOCAL"}, \ | 418 | { (1UL << RQ_LOCAL), "RQ_LOCAL"}, \ |
419 | { (1UL << RQ_USEDEFERRAL), "RQ_USEDEFERRAL"}, \ | 419 | { (1UL << RQ_USEDEFERRAL), "RQ_USEDEFERRAL"}, \ |
420 | { (1UL << RQ_DROPME), "RQ_DROPME"}) | 420 | { (1UL << RQ_DROPME), "RQ_DROPME"}, \ |
421 | { (1UL << RQ_SPLICE_OK), "RQ_SPLICE_OK"}) | ||
421 | 422 | ||
422 | TRACE_EVENT(svc_recv, | 423 | TRACE_EVENT(svc_recv, |
423 | TP_PROTO(struct svc_rqst *rqst, int status), | 424 | TP_PROTO(struct svc_rqst *rqst, int status), |
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index de856ddf5fed..224a82f24d3c 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c | |||
@@ -886,7 +886,7 @@ unwrap_priv_data(struct svc_rqst *rqstp, struct xdr_buf *buf, u32 seq, struct gs | |||
886 | u32 priv_len, maj_stat; | 886 | u32 priv_len, maj_stat; |
887 | int pad, saved_len, remaining_len, offset; | 887 | int pad, saved_len, remaining_len, offset; |
888 | 888 | ||
889 | rqstp->rq_splice_ok = false; | 889 | clear_bit(RQ_SPLICE_OK, &rqstp->rq_flags); |
890 | 890 | ||
891 | priv_len = svc_getnl(&buf->head[0]); | 891 | priv_len = svc_getnl(&buf->head[0]); |
892 | if (rqstp->rq_deferred) { | 892 | if (rqstp->rq_deferred) { |
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index d8a9d603b786..2c1c49ebd84d 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
@@ -1088,7 +1088,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv) | |||
1088 | goto err_short_len; | 1088 | goto err_short_len; |
1089 | 1089 | ||
1090 | /* Will be turned off only in gss privacy case: */ | 1090 | /* Will be turned off only in gss privacy case: */ |
1091 | rqstp->rq_splice_ok = true; | 1091 | set_bit(RQ_SPLICE_OK, &rqstp->rq_flags); |
1092 | /* Will be turned off only when NFSv4 Sessions are used */ | 1092 | /* Will be turned off only when NFSv4 Sessions are used */ |
1093 | set_bit(RQ_USEDEFERRAL, &rqstp->rq_flags); | 1093 | set_bit(RQ_USEDEFERRAL, &rqstp->rq_flags); |
1094 | clear_bit(RQ_DROPME, &rqstp->rq_flags); | 1094 | clear_bit(RQ_DROPME, &rqstp->rq_flags); |