We only use lseg->range, and we will need the function for the callback code, where we have only the range, and not an enclosing lseg. Signed-off-by: Fred Isaman <iisaman@xxxxxxxxxx> --- fs/nfs/pnfs.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index d9a867f..ca8be8d 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -346,11 +346,11 @@ EXPORT_SYMBOL_GPL(put_lseg); * READ RW false */ static int -should_free_lseg(struct pnfs_layout_segment *lseg, - struct pnfs_layout_range *range) +should_free_lseg(struct pnfs_layout_range *lseg_range, + struct pnfs_layout_range *recall_range) { - return (range->iomode == IOMODE_ANY || - lseg->range.iomode == range->iomode); + return (recall_range->iomode == IOMODE_ANY || + lseg_range->iomode == recall_range->iomode); } static void mark_lseg_invalid(struct pnfs_layout_segment *lseg, @@ -378,7 +378,7 @@ pnfs_clear_lseg_list(struct pnfs_layout_hdr *lo, struct list_head *tmp_list, assert_spin_locked(&lo->inode->i_lock); list_for_each_entry_safe(lseg, next, &lo->segs, fi_list) - if (should_free_lseg(lseg, range)) { + if (should_free_lseg(&lseg->range, range)) { dprintk("%s: freeing lseg %p iomode %d " "offset %llu length %llu\n", __func__, lseg, lseg->range.iomode, lseg->range.offset, @@ -564,7 +564,7 @@ has_layout_to_return(struct pnfs_layout_hdr *lo, assert_spin_locked(&lo->inode->i_lock); list_for_each_entry(lseg, &lo->segs, fi_list) - if (should_free_lseg(lseg, range)) { + if (should_free_lseg(&lseg->range, range)) { out = lseg; break; } @@ -586,7 +586,7 @@ pnfs_return_layout_barrier(struct nfs_inode *nfsi, spin_lock(&nfsi->vfs_inode.i_lock); list_for_each_entry_safe(lseg, tmp, &nfsi->layout->segs, fi_list) - if (should_free_lseg(lseg, range)) { + if (should_free_lseg(&lseg->range, range)) { ret = true; break; } @@ -662,7 +662,7 @@ _pnfs_return_layout(struct inode *ino, struct pnfs_layout_range *range, } list_for_each_entry_safe(lseg, tmp, &lo->segs, fi_list) - if (should_free_lseg(lseg, &arg)) + if (should_free_lseg(&lseg->range, &arg)) mark_lseg_invalid(lseg, &tmp_list); /* Reference matched in nfs4_layoutreturn_release */ get_layout_hdr(lo); -- 1.7.2.1 -- 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