pnfsd-lexp: recall layout on truncate
diff mbox

Message ID 4D654A30.5020303@panasas.com
State New, archived
Headers show

Commit Message

Benny Halevy Feb. 23, 2011, 5:56 p.m. UTC
None

Patch
diff mbox

diff --git a/fs/nfsd/pnfsd.h b/fs/nfsd/pnfsd.h
index 51dd982..c11d93d 100644
--- a/fs/nfsd/pnfsd.h
+++ b/fs/nfsd/pnfsd.h
@@ -139,6 +139,7 @@  extern struct sockaddr pnfsd_lexp_addr;
 extern size_t pnfs_lexp_addr_len;
 
 extern void pnfsd_lexp_init(struct inode *);
+extern bool is_inode_pnfsd_lexp(struct inode *);
 extern int pnfsd_lexp_recall_layout(struct inode *);
 #endif /* CONFIG_PNFSD_LOCAL_EXPORT */
 
diff --git a/fs/nfsd/pnfsd_lexp.c b/fs/nfsd/pnfsd_lexp.c
index 736cc3f..71d503e 100644
--- a/fs/nfsd/pnfsd_lexp.c
+++ b/fs/nfsd/pnfsd_lexp.c
@@ -232,6 +232,12 @@  pnfsd_lexp_init(struct inode *inode)
 		init_waitqueue_head(&lo_recall_wq);
 }
 
+bool
+is_inode_pnfsd_lexp(struct inode *inode)
+{
+	return inode->i_sb->s_pnfs_op == &pnfsd_lexp_ops;
+}
+
 static bool
 has_no_layout(struct nfs4_file *fp)
 {
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 021e89e..2a3eff2 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -386,7 +386,8 @@  nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
 			if (err)
 				goto out;
 #if defined(CONFIG_PNFSD_LOCAL_EXPORT)
-			pnfsd_lexp_recall_layout(inode);
+			if (is_inode_pnfsd_lexp(inode))
+				pnfsd_lexp_recall_layout(inode);
 #endif /* CONFIG_PNFSD_LOCAL_EXPORT */
 #if defined(CONFIG_SPNFS_BLOCK)
 			if (pnfs_block_enabled(inode, 0)) {