aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-25 13:03:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-25 13:03:28 -0400
commit40471856f2e38e9bfa8d605295e8234421110dd6 (patch)
tree9757e42e40bdbfcff7c52ab133e32b5c2203153b /include/linux
parentae005cbed12d0b340b04b59d6f5c56e710b3895d (diff)
parent0acd2201920d0968919f4f5797d63f7b6f2b19d4 (diff)
Merge branch 'nfs-for-2.6.39' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
* 'nfs-for-2.6.39' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6: (28 commits) Cleanup XDR parsing for LAYOUTGET, GETDEVICEINFO NFSv4.1 convert layoutcommit sync to boolean NFSv4.1 pnfs_layoutcommit_inode fixes NFS: Determine initial mount security NFS: use secinfo when crossing mountpoints NFS: Add secinfo procedure NFS: lookup supports alternate client NFS: convert call_sync() to a function NFSv4.1 remove temp code that prevented ds commits NFSv4.1: layoutcommit NFSv4.1: filelayout driver specific code for COMMIT NFSv4.1: remove GETATTR from ds commits NFSv4.1: add generic layer hooks for pnfs COMMIT NFSv4.1: alloc and free commit_buckets NFSv4.1: shift filelayout_free_lseg NFSv4.1: pull out code from nfs_commit_release NFSv4.1: pull error handling out of nfs_commit_list NFSv4.1: add callback to nfs4_commit_done NFSv4.1: rearrange nfs_commit_rpcsetup NFSv4.1: don't send COMMIT to ds for data sync writes ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nfs4.h2
-rw-r--r--include/linux/nfs_fs.h10
-rw-r--r--include/linux/nfs_page.h7
-rw-r--r--include/linux/nfs_xdr.h70
-rw-r--r--include/linux/sunrpc/gss_api.h3
5 files changed, 88 insertions, 4 deletions
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 134716e5e350..b528f6d4b860 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -550,6 +550,7 @@ enum {
550 NFSPROC4_CLNT_SETACL, 550 NFSPROC4_CLNT_SETACL,
551 NFSPROC4_CLNT_FS_LOCATIONS, 551 NFSPROC4_CLNT_FS_LOCATIONS,
552 NFSPROC4_CLNT_RELEASE_LOCKOWNER, 552 NFSPROC4_CLNT_RELEASE_LOCKOWNER,
553 NFSPROC4_CLNT_SECINFO,
553 554
554 /* nfs41 */ 555 /* nfs41 */
555 NFSPROC4_CLNT_EXCHANGE_ID, 556 NFSPROC4_CLNT_EXCHANGE_ID,
@@ -560,6 +561,7 @@ enum {
560 NFSPROC4_CLNT_RECLAIM_COMPLETE, 561 NFSPROC4_CLNT_RECLAIM_COMPLETE,
561 NFSPROC4_CLNT_LAYOUTGET, 562 NFSPROC4_CLNT_LAYOUTGET,
562 NFSPROC4_CLNT_GETDEVICEINFO, 563 NFSPROC4_CLNT_GETDEVICEINFO,
564 NFSPROC4_CLNT_LAYOUTCOMMIT,
563}; 565};
564 566
565/* nfs41 types */ 567/* nfs41 types */
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index f88522b10a38..1b93b9c60e55 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -33,6 +33,8 @@
33#define FLUSH_STABLE 4 /* commit to stable storage */ 33#define FLUSH_STABLE 4 /* commit to stable storage */
34#define FLUSH_LOWPRI 8 /* low priority background flush */ 34#define FLUSH_LOWPRI 8 /* low priority background flush */
35#define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */ 35#define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */
36#define FLUSH_COND_STABLE 32 /* conditional stable write - only stable
37 * if everything fits in one RPC */
36 38
37#ifdef __KERNEL__ 39#ifdef __KERNEL__
38 40
@@ -93,8 +95,13 @@ struct nfs_open_context {
93 int error; 95 int error;
94 96
95 struct list_head list; 97 struct list_head list;
98};
96 99
100struct nfs_open_dir_context {
101 struct rpc_cred *cred;
97 __u64 dir_cookie; 102 __u64 dir_cookie;
103 __u64 dup_cookie;
104 int duped;
98}; 105};
99 106
100/* 107/*
@@ -191,6 +198,7 @@ struct nfs_inode {
191 198
192 /* pNFS layout information */ 199 /* pNFS layout information */
193 struct pnfs_layout_hdr *layout; 200 struct pnfs_layout_hdr *layout;
201 atomic_t commits_outstanding;
194#endif /* CONFIG_NFS_V4*/ 202#endif /* CONFIG_NFS_V4*/
195#ifdef CONFIG_NFS_FSCACHE 203#ifdef CONFIG_NFS_FSCACHE
196 struct fscache_cookie *fscache; 204 struct fscache_cookie *fscache;
@@ -219,6 +227,8 @@ struct nfs_inode {
219#define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */ 227#define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */
220#define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */ 228#define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */
221#define NFS_INO_COMMIT (7) /* inode is committing unstable writes */ 229#define NFS_INO_COMMIT (7) /* inode is committing unstable writes */
230#define NFS_INO_PNFS_COMMIT (8) /* use pnfs code for commit */
231#define NFS_INO_LAYOUTCOMMIT (9) /* layoutcommit required */
222 232
223static inline struct nfs_inode *NFS_I(const struct inode *inode) 233static inline struct nfs_inode *NFS_I(const struct inode *inode)
224{ 234{
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 90907ada6d52..8023e4e25133 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -33,11 +33,15 @@ enum {
33 PG_CLEAN, 33 PG_CLEAN,
34 PG_NEED_COMMIT, 34 PG_NEED_COMMIT,
35 PG_NEED_RESCHED, 35 PG_NEED_RESCHED,
36 PG_PNFS_COMMIT,
36}; 37};
37 38
38struct nfs_inode; 39struct nfs_inode;
39struct nfs_page { 40struct nfs_page {
40 struct list_head wb_list; /* Defines state of page: */ 41 union {
42 struct list_head wb_list; /* Defines state of page: */
43 struct pnfs_layout_segment *wb_commit_lseg; /* Used when PG_PNFS_COMMIT set */
44 };
41 struct page *wb_page; /* page to read in/write out */ 45 struct page *wb_page; /* page to read in/write out */
42 struct nfs_open_context *wb_context; /* File state context info */ 46 struct nfs_open_context *wb_context; /* File state context info */
43 struct nfs_lock_context *wb_lock_context; /* lock context info */ 47 struct nfs_lock_context *wb_lock_context; /* lock context info */
@@ -57,6 +61,7 @@ struct nfs_pageio_descriptor {
57 size_t pg_count; 61 size_t pg_count;
58 size_t pg_bsize; 62 size_t pg_bsize;
59 unsigned int pg_base; 63 unsigned int pg_base;
64 char pg_moreio;
60 65
61 struct inode *pg_inode; 66 struct inode *pg_inode;
62 int (*pg_doio)(struct nfs_pageio_descriptor *); 67 int (*pg_doio)(struct nfs_pageio_descriptor *);
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 2c2c67d2eb42..78b101e487ea 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/nfsacl.h> 4#include <linux/nfsacl.h>
5#include <linux/nfs3.h> 5#include <linux/nfs3.h>
6#include <linux/sunrpc/gss_api.h>
6 7
7/* 8/*
8 * To change the maximum rsize and wsize supported by the NFS client, adjust 9 * To change the maximum rsize and wsize supported by the NFS client, adjust
@@ -14,6 +15,9 @@
14#define NFS_DEF_FILE_IO_SIZE (4096U) 15#define NFS_DEF_FILE_IO_SIZE (4096U)
15#define NFS_MIN_FILE_IO_SIZE (1024U) 16#define NFS_MIN_FILE_IO_SIZE (1024U)
16 17
18/* Forward declaration for NFS v3 */
19struct nfs4_secinfo_flavors;
20
17struct nfs_fsid { 21struct nfs_fsid {
18 uint64_t major; 22 uint64_t major;
19 uint64_t minor; 23 uint64_t minor;
@@ -78,6 +82,7 @@ struct nfs_fattr {
78#define NFS_ATTR_FATTR_CHANGE (1U << 17) 82#define NFS_ATTR_FATTR_CHANGE (1U << 17)
79#define NFS_ATTR_FATTR_PRECHANGE (1U << 18) 83#define NFS_ATTR_FATTR_PRECHANGE (1U << 18)
80#define NFS_ATTR_FATTR_V4_REFERRAL (1U << 19) /* NFSv4 referral */ 84#define NFS_ATTR_FATTR_V4_REFERRAL (1U << 19) /* NFSv4 referral */
85#define NFS_ATTR_FATTR_MOUNTPOINT (1U << 20) /* Treat as mountpoint */
81 86
82#define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \ 87#define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \
83 | NFS_ATTR_FATTR_MODE \ 88 | NFS_ATTR_FATTR_MODE \
@@ -190,8 +195,9 @@ struct nfs4_get_lease_time_res {
190#define PNFS_LAYOUT_MAXSIZE 4096 195#define PNFS_LAYOUT_MAXSIZE 4096
191 196
192struct nfs4_layoutdriver_data { 197struct nfs4_layoutdriver_data {
198 struct page **pages;
199 __u32 pglen;
193 __u32 len; 200 __u32 len;
194 void *buf;
195}; 201};
196 202
197struct pnfs_layout_range { 203struct pnfs_layout_range {
@@ -209,6 +215,7 @@ struct nfs4_layoutget_args {
209 struct nfs_open_context *ctx; 215 struct nfs_open_context *ctx;
210 struct nfs4_sequence_args seq_args; 216 struct nfs4_sequence_args seq_args;
211 nfs4_stateid stateid; 217 nfs4_stateid stateid;
218 struct nfs4_layoutdriver_data layout;
212}; 219};
213 220
214struct nfs4_layoutget_res { 221struct nfs4_layoutget_res {
@@ -216,8 +223,8 @@ struct nfs4_layoutget_res {
216 struct pnfs_layout_range range; 223 struct pnfs_layout_range range;
217 __u32 type; 224 __u32 type;
218 nfs4_stateid stateid; 225 nfs4_stateid stateid;
219 struct nfs4_layoutdriver_data layout;
220 struct nfs4_sequence_res seq_res; 226 struct nfs4_sequence_res seq_res;
227 struct nfs4_layoutdriver_data *layoutp;
221}; 228};
222 229
223struct nfs4_layoutget { 230struct nfs4_layoutget {
@@ -236,6 +243,29 @@ struct nfs4_getdeviceinfo_res {
236 struct nfs4_sequence_res seq_res; 243 struct nfs4_sequence_res seq_res;
237}; 244};
238 245
246struct nfs4_layoutcommit_args {
247 nfs4_stateid stateid;
248 __u64 lastbytewritten;
249 struct inode *inode;
250 const u32 *bitmask;
251 struct nfs4_sequence_args seq_args;
252};
253
254struct nfs4_layoutcommit_res {
255 struct nfs_fattr *fattr;
256 const struct nfs_server *server;
257 struct nfs4_sequence_res seq_res;
258};
259
260struct nfs4_layoutcommit_data {
261 struct rpc_task task;
262 struct nfs_fattr fattr;
263 struct pnfs_layout_segment *lseg;
264 struct rpc_cred *cred;
265 struct nfs4_layoutcommit_args args;
266 struct nfs4_layoutcommit_res res;
267};
268
239/* 269/*
240 * Arguments to the open call. 270 * Arguments to the open call.
241 */ 271 */
@@ -936,6 +966,38 @@ struct nfs4_fs_locations_res {
936 struct nfs4_sequence_res seq_res; 966 struct nfs4_sequence_res seq_res;
937}; 967};
938 968
969struct nfs4_secinfo_oid {
970 unsigned int len;
971 char data[GSS_OID_MAX_LEN];
972};
973
974struct nfs4_secinfo_gss {
975 struct nfs4_secinfo_oid sec_oid4;
976 unsigned int qop4;
977 unsigned int service;
978};
979
980struct nfs4_secinfo_flavor {
981 unsigned int flavor;
982 struct nfs4_secinfo_gss gss;
983};
984
985struct nfs4_secinfo_flavors {
986 unsigned int num_flavors;
987 struct nfs4_secinfo_flavor flavors[0];
988};
989
990struct nfs4_secinfo_arg {
991 const struct nfs_fh *dir_fh;
992 const struct qstr *name;
993 struct nfs4_sequence_args seq_args;
994};
995
996struct nfs4_secinfo_res {
997 struct nfs4_secinfo_flavors *flavors;
998 struct nfs4_sequence_res seq_res;
999};
1000
939#endif /* CONFIG_NFS_V4 */ 1001#endif /* CONFIG_NFS_V4 */
940 1002
941struct nfstime4 { 1003struct nfstime4 {
@@ -1040,6 +1102,7 @@ struct nfs_write_data {
1040 struct nfs_writeres res; /* result struct */ 1102 struct nfs_writeres res; /* result struct */
1041 struct pnfs_layout_segment *lseg; 1103 struct pnfs_layout_segment *lseg;
1042 struct nfs_client *ds_clp; /* pNFS data server */ 1104 struct nfs_client *ds_clp; /* pNFS data server */
1105 int ds_commit_index;
1043 const struct rpc_call_ops *mds_ops; 1106 const struct rpc_call_ops *mds_ops;
1044 int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data); 1107 int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data);
1045#ifdef CONFIG_NFS_V4 1108#ifdef CONFIG_NFS_V4
@@ -1071,7 +1134,7 @@ struct nfs_rpc_ops {
1071 struct nfs_fattr *); 1134 struct nfs_fattr *);
1072 int (*setattr) (struct dentry *, struct nfs_fattr *, 1135 int (*setattr) (struct dentry *, struct nfs_fattr *,
1073 struct iattr *); 1136 struct iattr *);
1074 int (*lookup) (struct inode *, struct qstr *, 1137 int (*lookup) (struct rpc_clnt *clnt, struct inode *, struct qstr *,
1075 struct nfs_fh *, struct nfs_fattr *); 1138 struct nfs_fh *, struct nfs_fattr *);
1076 int (*access) (struct inode *, struct nfs_access_entry *); 1139 int (*access) (struct inode *, struct nfs_access_entry *);
1077 int (*readlink)(struct inode *, struct page *, unsigned int, 1140 int (*readlink)(struct inode *, struct page *, unsigned int,
@@ -1118,6 +1181,7 @@ struct nfs_rpc_ops {
1118 struct iattr *iattr); 1181 struct iattr *iattr);
1119 int (*init_client) (struct nfs_client *, const struct rpc_timeout *, 1182 int (*init_client) (struct nfs_client *, const struct rpc_timeout *,
1120 const char *, rpc_authflavor_t, int); 1183 const char *, rpc_authflavor_t, int);
1184 int (*secinfo)(struct inode *, const struct qstr *, struct nfs4_secinfo_flavors *);
1121}; 1185};
1122 1186
1123/* 1187/*
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h
index 5d8048beb051..332da61cf8b7 100644
--- a/include/linux/sunrpc/gss_api.h
+++ b/include/linux/sunrpc/gss_api.h
@@ -126,6 +126,9 @@ struct gss_api_mech *gss_mech_get_by_name(const char *);
126/* Similar, but get by pseudoflavor. */ 126/* Similar, but get by pseudoflavor. */
127struct gss_api_mech *gss_mech_get_by_pseudoflavor(u32); 127struct gss_api_mech *gss_mech_get_by_pseudoflavor(u32);
128 128
129/* Fill in an array with a list of supported pseudoflavors */
130int gss_mech_list_pseudoflavors(u32 *);
131
129/* Just increments the mechanism's reference count and returns its input: */ 132/* Just increments the mechanism's reference count and returns its input: */
130struct gss_api_mech * gss_mech_get(struct gss_api_mech *); 133struct gss_api_mech * gss_mech_get(struct gss_api_mech *);
131 134