linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: andros@netapp.com
To: bhalevy@panasas.com
Cc: linux-nfs@vger.kernel.org, Andy Adamson <andros@netapp.com>
Subject: [PATCH 2/2] SQUASHME pnfs-submit file layout free_layout init_only
Date: Fri,  9 Jul 2010 12:39:31 -0400	[thread overview]
Message-ID: <1278693571-3328-3-git-send-email-andros@netapp.com> (raw)
In-Reply-To: <1278693571-3328-2-git-send-email-andros@netapp.com>

From: Andy Adamson <andros@netapp.com>

Implement the new free_layout layoutdriver io operation init_only boolean.

Signed-off-by: Andy Adamson <andros@netapp.com>
---
 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


  reply	other threads:[~2010-07-09 16:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-09 16:39 [PATCH 0/2] pnfs-submit Re-initialize pnfs_layout_type when segs list is empty andros
2010-07-09 16:39 ` [PATCH 1/2] SQUASHME pnfs-submit: reinitialize pnfs_layout_type andros
2010-07-09 16:39   ` andros [this message]
2010-07-12 16:10   ` Benny Halevy
2010-07-12 15:48 ` [PATCH 0/2] pnfs-submit Re-initialize pnfs_layout_type when segs list is empty Boaz Harrosh
2010-07-12 16:36   ` William A. (Andy) Adamson
     [not found]     ` <AANLkTinjab9XPUjRe2knYyRQg8j9pmc9Gdk_fRkGGfY2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-12 17:07       ` Boaz Harrosh
2010-07-12 18:07         ` William A. (Andy) Adamson
     [not found]           ` <AANLkTilSPhZ1aBtU1taI8UnKQ9CddgaK3oQ1xoSMOuh3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-13  9:02             ` Boaz Harrosh
2010-07-13 14:06               ` William A. (Andy) Adamson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1278693571-3328-3-git-send-email-andros@netapp.com \
    --to=andros@netapp.com \
    --cc=bhalevy@panasas.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).