summaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-09-12 01:01:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-09-12 01:01:44 -0400
commit8e7757d83d07cc77ee2661e9615a2f9f4ce540cd (patch)
treeb6c15efae2c117e7fbbe56ad0aaa2859d1cd35a8 /include/linux/sunrpc
parentdd198ce7141aa8dd9ffcc9549de422fb055508de (diff)
parent1bd5d6d08ea7ed0794c8a3908383d6d6fc202cdd (diff)
Merge tag 'nfs-for-4.14-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client updates from Trond Myklebust: "Hightlights include: Stable bugfixes: - Fix mirror allocation in the writeback code to avoid a use after free - Fix the O_DSYNC writes to use the correct byte range - Fix 2 use after free issues in the I/O code Features: - Writeback fixes to split up the inode->i_lock in order to reduce contention - RPC client receive fixes to reduce the amount of time the xprt->transport_lock is held when receiving data from a socket into am XDR buffer. - Ditto fixes to reduce contention between call side users of the rdma rb_lock, and its use in rpcrdma_reply_handler. - Re-arrange rdma stats to reduce false cacheline sharing. - Various rdma cleanups and optimisations. - Refactor the NFSv4.1 exchange id code and clean up the code. - Const-ify all instances of struct rpc_xprt_ops Bugfixes: - Fix the NFSv2 'sec=' mount option. - NFSv4.1: don't use machine credentials for CLOSE when using 'sec=sys' - Fix the NFSv3 GRANT callback when the port changes on the server. - Fix livelock issues with COMMIT - NFSv4: Use correct inode in _nfs4_opendata_to_nfs4_state() when doing and NFSv4.1 open by filehandle" * tag 'nfs-for-4.14-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (69 commits) NFS: Count the bytes of skipped subrequests in nfs_lock_and_join_requests() NFS: Don't hold the group lock when calling nfs_release_request() NFS: Remove pnfs_generic_transfer_commit_list() NFS: nfs_lock_and_join_requests and nfs_scan_commit_list can deadlock NFS: Fix 2 use after free issues in the I/O code NFS: Sync the correct byte range during synchronous writes lockd: Delete an error message for a failed memory allocation in reclaimer() NFS: remove jiffies field from access cache NFS: flush data when locking a file to ensure cache coherence for mmap. SUNRPC: remove some dead code. NFS: don't expect errors from mempool_alloc(). xprtrdma: Use xprt_pin_rqst in rpcrdma_reply_handler xprtrdma: Re-arrange struct rx_stats NFS: Fix NFSv2 security settings NFSv4.1: don't use machine credentials for CLOSE when using 'sec=sys' SUNRPC: ECONNREFUSED should cause a rebind. NFS: Remove unused parameter gfp_flags from nfs_pageio_init() NFSv4: Fix up mirror allocation SUNRPC: Add a separate spinlock to protect the RPC request receive list SUNRPC: Cleanup xs_tcp_read_common() ...
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r--include/linux/sunrpc/sched.h2
-rw-r--r--include/linux/sunrpc/xdr.h13
-rw-r--r--include/linux/sunrpc/xprt.h5
3 files changed, 19 insertions, 1 deletions
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 50a99a117da7..c1768f9d993b 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -139,6 +139,8 @@ struct rpc_task_setup {
139#define RPC_TASK_RUNNING 0 139#define RPC_TASK_RUNNING 0
140#define RPC_TASK_QUEUED 1 140#define RPC_TASK_QUEUED 1
141#define RPC_TASK_ACTIVE 2 141#define RPC_TASK_ACTIVE 2
142#define RPC_TASK_MSG_RECV 3
143#define RPC_TASK_MSG_RECV_WAIT 4
142 144
143#define RPC_IS_RUNNING(t) test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate) 145#define RPC_IS_RUNNING(t) test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)
144#define rpc_set_running(t) set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate) 146#define rpc_set_running(t) set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index 261b48a2701d..86b59e3525a5 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -239,6 +239,19 @@ extern unsigned int xdr_read_pages(struct xdr_stream *xdr, unsigned int len);
239extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); 239extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len);
240extern int xdr_process_buf(struct xdr_buf *buf, unsigned int offset, unsigned int len, int (*actor)(struct scatterlist *, void *), void *data); 240extern int xdr_process_buf(struct xdr_buf *buf, unsigned int offset, unsigned int len, int (*actor)(struct scatterlist *, void *), void *data);
241 241
242/**
243 * xdr_stream_remaining - Return the number of bytes remaining in the stream
244 * @xdr: pointer to struct xdr_stream
245 *
246 * Return value:
247 * Number of bytes remaining in @xdr before xdr->end
248 */
249static inline size_t
250xdr_stream_remaining(const struct xdr_stream *xdr)
251{
252 return xdr->nwords << 2;
253}
254
242ssize_t xdr_stream_decode_string_dup(struct xdr_stream *xdr, char **str, 255ssize_t xdr_stream_decode_string_dup(struct xdr_stream *xdr, char **str,
243 size_t maxlen, gfp_t gfp_flags); 256 size_t maxlen, gfp_t gfp_flags);
244/** 257/**
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index eab1c749e192..5a7bff41f6b7 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -174,7 +174,7 @@ enum xprt_transports {
174 174
175struct rpc_xprt { 175struct rpc_xprt {
176 struct kref kref; /* Reference count */ 176 struct kref kref; /* Reference count */
177 struct rpc_xprt_ops * ops; /* transport methods */ 177 const struct rpc_xprt_ops *ops; /* transport methods */
178 178
179 const struct rpc_timeout *timeout; /* timeout parms */ 179 const struct rpc_timeout *timeout; /* timeout parms */
180 struct sockaddr_storage addr; /* server address */ 180 struct sockaddr_storage addr; /* server address */
@@ -232,6 +232,7 @@ struct rpc_xprt {
232 */ 232 */
233 spinlock_t transport_lock; /* lock transport info */ 233 spinlock_t transport_lock; /* lock transport info */
234 spinlock_t reserve_lock; /* lock slot table */ 234 spinlock_t reserve_lock; /* lock slot table */
235 spinlock_t recv_lock; /* lock receive list */
235 u32 xid; /* Next XID value to use */ 236 u32 xid; /* Next XID value to use */
236 struct rpc_task * snd_task; /* Task blocked in send */ 237 struct rpc_task * snd_task; /* Task blocked in send */
237 struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ 238 struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */
@@ -372,6 +373,8 @@ void xprt_write_space(struct rpc_xprt *xprt);
372void xprt_adjust_cwnd(struct rpc_xprt *xprt, struct rpc_task *task, int result); 373void xprt_adjust_cwnd(struct rpc_xprt *xprt, struct rpc_task *task, int result);
373struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid); 374struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid);
374void xprt_complete_rqst(struct rpc_task *task, int copied); 375void xprt_complete_rqst(struct rpc_task *task, int copied);
376void xprt_pin_rqst(struct rpc_rqst *req);
377void xprt_unpin_rqst(struct rpc_rqst *req);
375void xprt_release_rqst_cong(struct rpc_task *task); 378void xprt_release_rqst_cong(struct rpc_task *task);
376void xprt_disconnect_done(struct rpc_xprt *xprt); 379void xprt_disconnect_done(struct rpc_xprt *xprt);
377void xprt_force_disconnect(struct rpc_xprt *xprt); 380void xprt_force_disconnect(struct rpc_xprt *xprt);