aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-05-26 13:33:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-26 13:33:33 -0400
commitea8ea737c46cffa5d0ee74309f81e55a7e5e9c2a (patch)
treeae159b2c5968fa3c2a5a4ab7176584bc9a17b889 /include/linux
parent0b9210c9c86e46a7a62bbc7b69b84001315072ff (diff)
parentc7d73af2d249f0323f5cdb171a59497ce80011fb (diff)
Merge tag 'nfs-for-4.7-1' of git://git.linux-nfs.org/projects/anna/linux-nfs
Pull NFS client updates from Anna Schumaker: "Highlights include: Features: - Add support for the NFS v4.2 COPY operation - Add support for NFS/RDMA over IPv6 Bugfixes and cleanups: - Avoid race that crashes nfs_init_commit() - Fix oops in callback path - Fix LOCK/OPEN race when unlinking an open file - Choose correct stateids when using delegations in setattr, read and write - Don't send empty SETATTR after OPEN_CREATE - xprtrdma: Prevent server from writing a reply into memory client has released - xprtrdma: Support using Read list and Reply chunk in one RPC call" * tag 'nfs-for-4.7-1' of git://git.linux-nfs.org/projects/anna/linux-nfs: (61 commits) pnfs: pnfs_update_layout needs to consider if strict iomode checking is on nfs/flexfiles: Use the layout segment for reading unless it a IOMODE_RW and reading is disabled nfs/flexfiles: Helper function to detect FF_FLAGS_NO_READ_IO nfs: avoid race that crashes nfs_init_commit NFS: checking for NULL instead of IS_ERR() in nfs_commit_file() pnfs: make pnfs_layout_process more robust pnfs: rework LAYOUTGET retry handling pnfs: lift retry logic from send_layoutget to pnfs_update_layout pnfs: fix bad error handling in send_layoutget flexfiles: add kerneldoc header to nfs4_ff_layout_prepare_ds flexfiles: remove pointless setting of NFS_LAYOUT_RETURN_REQUESTED pnfs: only tear down lsegs that precede seqid in LAYOUTRETURN args pnfs: keep track of the return sequence number in pnfs_layout_hdr pnfs: record sequence in pnfs_layout_segment when it's created pnfs: don't merge new ff lsegs with ones that have LAYOUTRETURN bit set pNFS/flexfiles: When initing reads or writes, we might have to retry connecting to DSes pNFS/flexfiles: When checking for available DSes, conditionally check for MDS io pNFS/flexfile: Fix erroneous fall back to read/write through the MDS NFS: Reclaim writes via writepage are opportunistic NFSv4: Use the right stateid for delegations in setattr, read and write ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/errno.h1
-rw-r--r--include/linux/nfs4.h28
-rw-r--r--include/linux/nfs_fs_sb.h1
-rw-r--r--include/linux/nfs_xdr.h30
-rw-r--r--include/linux/sunrpc/auth.h26
-rw-r--r--include/linux/sunrpc/clnt.h1
-rw-r--r--include/linux/sunrpc/msg_prot.h4
-rw-r--r--include/linux/sunrpc/xprt.h1
-rw-r--r--include/linux/sunrpc/xprtrdma.h4
9 files changed, 82 insertions, 14 deletions
diff --git a/include/linux/errno.h b/include/linux/errno.h
index 89627b9187f9..7ce9fb1b7d28 100644
--- a/include/linux/errno.h
+++ b/include/linux/errno.h
@@ -28,5 +28,6 @@
28#define EBADTYPE 527 /* Type not supported by server */ 28#define EBADTYPE 527 /* Type not supported by server */
29#define EJUKEBOX 528 /* Request initiated, but will not complete before timeout */ 29#define EJUKEBOX 528 /* Request initiated, but will not complete before timeout */
30#define EIOCBQUEUED 529 /* iocb queued, will get completion event */ 30#define EIOCBQUEUED 529 /* iocb queued, will get completion event */
31#define ERECALLCONFLICT 530 /* conflict with recalled state */
31 32
32#endif 33#endif
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 011433478a14..bfed6b367350 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -50,12 +50,27 @@ struct nfs4_label {
50 50
51typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier; 51typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier;
52 52
53struct nfs_stateid4 { 53struct nfs4_stateid_struct {
54 __be32 seqid; 54 union {
55 char other[NFS4_STATEID_OTHER_SIZE]; 55 char data[NFS4_STATEID_SIZE];
56} __attribute__ ((packed)); 56 struct {
57 __be32 seqid;
58 char other[NFS4_STATEID_OTHER_SIZE];
59 } __attribute__ ((packed));
60 };
61
62 enum {
63 NFS4_INVALID_STATEID_TYPE = 0,
64 NFS4_SPECIAL_STATEID_TYPE,
65 NFS4_OPEN_STATEID_TYPE,
66 NFS4_LOCK_STATEID_TYPE,
67 NFS4_DELEGATION_STATEID_TYPE,
68 NFS4_LAYOUT_STATEID_TYPE,
69 NFS4_PNFS_DS_STATEID_TYPE,
70 } type;
71};
57 72
58typedef struct nfs_stateid4 nfs4_stateid; 73typedef struct nfs4_stateid_struct nfs4_stateid;
59 74
60enum nfs_opnum4 { 75enum nfs_opnum4 {
61 OP_ACCESS = 3, 76 OP_ACCESS = 3,
@@ -504,6 +519,7 @@ enum {
504 NFSPROC4_CLNT_DEALLOCATE, 519 NFSPROC4_CLNT_DEALLOCATE,
505 NFSPROC4_CLNT_LAYOUTSTATS, 520 NFSPROC4_CLNT_LAYOUTSTATS,
506 NFSPROC4_CLNT_CLONE, 521 NFSPROC4_CLNT_CLONE,
522 NFSPROC4_CLNT_COPY,
507}; 523};
508 524
509/* nfs41 types */ 525/* nfs41 types */
@@ -621,7 +637,9 @@ enum pnfs_update_layout_reason {
621 PNFS_UPDATE_LAYOUT_IO_TEST_FAIL, 637 PNFS_UPDATE_LAYOUT_IO_TEST_FAIL,
622 PNFS_UPDATE_LAYOUT_FOUND_CACHED, 638 PNFS_UPDATE_LAYOUT_FOUND_CACHED,
623 PNFS_UPDATE_LAYOUT_RETURN, 639 PNFS_UPDATE_LAYOUT_RETURN,
640 PNFS_UPDATE_LAYOUT_RETRY,
624 PNFS_UPDATE_LAYOUT_BLOCKED, 641 PNFS_UPDATE_LAYOUT_BLOCKED,
642 PNFS_UPDATE_LAYOUT_INVALID_OPEN,
625 PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET, 643 PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET,
626}; 644};
627 645
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 7fcc13c8cf1f..14a762d2734d 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -246,5 +246,6 @@ struct nfs_server {
246#define NFS_CAP_DEALLOCATE (1U << 21) 246#define NFS_CAP_DEALLOCATE (1U << 21)
247#define NFS_CAP_LAYOUTSTATS (1U << 22) 247#define NFS_CAP_LAYOUTSTATS (1U << 22)
248#define NFS_CAP_CLONE (1U << 23) 248#define NFS_CAP_CLONE (1U << 23)
249#define NFS_CAP_COPY (1U << 24)
249 250
250#endif 251#endif
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index ee8491dadbf3..c304a11b5b1a 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -233,7 +233,6 @@ struct nfs4_layoutget_args {
233 struct inode *inode; 233 struct inode *inode;
234 struct nfs_open_context *ctx; 234 struct nfs_open_context *ctx;
235 nfs4_stateid stateid; 235 nfs4_stateid stateid;
236 unsigned long timestamp;
237 struct nfs4_layoutdriver_data layout; 236 struct nfs4_layoutdriver_data layout;
238}; 237};
239 238
@@ -251,7 +250,6 @@ struct nfs4_layoutget {
251 struct nfs4_layoutget_res res; 250 struct nfs4_layoutget_res res;
252 struct rpc_cred *cred; 251 struct rpc_cred *cred;
253 gfp_t gfp_flags; 252 gfp_t gfp_flags;
254 long timeout;
255}; 253};
256 254
257struct nfs4_getdeviceinfo_args { 255struct nfs4_getdeviceinfo_args {
@@ -1343,6 +1341,32 @@ struct nfs42_falloc_res {
1343 const struct nfs_server *falloc_server; 1341 const struct nfs_server *falloc_server;
1344}; 1342};
1345 1343
1344struct nfs42_copy_args {
1345 struct nfs4_sequence_args seq_args;
1346
1347 struct nfs_fh *src_fh;
1348 nfs4_stateid src_stateid;
1349 u64 src_pos;
1350
1351 struct nfs_fh *dst_fh;
1352 nfs4_stateid dst_stateid;
1353 u64 dst_pos;
1354
1355 u64 count;
1356};
1357
1358struct nfs42_write_res {
1359 u64 count;
1360 struct nfs_writeverf verifier;
1361};
1362
1363struct nfs42_copy_res {
1364 struct nfs4_sequence_res seq_res;
1365 struct nfs42_write_res write_res;
1366 bool consecutive;
1367 bool synchronous;
1368};
1369
1346struct nfs42_seek_args { 1370struct nfs42_seek_args {
1347 struct nfs4_sequence_args seq_args; 1371 struct nfs4_sequence_args seq_args;
1348 1372
@@ -1431,7 +1455,7 @@ struct nfs_commit_completion_ops {
1431}; 1455};
1432 1456
1433struct nfs_commit_info { 1457struct nfs_commit_info {
1434 spinlock_t *lock; /* inode->i_lock */ 1458 struct inode *inode; /* Needed for inode->i_lock */
1435 struct nfs_mds_commit_info *mds; 1459 struct nfs_mds_commit_info *mds;
1436 struct pnfs_ds_commit_info *ds; 1460 struct pnfs_ds_commit_info *ds;
1437 struct nfs_direct_req *dreq; /* O_DIRECT request */ 1461 struct nfs_direct_req *dreq; /* O_DIRECT request */
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 6a241a277249..899791573a40 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -127,7 +127,7 @@ struct rpc_authops {
127 void (*destroy)(struct rpc_auth *); 127 void (*destroy)(struct rpc_auth *);
128 128
129 struct rpc_cred * (*lookup_cred)(struct rpc_auth *, struct auth_cred *, int); 129 struct rpc_cred * (*lookup_cred)(struct rpc_auth *, struct auth_cred *, int);
130 struct rpc_cred * (*crcreate)(struct rpc_auth*, struct auth_cred *, int); 130 struct rpc_cred * (*crcreate)(struct rpc_auth*, struct auth_cred *, int, gfp_t);
131 int (*list_pseudoflavors)(rpc_authflavor_t *, int); 131 int (*list_pseudoflavors)(rpc_authflavor_t *, int);
132 rpc_authflavor_t (*info2flavor)(struct rpcsec_gss_info *); 132 rpc_authflavor_t (*info2flavor)(struct rpcsec_gss_info *);
133 int (*flavor2info)(rpc_authflavor_t, 133 int (*flavor2info)(rpc_authflavor_t,
@@ -167,6 +167,7 @@ void rpc_destroy_authunix(void);
167 167
168struct rpc_cred * rpc_lookup_cred(void); 168struct rpc_cred * rpc_lookup_cred(void);
169struct rpc_cred * rpc_lookup_cred_nonblock(void); 169struct rpc_cred * rpc_lookup_cred_nonblock(void);
170struct rpc_cred * rpc_lookup_generic_cred(struct auth_cred *, int, gfp_t);
170struct rpc_cred * rpc_lookup_machine_cred(const char *service_name); 171struct rpc_cred * rpc_lookup_machine_cred(const char *service_name);
171int rpcauth_register(const struct rpc_authops *); 172int rpcauth_register(const struct rpc_authops *);
172int rpcauth_unregister(const struct rpc_authops *); 173int rpcauth_unregister(const struct rpc_authops *);
@@ -178,7 +179,7 @@ rpc_authflavor_t rpcauth_get_pseudoflavor(rpc_authflavor_t,
178int rpcauth_get_gssinfo(rpc_authflavor_t, 179int rpcauth_get_gssinfo(rpc_authflavor_t,
179 struct rpcsec_gss_info *); 180 struct rpcsec_gss_info *);
180int rpcauth_list_flavors(rpc_authflavor_t *, int); 181int rpcauth_list_flavors(rpc_authflavor_t *, int);
181struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); 182struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int, gfp_t);
182void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); 183void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *);
183struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); 184struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int);
184struct rpc_cred * rpcauth_generic_bind_cred(struct rpc_task *, struct rpc_cred *, int); 185struct rpc_cred * rpcauth_generic_bind_cred(struct rpc_task *, struct rpc_cred *, int);
@@ -201,9 +202,28 @@ char * rpcauth_stringify_acceptor(struct rpc_cred *);
201static inline 202static inline
202struct rpc_cred * get_rpccred(struct rpc_cred *cred) 203struct rpc_cred * get_rpccred(struct rpc_cred *cred)
203{ 204{
204 atomic_inc(&cred->cr_count); 205 if (cred != NULL)
206 atomic_inc(&cred->cr_count);
205 return cred; 207 return cred;
206} 208}
207 209
210/**
211 * get_rpccred_rcu - get a reference to a cred using rcu-protected pointer
212 * @cred: cred of which to take a reference
213 *
214 * In some cases, we may have a pointer to a credential to which we
215 * want to take a reference, but don't already have one. Because these
216 * objects are freed using RCU, we can access the cr_count while its
217 * on its way to destruction and only take a reference if it's not already
218 * zero.
219 */
220static inline struct rpc_cred *
221get_rpccred_rcu(struct rpc_cred *cred)
222{
223 if (atomic_inc_not_zero(&cred->cr_count))
224 return cred;
225 return NULL;
226}
227
208#endif /* __KERNEL__ */ 228#endif /* __KERNEL__ */
209#endif /* _LINUX_SUNRPC_AUTH_H */ 229#endif /* _LINUX_SUNRPC_AUTH_H */
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 9a7ddbaf116e..19c659d1c0f8 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -176,6 +176,7 @@ void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int);
176int rpc_protocol(struct rpc_clnt *); 176int rpc_protocol(struct rpc_clnt *);
177struct net * rpc_net_ns(struct rpc_clnt *); 177struct net * rpc_net_ns(struct rpc_clnt *);
178size_t rpc_max_payload(struct rpc_clnt *); 178size_t rpc_max_payload(struct rpc_clnt *);
179size_t rpc_max_bc_payload(struct rpc_clnt *);
179unsigned long rpc_get_timeout(struct rpc_clnt *clnt); 180unsigned long rpc_get_timeout(struct rpc_clnt *clnt);
180void rpc_force_rebind(struct rpc_clnt *); 181void rpc_force_rebind(struct rpc_clnt *);
181size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); 182size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t);
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h
index 807371357160..59cbf16eaeb5 100644
--- a/include/linux/sunrpc/msg_prot.h
+++ b/include/linux/sunrpc/msg_prot.h
@@ -158,9 +158,9 @@ typedef __be32 rpc_fraghdr;
158 158
159/* 159/*
160 * Note that RFC 1833 does not put any size restrictions on the 160 * Note that RFC 1833 does not put any size restrictions on the
161 * netid string, but all currently defined netid's fit in 4 bytes. 161 * netid string, but all currently defined netid's fit in 5 bytes.
162 */ 162 */
163#define RPCBIND_MAXNETIDLEN (4u) 163#define RPCBIND_MAXNETIDLEN (5u)
164 164
165/* 165/*
166 * Universal addresses are introduced in RFC 1833 and further spelled 166 * Universal addresses are introduced in RFC 1833 and further spelled
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index fb0d212e0d3a..5aa3834619a8 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -142,6 +142,7 @@ struct rpc_xprt_ops {
142 int (*bc_setup)(struct rpc_xprt *xprt, 142 int (*bc_setup)(struct rpc_xprt *xprt,
143 unsigned int min_reqs); 143 unsigned int min_reqs);
144 int (*bc_up)(struct svc_serv *serv, struct net *net); 144 int (*bc_up)(struct svc_serv *serv, struct net *net);
145 size_t (*bc_maxpayload)(struct rpc_xprt *xprt);
145 void (*bc_free_rqst)(struct rpc_rqst *rqst); 146 void (*bc_free_rqst)(struct rpc_rqst *rqst);
146 void (*bc_destroy)(struct rpc_xprt *xprt, 147 void (*bc_destroy)(struct rpc_xprt *xprt,
147 unsigned int max_reqs); 148 unsigned int max_reqs);
diff --git a/include/linux/sunrpc/xprtrdma.h b/include/linux/sunrpc/xprtrdma.h
index 767190b01363..39267dc3486a 100644
--- a/include/linux/sunrpc/xprtrdma.h
+++ b/include/linux/sunrpc/xprtrdma.h
@@ -52,7 +52,9 @@
52#define RPCRDMA_DEF_SLOT_TABLE (128U) 52#define RPCRDMA_DEF_SLOT_TABLE (128U)
53#define RPCRDMA_MAX_SLOT_TABLE (256U) 53#define RPCRDMA_MAX_SLOT_TABLE (256U)
54 54
55#define RPCRDMA_DEF_INLINE (1024) /* default inline max */ 55#define RPCRDMA_MIN_INLINE (1024) /* min inline thresh */
56#define RPCRDMA_DEF_INLINE (1024) /* default inline thresh */
57#define RPCRDMA_MAX_INLINE (3068) /* max inline thresh */
56 58
57/* Memory registration strategies, by number. 59/* Memory registration strategies, by number.
58 * This is part of a kernel / user space API. Do not remove. */ 60 * This is part of a kernel / user space API. Do not remove. */