void pnfs_free_lseg_list(struct list_head *free_me) { struct pnfs_layout_segment *lseg, *tmp; list_for_each_entry_safe(lseg, tmp, free_me, pls_list) { list_del(&lseg->pls_list); free_lseg(lseg); }
/* note free_me must contain lsegs from a single layout_hdr */ void pnfs_free_lseg_list(struct list_head *free_me) { struct pnfs_layout_segment *lseg, *tmp; struct pnfs_layout_hdr *lo; if (list_empty(free_me)) return; lo = list_first_entry(free_me, struct pnfs_layout_segment, pls_list)->pls_layout; if (test_bit(NFS_LAYOUT_DESTROYED, &lo->plh_flags)) { struct nfs_client *clp; clp = NFS_SERVER(lo->plh_inode)->nfs_client; spin_lock(&clp->cl_lock); list_del_init(&lo->plh_layouts); spin_unlock(&clp->cl_lock); } list_for_each_entry_safe(lseg, tmp, free_me, pls_list) { list_del(&lseg->pls_list); free_lseg(lseg); }