• Trond Myklebust's avatar
    [PATCH] A basic NFSv4 client for 2.5.x · 3aeba064
    Trond Myklebust authored
    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.
    3aeba064
inode.c 36.2 KB