summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nfs4.h205
-rw-r--r--include/linux/nfs_fs.h12
-rw-r--r--include/linux/nfs_xdr.h35
-rw-r--r--include/linux/nfsd/const.h1
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--include/linux/radix-tree.h3
-rw-r--r--include/linux/sunrpc/xprt.h1
7 files changed, 251 insertions, 7 deletions
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
new file mode 100644
index 000000000000..d320dd969b07
--- /dev/null
+++ b/include/linux/nfs4.h
@@ -0,0 +1,205 @@
+/*
+ * include/linux/nfs4.h
+ *
+ * NFSv4 protocol definitions.
+ *
+ * Copyright (c) 2002 The Regents of the University of Michigan.
+ * All rights reserved.
+ *
+ * Kendrick Smith <kmsmith@umich.edu>
+ * Andy Adamson <andros@umich.edu>
+ */
+
+#ifndef _LINUX_NFS4_H
+#define _LINUX_NFS4_H
+
+#define NFS4_VERIFIER_SIZE 8
+#define NFS4_FHSIZE 128
+#define NFS4_MAXNAMLEN NAME_MAX
+
+#define NFS4_ACCESS_READ 0x0001
+#define NFS4_ACCESS_LOOKUP 0x0002
+#define NFS4_ACCESS_MODIFY 0x0004
+#define NFS4_ACCESS_EXTEND 0x0008
+#define NFS4_ACCESS_DELETE 0x0010
+#define NFS4_ACCESS_EXECUTE 0x0020
+
+#define NFS4_FH_PERISTENT 0x0000
+#define NFS4_FH_NOEXPIRE_WITH_OPEN 0x0001
+#define NFS4_FH_VOLATILE_ANY 0x0002
+#define NFS4_FH_VOL_MIGRATION 0x0004
+#define NFS4_FH_VOL_RENAME 0x0008
+
+#define NFS4_OPEN_RESULT_CONFIRM 0x0002
+
+#define NFS4_SHARE_ACCESS_READ 0x0001
+#define NFS4_SHARE_ACCESS_WRITE 0x0002
+#define NFS4_SHARE_ACCESS_BOTH 0x0003
+
+#define NFS4_SET_TO_SERVER_TIME 0
+#define NFS4_SET_TO_CLIENT_TIME 1
+
+#define NFS4_ACE_ACCESS_ALLOWED_ACE_TYPE 0
+#define NFS4_ACE_ACCESS_DENIED_ACE_TYPE 1
+#define NFS4_ACE_SYSTEM_AUDIT_ACE_TYPE 2
+#define NFS4_ACE_SYSTEM_ALARM_ACE_TYPE 3
+
+typedef char nfs4_verifier[NFS4_VERIFIER_SIZE];
+typedef char nfs4_stateid[16];
+
+enum nfs_opnum4 {
+ OP_ACCESS = 3,
+ OP_CLOSE = 4,
+ OP_COMMIT = 5,
+ OP_CREATE = 6,
+ OP_DELEGPURGE = 7,
+ OP_DELEGRETURN = 8,
+ OP_GETATTR = 9,
+ OP_GETFH = 10,
+ OP_LINK = 11,
+ OP_LOCK = 12,
+ OP_LOCKT = 13,
+ OP_LOCKU = 14,
+ OP_LOOKUP = 15,
+ OP_LOOKUPP = 16,
+ OP_NVERIFY = 17,
+ OP_OPEN = 18,
+ OP_OPENATTR = 19,
+ OP_OPEN_CONFIRM = 20,
+ OP_OPEN_DOWNGRADE = 21,
+ OP_PUTFH = 22,
+ OP_PUTPUBFH = 23,
+ OP_PUTROOTFH = 24,
+ OP_READ = 25,
+ OP_READDIR = 26,
+ OP_READLINK = 27,
+ OP_REMOVE = 28,
+ OP_RENAME = 29,
+ OP_RENEW = 30,
+ OP_RESTOREFH = 31,
+ OP_SAVEFH = 32,
+ OP_SECINFO = 33,
+ OP_SETATTR = 34,
+ OP_SETCLIENTID = 35,
+ OP_SETCLIENTID_CONFIRM = 36,
+ OP_VERIFY = 37,
+ OP_WRITE = 38,
+};
+
+/*
+ * Note: NF4BAD is not actually part of the protocol; it is just used
+ * internally by nfsd.
+ */
+enum nfs_ftype4 {
+ NF4BAD = 0,
+ NF4REG = 1, /* Regular File */
+ NF4DIR = 2, /* Directory */
+ NF4BLK = 3, /* Special File - block device */
+ NF4CHR = 4, /* Special File - character device */
+ NF4LNK = 5, /* Symbolic Link */
+ NF4SOCK = 6, /* Special File - socket */
+ NF4FIFO = 7, /* Special File - fifo */
+ NF4ATTRDIR = 8, /* Attribute Directory */
+ NF4NAMEDATTR = 9 /* Named Attribute */
+};
+
+enum open_claim_type4 {
+ NFS4_OPEN_CLAIM_NULL = 0,
+ NFS4_OPEN_CLAIM_PREVIOUS = 1,
+ NFS4_OPEN_CLAIM_DELEGATE_CUR = 2,
+ NFS4_OPEN_CLAIM_DELEGATE_PREV = 3
+};
+
+enum opentype4 {
+ NFS4_OPEN_NOCREATE = 0,
+ NFS4_OPEN_CREATE = 1
+};
+
+enum createmode4 {
+ NFS4_CREATE_UNCHECKED = 0,
+ NFS4_CREATE_GUARDED = 1,
+ NFS4_CREATE_EXCLUSIVE = 2
+};
+
+enum limit_by4 {
+ NFS4_LIMIT_SIZE = 1,
+ NFS4_LIMIT_BLOCKS = 2
+};
+
+enum open_delegation_type4 {
+ NFS4_OPEN_DELEGATE_NONE = 0,
+ NFS4_OPEN_DELEGATE_READ = 1,
+ NFS4_OPEN_DELEGATE_WRITE = 2
+};
+
+/* Mandatory Attributes */
+#define FATTR4_WORD0_SUPPORTED_ATTRS (1)
+#define FATTR4_WORD0_TYPE (1 << 1)
+#define FATTR4_WORD0_FH_EXPIRE_TYPE (1 << 2)
+#define FATTR4_WORD0_CHANGE (1 << 3)
+#define FATTR4_WORD0_SIZE (1 << 4)
+#define FATTR4_WORD0_LINK_SUPPORT (1 << 5)
+#define FATTR4_WORD0_SYMLINK_SUPPORT (1 << 6)
+#define FATTR4_WORD0_NAMED_ATTR (1 << 7)
+#define FATTR4_WORD0_FSID (1 << 8)
+#define FATTR4_WORD0_UNIQUE_HANDLES (1 << 9)
+#define FATTR4_WORD0_LEASE_TIME (1 << 10)
+#define FATTR4_WORD0_RDATTR_ERROR (1 << 11)
+
+/* Recommended Attributes */
+#define FATTR4_WORD0_ACL (1 << 12)
+#define FATTR4_WORD0_ACLSUPPORT (1 << 13)
+#define FATTR4_WORD0_ARCHIVE (1 << 14)
+#define FATTR4_WORD0_CANSETTIME (1 << 15)
+#define FATTR4_WORD0_CASE_INSENSITIVE (1 << 16)
+#define FATTR4_WORD0_CASE_PRESERVING (1 << 17)
+#define FATTR4_WORD0_CHOWN_RESTRICTED (1 << 18)
+#define FATTR4_WORD0_FILEHANDLE (1 << 19)
+#define FATTR4_WORD0_FILEID (1 << 20)
+#define FATTR4_WORD0_FILES_AVAIL (1 << 21)
+#define FATTR4_WORD0_FILES_FREE (1 << 22)
+#define FATTR4_WORD0_FILES_TOTAL (1 << 23)
+#define FATTR4_WORD0_FS_LOCATIONS (1 << 24)
+#define FATTR4_WORD0_HIDDEN (1 << 25)
+#define FATTR4_WORD0_HOMOGENEOUS (1 << 26)
+#define FATTR4_WORD0_MAXFILESIZE (1 << 27)
+#define FATTR4_WORD0_MAXLINK (1 << 28)
+#define FATTR4_WORD0_MAXNAME (1 << 29)
+#define FATTR4_WORD0_MAXREAD (1 << 30)
+#define FATTR4_WORD0_MAXWRITE (1 << 31)
+#define FATTR4_WORD1_MIMETYPE (1)
+#define FATTR4_WORD1_MODE (1 << 1)
+#define FATTR4_WORD1_NO_TRUNC (1 << 2)
+#define FATTR4_WORD1_NUMLINKS (1 << 3)
+#define FATTR4_WORD1_OWNER (1 << 4)
+#define FATTR4_WORD1_OWNER_GROUP (1 << 5)
+#define FATTR4_WORD1_QUOTA_HARD (1 << 6)
+#define FATTR4_WORD1_QUOTA_SOFT (1 << 7)
+#define FATTR4_WORD1_QUOTA_USED (1 << 8)
+#define FATTR4_WORD1_RAWDEV (1 << 9)
+#define FATTR4_WORD1_SPACE_AVAIL (1 << 10)
+#define FATTR4_WORD1_SPACE_FREE (1 << 11)
+#define FATTR4_WORD1_SPACE_TOTAL (1 << 12)
+#define FATTR4_WORD1_SPACE_USED (1 << 13)
+#define FATTR4_WORD1_SYSTEM (1 << 14)
+#define FATTR4_WORD1_TIME_ACCESS (1 << 15)
+#define FATTR4_WORD1_TIME_ACCESS_SET (1 << 16)
+#define FATTR4_WORD1_TIME_BACKUP (1 << 17)
+#define FATTR4_WORD1_TIME_CREATE (1 << 18)
+#define FATTR4_WORD1_TIME_DELTA (1 << 19)
+#define FATTR4_WORD1_TIME_METADATA (1 << 20)
+#define FATTR4_WORD1_TIME_MODIFY (1 << 21)
+#define FATTR4_WORD1_TIME_MODIFY_SET (1 << 22)
+
+#define NFSPROC4_NULL 0
+#define NFSPROC4_COMPOUND 1
+#define NFS4_MINOR_VERSION 0
+#define NFS4_DEBUG 1
+
+#endif
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 42f716fd142f..c352fcbc956d 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -25,6 +25,7 @@
#include <linux/nfs.h>
#include <linux/nfs2.h>
#include <linux/nfs3.h>
+#include <linux/nfs4.h>
#include <linux/nfs_page.h>
#include <linux/nfs_xdr.h>
@@ -143,6 +144,7 @@ struct nfs_inode {
__u64 read_cache_isize;
unsigned long attrtimeo;
unsigned long attrtimeo_timestamp;
+ __u64 change_attr; /* v4 only */
/*
* Timestamp that dates the change made to read_cache_mtime.
@@ -207,6 +209,7 @@ static inline struct nfs_inode *NFS_I(struct inode *inode)
#define NFS_CACHE_CTIME(inode) (NFS_I(inode)->read_cache_ctime)
#define NFS_CACHE_MTIME(inode) (NFS_I(inode)->read_cache_mtime)
#define NFS_CACHE_ISIZE(inode) (NFS_I(inode)->read_cache_isize)
+#define NFS_CHANGE_ATTR(inode) (NFS_I(inode)->change_attr)
#define NFS_NEXTSCAN(inode) (NFS_I(inode)->nextscan)
#define NFS_CACHEINV(inode) \
do { \
@@ -329,7 +332,7 @@ extern int nfs_flush_file(struct inode *, struct file *, unsigned long, unsigne
extern int nfs_flush_list(struct list_head *, int, int);
extern int nfs_scan_lru_dirty(struct nfs_server *, struct list_head *);
extern int nfs_scan_lru_dirty_timeout(struct nfs_server *, struct list_head *);
-#ifdef CONFIG_NFS_V3
+#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
extern int nfs_commit_file(struct inode *, struct file *, unsigned long, unsigned int, int);
extern int nfs_commit_list(struct list_head *, int);
extern int nfs_scan_lru_commit(struct nfs_server *, struct list_head *);
@@ -376,6 +379,11 @@ nfs_wb_file(struct inode *inode, struct file *file)
return (error < 0) ? error : 0;
}
+/* Hack for future NFS swap support */
+#ifndef IS_SWAPFILE
+# define IS_SWAPFILE(inode) (0)
+#endif
+
/*
* linux/fs/nfs/read.c
*/
@@ -384,6 +392,8 @@ extern int nfs_pagein_inode(struct inode *, unsigned long, unsigned int);
extern int nfs_pagein_list(struct list_head *, int);
extern int nfs_scan_lru_read(struct nfs_server *, struct list_head *);
extern int nfs_scan_lru_read_timeout(struct nfs_server *, struct list_head *);
+extern void nfs_readpage_result(struct rpc_task *, unsigned int count, int eof);
+extern void nfs_readdata_release(struct rpc_task *);
/*
* linux/fs/mount_clnt.c
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 8d9c04899d65..eb65418342d2 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -24,17 +24,27 @@ struct nfs_fattr {
} nfs3;
} du;
__u32 rdev;
- __u64 fsid;
+ union {
+ __u64 nfs3; /* also nfs2 */
+ struct {
+ __u64 major;
+ __u64 minor;
+ } nfs4;
+ } fsid_u;
__u64 fileid;
__u64 atime;
__u64 mtime;
__u64 ctime;
+ __u64 change_attr; /* NFSv4 change attribute */
+ __u64 pre_change_attr;/* pre-op NFSv4 change attribute */
unsigned long timestamp;
};
#define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */
#define NFS_ATTR_FATTR 0x0002 /* post-op attributes */
#define NFS_ATTR_FATTR_V3 0x0004 /* NFSv3 attributes */
+#define NFS_ATTR_FATTR_V4 0x0008
+#define NFS_ATTR_PRE_CHANGE 0x0010
/*
* Info on the file system
@@ -298,6 +308,24 @@ struct nfs3_readdirres {
int plus;
};
+struct nfs_read_data {
+ struct rpc_task task;
+ struct inode *inode;
+ struct rpc_cred *cred;
+ struct nfs_fattr fattr; /* fattr storage */
+ struct list_head pages; /* Coalesced read requests */
+ struct page *pagevec[NFS_READ_MAXIOV];
+ union {
+ struct {
+ struct nfs_readargs args;
+ struct nfs_readres res;
+ } v3; /* also v2 */
+#ifdef CONFIG_NFS_V4
+ /* NFSv4 data will come here... */
+#endif
+ } u;
+};
+
/*
* RPC procedure vector for NFSv2/NFSv3 demuxing
*/
@@ -307,7 +335,7 @@ struct nfs_rpc_ops {
int (*getroot) (struct nfs_server *, struct nfs_fh *,
struct nfs_fattr *);
int (*getattr) (struct inode *, struct nfs_fattr *);
- int (*setattr) (struct inode *, struct nfs_fattr *,
+ int (*setattr) (struct dentry *, struct nfs_fattr *,
struct iattr *);
int (*lookup) (struct inode *, struct qstr *,
struct nfs_fh *, struct nfs_fattr *);
@@ -338,13 +366,14 @@ struct nfs_rpc_ops {
int (*mkdir) (struct inode *, struct qstr *, struct iattr *,
struct nfs_fh *, struct nfs_fattr *);
int (*rmdir) (struct inode *, struct qstr *);
- int (*readdir) (struct inode *, struct rpc_cred *,
+ int (*readdir) (struct dentry *, struct rpc_cred *,
u64, struct page *, unsigned int, int);
int (*mknod) (struct inode *, struct qstr *, struct iattr *,
dev_t, struct nfs_fh *, struct nfs_fattr *);
int (*statfs) (struct nfs_server *, struct nfs_fh *,
struct nfs_fsinfo *);
u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus);
+ void (*read_setup) (struct nfs_read_data *, unsigned int count);
};
/*
diff --git a/include/linux/nfsd/const.h b/include/linux/nfsd/const.h
index bd828fa0314f..623d577ca1b5 100644
--- a/include/linux/nfsd/const.h
+++ b/include/linux/nfsd/const.h
@@ -12,6 +12,7 @@
#include <linux/nfs.h>
#include <linux/nfs2.h>
#include <linux/nfs3.h>
+#include <linux/nfs4.h>
/*
* Maximum protocol version supported by knfsd
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 69c782cef0da..902158728595 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -623,6 +623,7 @@
#define PCI_VENDOR_ID_MOTOROLA_OOPS 0x1507
#define PCI_DEVICE_ID_MOTOROLA_MPC105 0x0001
#define PCI_DEVICE_ID_MOTOROLA_MPC106 0x0002
+#define PCI_DEVICE_ID_MOTOROLA_MPC107 0x0004
#define PCI_DEVICE_ID_MOTOROLA_RAVEN 0x4801
#define PCI_DEVICE_ID_MOTOROLA_FALCON 0x4802
#define PCI_DEVICE_ID_MOTOROLA_HAWK 0x4803
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h
index 56d1c668ff2e..4e58eb79abeb 100644
--- a/include/linux/radix-tree.h
+++ b/include/linux/radix-tree.h
@@ -21,8 +21,6 @@
struct radix_tree_node;
-#define RADIX_TREE_SLOT_RESERVED ((void *)~0UL)
-
struct radix_tree_root {
unsigned int height;
int gfp_mask;
@@ -41,7 +39,6 @@ do { \
(root)->rnode = NULL; \
} while (0)
-extern int radix_tree_reserve(struct radix_tree_root *, unsigned long, void ***);
extern int radix_tree_insert(struct radix_tree_root *, unsigned long, void *);
extern void *radix_tree_lookup(struct radix_tree_root *, unsigned long);
extern int radix_tree_delete(struct radix_tree_root *, unsigned long);
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index baaa8c748bbb..25b1694d6fe8 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -146,6 +146,7 @@ struct rpc_xprt {
unsigned long sockstate; /* Socket state */
unsigned char shutdown : 1, /* being shut down */
nocong : 1, /* no congestion control */
+ resvport : 1, /* use a reserved port */
stream : 1; /* TCP */
/*