diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-26 12:52:09 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-26 12:52:09 -0400 |
| commit | a4dd8dce14014665862ce7911b38cb2c69e366dd (patch) | |
| tree | 00e79b2845d5d49abcd83cf253db83a52d482265 /include/linux | |
| parent | b18cae4224bde7e5a332c19bc99247b2098ea232 (diff) | |
| parent | 411b5e05617593efebc06241dbc56f42150f2abe (diff) | |
Merge branch 'nfs-for-2.6.37' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
* 'nfs-for-2.6.37' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
net/sunrpc: Use static const char arrays
nfs4: fix channel attribute sanity-checks
NFSv4.1: Use more sensible names for 'initialize_mountpoint'
NFSv4.1: pnfs: filelayout: add driver's LAYOUTGET and GETDEVICEINFO infrastructure
NFSv4.1: pnfs: add LAYOUTGET and GETDEVICEINFO infrastructure
NFS: client needs to maintain list of inodes with active layouts
NFS: create and destroy inode's layout cache
NFSv4.1: pnfs: filelayout: introduce minimal file layout driver
NFSv4.1: pnfs: full mount/umount infrastructure
NFS: set layout driver
NFS: ask for layouttypes during v4 fsinfo call
NFS: change stateid to be a union
NFSv4.1: pnfsd, pnfs: protocol level pnfs constants
SUNRPC: define xdr_decode_opaque_fixed
NFSD: remove duplicate NFS4_STATEID_SIZE
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/nfs4.h | 62 | ||||
| -rw-r--r-- | include/linux/nfs_fs.h | 5 | ||||
| -rw-r--r-- | include/linux/nfs_fs_sb.h | 3 | ||||
| -rw-r--r-- | include/linux/nfs_xdr.h | 50 | ||||
| -rw-r--r-- | include/linux/sunrpc/xdr.h | 7 |
5 files changed, 125 insertions, 2 deletions
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 07e40c625972..a9683d6acaa4 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
| @@ -17,7 +17,9 @@ | |||
| 17 | 17 | ||
| 18 | #define NFS4_BITMAP_SIZE 2 | 18 | #define NFS4_BITMAP_SIZE 2 |
| 19 | #define NFS4_VERIFIER_SIZE 8 | 19 | #define NFS4_VERIFIER_SIZE 8 |
| 20 | #define NFS4_STATEID_SIZE 16 | 20 | #define NFS4_STATEID_SEQID_SIZE 4 |
| 21 | #define NFS4_STATEID_OTHER_SIZE 12 | ||
| 22 | #define NFS4_STATEID_SIZE (NFS4_STATEID_SEQID_SIZE + NFS4_STATEID_OTHER_SIZE) | ||
| 21 | #define NFS4_FHSIZE 128 | 23 | #define NFS4_FHSIZE 128 |
| 22 | #define NFS4_MAXPATHLEN PATH_MAX | 24 | #define NFS4_MAXPATHLEN PATH_MAX |
| 23 | #define NFS4_MAXNAMLEN NAME_MAX | 25 | #define NFS4_MAXNAMLEN NAME_MAX |
| @@ -167,7 +169,16 @@ struct nfs4_acl { | |||
| 167 | }; | 169 | }; |
| 168 | 170 | ||
| 169 | typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier; | 171 | typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier; |
| 170 | typedef struct { char data[NFS4_STATEID_SIZE]; } nfs4_stateid; | 172 | |
| 173 | struct nfs41_stateid { | ||
| 174 | __be32 seqid; | ||
| 175 | char other[NFS4_STATEID_OTHER_SIZE]; | ||
| 176 | } __attribute__ ((packed)); | ||
| 177 | |||
| 178 | typedef union { | ||
| 179 | char data[NFS4_STATEID_SIZE]; | ||
| 180 | struct nfs41_stateid stateid; | ||
| 181 | } nfs4_stateid; | ||
| 171 | 182 | ||
| 172 | enum nfs_opnum4 { | 183 | enum nfs_opnum4 { |
| 173 | OP_ACCESS = 3, | 184 | OP_ACCESS = 3, |
| @@ -471,6 +482,8 @@ enum lock_type4 { | |||
| 471 | #define FATTR4_WORD1_TIME_MODIFY (1UL << 21) | 482 | #define FATTR4_WORD1_TIME_MODIFY (1UL << 21) |
| 472 | #define FATTR4_WORD1_TIME_MODIFY_SET (1UL << 22) | 483 | #define FATTR4_WORD1_TIME_MODIFY_SET (1UL << 22) |
| 473 | #define FATTR4_WORD1_MOUNTED_ON_FILEID (1UL << 23) | 484 | #define FATTR4_WORD1_MOUNTED_ON_FILEID (1UL << 23) |
| 485 | #define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30) | ||
| 486 | #define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1) | ||
| 474 | 487 | ||
| 475 | #define NFSPROC4_NULL 0 | 488 | #define NFSPROC4_NULL 0 |
| 476 | #define NFSPROC4_COMPOUND 1 | 489 | #define NFSPROC4_COMPOUND 1 |
| @@ -532,6 +545,8 @@ enum { | |||
| 532 | NFSPROC4_CLNT_SEQUENCE, | 545 | NFSPROC4_CLNT_SEQUENCE, |
| 533 | NFSPROC4_CLNT_GET_LEASE_TIME, | 546 | NFSPROC4_CLNT_GET_LEASE_TIME, |
| 534 | NFSPROC4_CLNT_RECLAIM_COMPLETE, | 547 | NFSPROC4_CLNT_RECLAIM_COMPLETE, |
| 548 | NFSPROC4_CLNT_LAYOUTGET, | ||
| 549 | NFSPROC4_CLNT_GETDEVICEINFO, | ||
| 535 | }; | 550 | }; |
| 536 | 551 | ||
| 537 | /* nfs41 types */ | 552 | /* nfs41 types */ |
| @@ -550,6 +565,49 @@ enum state_protect_how4 { | |||
| 550 | SP4_SSV = 2 | 565 | SP4_SSV = 2 |
| 551 | }; | 566 | }; |
| 552 | 567 | ||
| 568 | enum pnfs_layouttype { | ||
| 569 | LAYOUT_NFSV4_1_FILES = 1, | ||
| 570 | LAYOUT_OSD2_OBJECTS = 2, | ||
| 571 | LAYOUT_BLOCK_VOLUME = 3, | ||
| 572 | }; | ||
| 573 | |||
| 574 | /* used for both layout return and recall */ | ||
| 575 | enum pnfs_layoutreturn_type { | ||
| 576 | RETURN_FILE = 1, | ||
| 577 | RETURN_FSID = 2, | ||
| 578 | RETURN_ALL = 3 | ||
| 579 | }; | ||
| 580 | |||
| 581 | enum pnfs_iomode { | ||
| 582 | IOMODE_READ = 1, | ||
| 583 | IOMODE_RW = 2, | ||
| 584 | IOMODE_ANY = 3, | ||
| 585 | }; | ||
| 586 | |||
| 587 | enum pnfs_notify_deviceid_type4 { | ||
| 588 | NOTIFY_DEVICEID4_CHANGE = 1 << 1, | ||
| 589 | NOTIFY_DEVICEID4_DELETE = 1 << 2, | ||
| 590 | }; | ||
| 591 | |||
| 592 | #define NFL4_UFLG_MASK 0x0000003F | ||
| 593 | #define NFL4_UFLG_DENSE 0x00000001 | ||
| 594 | #define NFL4_UFLG_COMMIT_THRU_MDS 0x00000002 | ||
| 595 | #define NFL4_UFLG_STRIPE_UNIT_SIZE_MASK 0xFFFFFFC0 | ||
| 596 | |||
| 597 | /* Encoded in the loh_body field of type layouthint4 */ | ||
| 598 | enum filelayout_hint_care4 { | ||
| 599 | NFLH4_CARE_DENSE = NFL4_UFLG_DENSE, | ||
| 600 | NFLH4_CARE_COMMIT_THRU_MDS = NFL4_UFLG_COMMIT_THRU_MDS, | ||
| 601 | NFLH4_CARE_STRIPE_UNIT_SIZE = 0x00000040, | ||
| 602 | NFLH4_CARE_STRIPE_COUNT = 0x00000080 | ||
| 603 | }; | ||
| 604 | |||
| 605 | #define NFS4_DEVICEID4_SIZE 16 | ||
| 606 | |||
| 607 | struct nfs4_deviceid { | ||
| 608 | char data[NFS4_DEVICEID4_SIZE]; | ||
| 609 | }; | ||
| 610 | |||
| 553 | #endif | 611 | #endif |
| 554 | #endif | 612 | #endif |
| 555 | 613 | ||
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index a46e430d9622..bba26684acdc 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -188,6 +188,9 @@ struct nfs_inode { | |||
| 188 | struct nfs_delegation __rcu *delegation; | 188 | struct nfs_delegation __rcu *delegation; |
| 189 | fmode_t delegation_state; | 189 | fmode_t delegation_state; |
| 190 | struct rw_semaphore rwsem; | 190 | struct rw_semaphore rwsem; |
| 191 | |||
| 192 | /* pNFS layout information */ | ||
| 193 | struct pnfs_layout_hdr *layout; | ||
| 191 | #endif /* CONFIG_NFS_V4*/ | 194 | #endif /* CONFIG_NFS_V4*/ |
| 192 | #ifdef CONFIG_NFS_FSCACHE | 195 | #ifdef CONFIG_NFS_FSCACHE |
| 193 | struct fscache_cookie *fscache; | 196 | struct fscache_cookie *fscache; |
| @@ -615,6 +618,8 @@ nfs_fileid_to_ino_t(u64 fileid) | |||
| 615 | #define NFSDBG_CLIENT 0x0200 | 618 | #define NFSDBG_CLIENT 0x0200 |
| 616 | #define NFSDBG_MOUNT 0x0400 | 619 | #define NFSDBG_MOUNT 0x0400 |
| 617 | #define NFSDBG_FSCACHE 0x0800 | 620 | #define NFSDBG_FSCACHE 0x0800 |
| 621 | #define NFSDBG_PNFS 0x1000 | ||
| 622 | #define NFSDBG_PNFS_LD 0x2000 | ||
| 618 | #define NFSDBG_ALL 0xFFFF | 623 | #define NFSDBG_ALL 0xFFFF |
| 619 | 624 | ||
| 620 | #ifdef __KERNEL__ | 625 | #ifdef __KERNEL__ |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 5eef862ec187..452d96436d26 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
| @@ -82,6 +82,8 @@ struct nfs_client { | |||
| 82 | /* The flags used for obtaining the clientid during EXCHANGE_ID */ | 82 | /* The flags used for obtaining the clientid during EXCHANGE_ID */ |
| 83 | u32 cl_exchange_flags; | 83 | u32 cl_exchange_flags; |
| 84 | struct nfs4_session *cl_session; /* sharred session */ | 84 | struct nfs4_session *cl_session; /* sharred session */ |
| 85 | struct list_head cl_layouts; | ||
| 86 | struct pnfs_deviceid_cache *cl_devid_cache; /* pNFS deviceid cache */ | ||
| 85 | #endif /* CONFIG_NFS_V4_1 */ | 87 | #endif /* CONFIG_NFS_V4_1 */ |
| 86 | 88 | ||
| 87 | #ifdef CONFIG_NFS_FSCACHE | 89 | #ifdef CONFIG_NFS_FSCACHE |
| @@ -145,6 +147,7 @@ struct nfs_server { | |||
| 145 | u32 acl_bitmask; /* V4 bitmask representing the ACEs | 147 | u32 acl_bitmask; /* V4 bitmask representing the ACEs |
| 146 | that are supported on this | 148 | that are supported on this |
| 147 | filesystem */ | 149 | filesystem */ |
| 150 | struct pnfs_layoutdriver_type *pnfs_curr_ld; /* Active layout driver */ | ||
| 148 | #endif | 151 | #endif |
| 149 | void (*destroy)(struct nfs_server *); | 152 | void (*destroy)(struct nfs_server *); |
| 150 | 153 | ||
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index da7a1300dc60..ba6cc8f223c9 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -114,6 +114,7 @@ struct nfs_fsinfo { | |||
| 114 | __u64 maxfilesize; | 114 | __u64 maxfilesize; |
| 115 | struct timespec time_delta; /* server time granularity */ | 115 | struct timespec time_delta; /* server time granularity */ |
| 116 | __u32 lease_time; /* in seconds */ | 116 | __u32 lease_time; /* in seconds */ |
| 117 | __u32 layouttype; /* supported pnfs layout driver */ | ||
| 117 | }; | 118 | }; |
| 118 | 119 | ||
| 119 | struct nfs_fsstat { | 120 | struct nfs_fsstat { |
| @@ -186,6 +187,55 @@ struct nfs4_get_lease_time_res { | |||
| 186 | struct nfs4_sequence_res lr_seq_res; | 187 | struct nfs4_sequence_res lr_seq_res; |
| 187 | }; | 188 | }; |
| 188 | 189 | ||
| 190 | #define PNFS_LAYOUT_MAXSIZE 4096 | ||
| 191 | |||
| 192 | struct nfs4_layoutdriver_data { | ||
| 193 | __u32 len; | ||
| 194 | void *buf; | ||
| 195 | }; | ||
| 196 | |||
| 197 | struct pnfs_layout_range { | ||
| 198 | u32 iomode; | ||
| 199 | u64 offset; | ||
| 200 | u64 length; | ||
| 201 | }; | ||
| 202 | |||
| 203 | struct nfs4_layoutget_args { | ||
| 204 | __u32 type; | ||
| 205 | struct pnfs_layout_range range; | ||
| 206 | __u64 minlength; | ||
| 207 | __u32 maxcount; | ||
| 208 | struct inode *inode; | ||
| 209 | struct nfs_open_context *ctx; | ||
| 210 | struct nfs4_sequence_args seq_args; | ||
| 211 | }; | ||
| 212 | |||
| 213 | struct nfs4_layoutget_res { | ||
| 214 | __u32 return_on_close; | ||
| 215 | struct pnfs_layout_range range; | ||
| 216 | __u32 type; | ||
| 217 | nfs4_stateid stateid; | ||
| 218 | struct nfs4_layoutdriver_data layout; | ||
| 219 | struct nfs4_sequence_res seq_res; | ||
| 220 | }; | ||
| 221 | |||
| 222 | struct nfs4_layoutget { | ||
| 223 | struct nfs4_layoutget_args args; | ||
| 224 | struct nfs4_layoutget_res res; | ||
| 225 | struct pnfs_layout_segment **lsegpp; | ||
| 226 | int status; | ||
| 227 | }; | ||
| 228 | |||
| 229 | struct nfs4_getdeviceinfo_args { | ||
| 230 | struct pnfs_device *pdev; | ||
| 231 | struct nfs4_sequence_args seq_args; | ||
| 232 | }; | ||
| 233 | |||
| 234 | struct nfs4_getdeviceinfo_res { | ||
| 235 | struct pnfs_device *pdev; | ||
| 236 | struct nfs4_sequence_res seq_res; | ||
| 237 | }; | ||
| 238 | |||
| 189 | /* | 239 | /* |
| 190 | * Arguments to the open call. | 240 | * Arguments to the open call. |
| 191 | */ | 241 | */ |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index ab91d86565fd..498ab93a81e4 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
| @@ -132,6 +132,13 @@ xdr_decode_hyper(__be32 *p, __u64 *valp) | |||
| 132 | return p + 2; | 132 | return p + 2; |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | static inline __be32 * | ||
| 136 | xdr_decode_opaque_fixed(__be32 *p, void *ptr, unsigned int len) | ||
| 137 | { | ||
| 138 | memcpy(ptr, p, len); | ||
| 139 | return p + XDR_QUADLEN(len); | ||
| 140 | } | ||
| 141 | |||
| 135 | /* | 142 | /* |
| 136 | * Adjust kvec to reflect end of xdr'ed data (RPC client XDR) | 143 | * Adjust kvec to reflect end of xdr'ed data (RPC client XDR) |
| 137 | */ | 144 | */ |
