public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Fred Isaman <iisaman@netapp.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH 1/1] pnfs-submit: test for sending LAYOUTRETURN was reversed
Date: Tue, 15 Jun 2010 01:01:57 -0400	[thread overview]
Message-ID: <1276578117-22597-1-git-send-email-iisaman@netapp.com> (raw)

Setting this correctly also simplifies the call to layout_return.

Signed-off-by: Fred Isaman <iisaman@netapp.com>
---
 fs/nfs/pnfs.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index edffee3..56d2932 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -731,7 +731,6 @@ pnfs_return_layout_barrier(struct nfs_inode *nfsi,
 
 static int
 return_layout(struct inode *ino, struct nfs4_pnfs_layout_segment *range,
-	      const nfs4_stateid *stateid, /* optional */
 	      enum pnfs_layoutreturn_type type, struct pnfs_layout_type *lo,
 	      bool wait)
 {
@@ -755,10 +754,7 @@ return_layout(struct inode *ino, struct nfs4_pnfs_layout_segment *range,
 	lrp->args.lseg = *range;
 	lrp->args.inode = ino;
 	lrp->lo = lo;
-	if (stateid)
-		lrp->args.stateid = *stateid;
-	else if (lo)
-		pnfs_get_layout_stateid(&lrp->args.stateid, lo);
+	pnfs_get_layout_stateid(&lrp->args.stateid, lo);
 
 	status = pnfs4_proc_layoutreturn(lrp, wait);
 out:
@@ -830,9 +826,8 @@ _pnfs_return_layout(struct inode *ino, struct nfs4_pnfs_layout_segment *range,
 			}
 		}
 
-		if (stateid && wait)
-			status = return_layout(ino, &arg, stateid, type,
-					       lo, wait);
+		if (!stateid)
+			status = return_layout(ino, &arg, type, lo, wait);
 		else
 			pnfs_layout_release(lo, &arg);
 	}
-- 
1.6.6.1


             reply	other threads:[~2010-06-15 17:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-15  5:01 Fred Isaman [this message]
2010-06-15 19:51 ` [PATCH 1/1] pnfs-submit: test for sending LAYOUTRETURN was reversed Benny Halevy

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=1276578117-22597-1-git-send-email-iisaman@netapp.com \
    --to=iisaman@netapp.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