[PATCH 2/2] SQUASHME pnfs-submit file layout free_layout init_only

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andy Adamson <andros@xxxxxxxxxx>

Implement the new free_layout layoutdriver io operation init_only boolean.

Signed-off-by: Andy Adamson <andros@xxxxxxxxxx>
---
 fs/nfs/nfs4filelayout.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index b49ccf4..e1b0d6c 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -314,9 +314,19 @@ filelayout_alloc_layout(struct inode *inode)
 /* Free a filelayout layout structure
  */
 static void
-filelayout_free_layout(struct pnfs_layout_type *lo)
+filelayout_free_layout(struct pnfs_layout_type *lo, bool init_only)
 {
-	dprintk("NFS_FILELAYOUT: freeing layout\n");
+	if (init_only) {
+		struct nfs4_filelayout *flp = FILE_LO(lo);
+
+		dprintk("%s re-intializing layout\n", __func__);
+		flp->uncommitted_write = 0;
+		flp->last_commit_size = 0;
+		flp->layout_id = 0;
+		flp->stripe_unit = 0;
+		return;
+	}
+	dprintk("%s freeing layout\n", __func__);
 	kfree(lo);
 }
 
-- 
1.6.6

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux