All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: linux-nfs@vger.kernel.org
Cc: Benny Halevy <bhalevy@panasas.com>
Subject: [PATCH 5/9] pnfs: return bool status from nfs4_asynch_forget_layouts
Date: Mon, 21 Feb 2011 14:30:27 -0800	[thread overview]
Message-ID: <1298327427-8306-1-git-send-email-bhalevy@panasas.com> (raw)
In-Reply-To: <4D62E6F3.8000304@panasas.com>

return true if segments were marked invalid

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
 fs/nfs/pnfs.c |   10 ++++++++--
 fs/nfs/pnfs.h |    2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index beebc85..7507054 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -475,7 +475,7 @@ pnfs_clear_lseg_list(struct pnfs_layout_hdr *lo, struct list_head *tmp_list,
 			mark_lseg_invalid(lseg, tmp_list);
 			rv = true;
 		}
-	dprintk("%s:Return\n", __func__);
+	dprintk("%s:Return %d\n", __func__, rv);
 	return rv;
 }
 
@@ -640,20 +640,26 @@ send_layoutget(struct pnfs_layout_hdr *lo,
 	return lseg;
 }
 
-void nfs4_asynch_forget_layouts(struct pnfs_layout_hdr *lo,
+bool nfs4_asynch_forget_layouts(struct pnfs_layout_hdr *lo,
 				struct pnfs_layout_range *range,
 				int notify_bit, atomic_t *notify_count,
 				struct list_head *tmp_list)
 {
+	bool rv = false;
 	struct pnfs_layout_segment *lseg, *tmp;
 
 	assert_spin_locked(&lo->inode->i_lock);
+	dprintk("%s\n", __func__);
 	list_for_each_entry_safe(lseg, tmp, &lo->segs, fi_list)
 		if (should_free_lseg(&lseg->range, range)) {
 			lseg->pls_notify_mask |= (1 << notify_bit);
 			atomic_inc(notify_count);
 			mark_lseg_invalid(lseg, tmp_list);
+			rv = true;
 		}
+
+	dprintk("%s:Return %d\n", __func__, rv);
+	return rv;
 }
 
 /* Return true if there is layout based io in progress in the given range.
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 1ee59c2..11c6ee4 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -298,7 +298,7 @@ void pnfs_set_layout_stateid(struct pnfs_layout_hdr *lo,
 int pnfs_choose_layoutget_stateid(nfs4_stateid *dst,
 				  struct pnfs_layout_hdr *lo,
 				  struct nfs4_state *open_state);
-void nfs4_asynch_forget_layouts(struct pnfs_layout_hdr *lo,
+bool nfs4_asynch_forget_layouts(struct pnfs_layout_hdr *lo,
 				struct pnfs_layout_range *range,
 				int notify_bit, atomic_t *notify_count,
 				struct list_head *tmp_list);
-- 
1.7.3.4


  parent reply	other threads:[~2011-02-21 22:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-21 22:28 [PATCH 0/9] fixes for layoutrecall callback pnfs-all-2.6.37 and -latest Benny Halevy
2011-02-21 22:29 ` [PATCH 1/9] pnfsd: Initialize cb_layout clr_recall.cb_work Benny Halevy
2011-02-21 22:29 ` [PATCH 2/9] pnfsd: add default error case in nfsd4_cb_layout_done Benny Halevy
2011-02-21 22:30 ` [PATCH 3/9] pnfsd: do not clear rpc_resp in nfsd4_cb_done_sequence Benny Halevy
2011-02-21 22:30 ` [PATCH 4/9] pnfs: fix missing unlock in nfs_client_return_layouts Benny Halevy
2011-02-21 22:30 ` Benny Halevy [this message]
2011-02-21 22:30 ` [PATCH 6/9] pnfs: return NFS4ERR_DELAY from layoutrecall while waiting on lsegs Benny Halevy
2011-02-21 22:30 ` [PATCH 7/9] pnfs: fix cl_drain_notification indexing Benny Halevy
2011-02-21 22:30 ` [PATCH 8/9] pnfs: fix nfs4_asynch_forget_layouts accounting Benny Halevy
2011-02-21 22:31 ` [PATCH 9/9] pnfs: improve nfs4_layoutget_done debug printouts 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=1298327427-8306-1-git-send-email-bhalevy@panasas.com \
    --to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.