diff mbox

[35/38] pnfsd: use layout stateid for is_layout_recalled

Message ID 1368240280-1083-1-git-send-email-bhalevy@tonian.com (mailing list archive)
State New, archived
Headers show

Commit Message

Benny Halevy May 11, 2013, 2:44 a.m. UTC
rather than clientid

Signed-off-by: Benny Halevy <bhalevy@tonian.com>
---
 fs/nfsd/nfs4pnfsd.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/fs/nfsd/nfs4pnfsd.c b/fs/nfsd/nfs4pnfsd.c
index 0b256f5..0ef351d 100644
--- a/fs/nfsd/nfs4pnfsd.c
+++ b/fs/nfsd/nfs4pnfsd.c
@@ -548,10 +548,10 @@  struct super_block *
  */
 static int
 is_layout_recalled(struct nfs4_client *clp,
-		   struct svc_fh *current_fh,
-		   struct nfsd4_layout_seg *seg)
+		   struct nfsd4_pnfs_layoutget *lgp)
 {
 	struct nfs4_layoutrecall *clr;
+	struct nfsd4_layout_seg *seg = &lgp->lg_seg;
 
 	spin_lock(&layout_lock);
 	list_for_each_entry (clr, &clp->cl_layoutrecalls, clr_perclnt) {
@@ -560,13 +560,13 @@  struct super_block *
 		if (clr->cb.cbl_recall_type == RETURN_ALL)
 			goto found;
 		if (clr->cb.cbl_recall_type == RETURN_FSID) {
-			if (same_fsid(&clr->cb.cbl_fsid, current_fh))
+			if (same_fsid(&clr->cb.cbl_fsid, lgp->lg_fhp))
 				goto found;
 			else
 				continue;
 		}
 		BUG_ON(clr->cb.cbl_recall_type != RETURN_FILE);
-		if (clr->cb.cbl_seg.clientid == seg->clientid &&
+		if (same_stid((stateid_t *)&clr->cb.cbl_sid, &lgp->lg_sid) &&
 		    lo_seg_overlapping(&clr->cb.cbl_seg, seg))
 			goto found;
 	}
@@ -704,7 +704,7 @@  struct super_block *
 	if (nfserr)
 		goto out_unlock;
 
-	if (is_layout_recalled(clp, lgp->lg_fhp, &lgp->lg_seg)) {
+	if (is_layout_recalled(clp, lgp)) {
 		nfserr = nfserr_recallconflict;
 		goto out_unlock;
 	}