Skip to content

Commit

Permalink
Merge branch 'xfs-4.7-inode-reclaim' into for-next
Browse files Browse the repository at this point in the history
  • Loading branch information
dchinner committed May 20, 2016
2 parents 544ad71 + ad438c4 commit 555b67e
Show file tree
Hide file tree
Showing 4 changed files with 250 additions and 199 deletions.
27 changes: 19 additions & 8 deletions fs/xfs/libxfs/xfs_inode_fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -1518,6 +1518,24 @@ xfs_iext_indirect_to_direct(
}
}

/*
* Remove all records from the indirection array.
*/
STATIC void
xfs_iext_irec_remove_all(
struct xfs_ifork *ifp)
{
int nlists;
int i;

ASSERT(ifp->if_flags & XFS_IFEXTIREC);
nlists = ifp->if_real_bytes / XFS_IEXT_BUFSZ;
for (i = 0; i < nlists; i++)
kmem_free(ifp->if_u1.if_ext_irec[i].er_extbuf);
kmem_free(ifp->if_u1.if_ext_irec);
ifp->if_flags &= ~XFS_IFEXTIREC;
}

/*
* Free incore file extents.
*/
Expand All @@ -1526,14 +1544,7 @@ xfs_iext_destroy(
xfs_ifork_t *ifp) /* inode fork pointer */
{
if (ifp->if_flags & XFS_IFEXTIREC) {
int erp_idx;
int nlists;

nlists = ifp->if_real_bytes / XFS_IEXT_BUFSZ;
for (erp_idx = nlists - 1; erp_idx >= 0 ; erp_idx--) {
xfs_iext_irec_remove(ifp, erp_idx);
}
ifp->if_flags &= ~XFS_IFEXTIREC;
xfs_iext_irec_remove_all(ifp);
} else if (ifp->if_real_bytes) {
kmem_free(ifp->if_u1.if_extents);
} else if (ifp->if_bytes) {
Expand Down
Loading

0 comments on commit 555b67e

Please sign in to comment.