Skip to contentSkip to conversation

NFSv4 reduce attribute requests for open reclaim

PATCH New [email protected] 1 participant 1 message Oct 2, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NFSv4 reduce attribute requests for open reclaim

From: Andy Adamson <[email protected]>

We currently make no distinction in attribute requests between normal OPENs and OPEN with CLAIM_PREVIOUS. This offers more possibility of failures in the GETATTR response which foils OPEN reclaim attempts.

Reduce the requested attributes to the bare minimum needed to update the reclaim open stateid and split nfs4_opendata_to_nfs4_state processing accordingly.

---
 fs/nfs/inode.c    |    4 +-
 fs/nfs/internal.h |    1 +
 fs/nfs/nfs4proc.c |  110 ++++++++++++++++++++++++++++++++++++++++------------
 fs/nfs/nfs4xdr.c  |    2 +-
 4 files changed, 88 insertions(+), 29 deletions(-)
fs/nfs/inode.c +2 -2
index 126a4cb..8bf3cdf 100644
@@ -61,7 +61,6 @@
 static bool enable_ino64 = NFS_64_BIT_INODE_NUMBERS_ENABLED;
 
 static void nfs_invalidate_inode(struct inode *);
-static int nfs_update_inode(struct inode *, struct nfs_fattr *);
 
 static struct kmem_cache * nfs_inode_cachep;
 
@@ -1292,7 +1291,7 @@ EXPORT_SYMBOL_GPL(nfs_post_op_update_inode_force_wcc);
  *
  * A very similar scenario holds for the dir cache.
  */
-static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
+int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
 {
 	struct nfs_server *server;
 	struct nfs_inode *nfsi = NFS_I(inode);
@@ -1495,6 +1494,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
 	nfs_invalidate_inode(inode);
 	return -ESTALE;
 }
+EXPORT_SYMBOL_GPL(nfs_update_inode);
 
 struct inode *nfs_alloc_inode(struct super_block *sb)
 {
fs/nfs/internal.h +1 -0
index 89a795d..aff4399 100644
@@ -323,6 +323,7 @@ extern void nfs_clear_inode(struct inode *);
 extern void nfs_evict_inode(struct inode *);
 void nfs_zap_acl_cache(struct inode *inode);
 extern int nfs_wait_bit_killable(void *word);
+int nfs_update_inode(struct inode *, struct nfs_fattr *);
 
 /* super.c */
 extern const struct super_operations nfs_sops;
fs/nfs/nfs4proc.c +84 -26

143 lines not on this page · raw message

fs/nfs/nfs4xdr.c +1 -1
index 657483c..ba5b195 100644
@@ -2262,7 +2262,7 @@ static void nfs4_xdr_enc_open_noattr(struct rpc_rqst *req,
 	encode_putfh(xdr, args->fh, &hdr);
 	encode_open(xdr, args, &hdr);
 	encode_access(xdr, args->access, &hdr);
-	encode_getfattr(xdr, args->bitmask, &hdr);
+	encode_getfattr_open(xdr, args->bitmask, args->open_bitmap, &hdr);
 	encode_nops(&hdr);
 }
 
Signature · 1 line
1.7.7.6