summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@fys.uio.no>2002-10-09 22:48:22 -0700
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-10-09 22:48:22 -0700
commit3aeba06461c3337fde1ad1009f172fcbb1edf402 (patch)
treeedcbdc60af984982678a80b02c45c7526c33fe7f /include/linux
parent61e6f97593d43b8d2a5106f0b4d8527c3b4407b4 (diff)
[PATCH] A basic NFSv4 client for 2.5.x
This is a nontrivial change to the NFS client. NFSv4 defines a new file attribute, change_attr. This is a per-file opaque quantity returned by the server, whose value is required to change whenever the file is modified. If it exists, we want to use it for all cache consistency checks in nfs_refresh_inode(). Some operations also return a "pre-operation" value of the change_attr; we want to take this into account too. First, define flags NFS_ATTR_FATTR_V4 - indicates that the 'struct nfs_fattr' is an NFSv4 fattr, so the change_attr field is valid NFS_ATTR_PRE_CHANGE - indicates that the server returned a pre-operation change_attr, so the pre_change_attr field is valid Second, change nfs_refresh_inode() so that the caches are invalidated if there is a change_attr mismatch. Exception: If the pre_change_attr tells us that the mismatch was caused by our operation, then do not invalidate the caches. This patch should leave the logic in nfs_refresh_inode() unchanged if neither of the new flags are set.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nfs_fs.h2
-rw-r--r--include/linux/nfs_xdr.h4
2 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index a53ad5ea4ceb..588cb1437080 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -144,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.
@@ -208,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 { \
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index ce871934f6e5..18c44a22b3d8 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -35,12 +35,16 @@ struct nfs_fattr {
__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