return true if segments were marked invalid Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxx> --- 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 -- 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