aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_alloc.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-10-30 01:58:01 -0400
committerLachlan McIlroy <lachlan@sgi.com>2008-10-30 01:58:01 -0400
commit91cca5df9bc85efdabfa645f51d54259ed09f4bf (patch)
tree29032361e21d1210effb72f4018f2a202d6a9fb0 /fs/xfs/xfs_alloc.c
parentd4b3a4b7dd62f2e111d4d0afa9ef3f9b6cd955c0 (diff)
[XFS] implement generic xfs_btree_delete/delrec
Make the btree delete code generic. Based on a patch from David Chinner with lots of changes to follow the original btree implementations more closely. While this loses some of the generic helper routines for inserting/moving/removing records it also solves some of the one off bugs in the original code and makes it easier to verify. SGI-PV: 985583 SGI-Modid: xfs-linux-melb:xfs-kern:32205a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Bill O'Donnell <billodo@sgi.com> Signed-off-by: David Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_alloc.c')
-rw-r--r--fs/xfs/xfs_alloc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c
index a983824c12be..e9c70249d2c5 100644
--- a/fs/xfs/xfs_alloc.c
+++ b/fs/xfs/xfs_alloc.c
@@ -398,7 +398,7 @@ xfs_alloc_fixup_trees(
398 /* 398 /*
399 * Delete the entry from the by-size btree. 399 * Delete the entry from the by-size btree.
400 */ 400 */
401 if ((error = xfs_alloc_delete(cnt_cur, &i))) 401 if ((error = xfs_btree_delete(cnt_cur, &i)))
402 return error; 402 return error;
403 XFS_WANT_CORRUPTED_RETURN(i == 1); 403 XFS_WANT_CORRUPTED_RETURN(i == 1);
404 /* 404 /*
@@ -427,7 +427,7 @@ xfs_alloc_fixup_trees(
427 /* 427 /*
428 * No remaining freespace, just delete the by-block tree entry. 428 * No remaining freespace, just delete the by-block tree entry.
429 */ 429 */
430 if ((error = xfs_alloc_delete(bno_cur, &i))) 430 if ((error = xfs_btree_delete(bno_cur, &i)))
431 return error; 431 return error;
432 XFS_WANT_CORRUPTED_RETURN(i == 1); 432 XFS_WANT_CORRUPTED_RETURN(i == 1);
433 } else { 433 } else {
@@ -1651,7 +1651,7 @@ xfs_free_ag_extent(
1651 if ((error = xfs_alloc_lookup_eq(cnt_cur, ltbno, ltlen, &i))) 1651 if ((error = xfs_alloc_lookup_eq(cnt_cur, ltbno, ltlen, &i)))
1652 goto error0; 1652 goto error0;
1653 XFS_WANT_CORRUPTED_GOTO(i == 1, error0); 1653 XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
1654 if ((error = xfs_alloc_delete(cnt_cur, &i))) 1654 if ((error = xfs_btree_delete(cnt_cur, &i)))
1655 goto error0; 1655 goto error0;
1656 XFS_WANT_CORRUPTED_GOTO(i == 1, error0); 1656 XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
1657 /* 1657 /*
@@ -1660,13 +1660,13 @@ xfs_free_ag_extent(
1660 if ((error = xfs_alloc_lookup_eq(cnt_cur, gtbno, gtlen, &i))) 1660 if ((error = xfs_alloc_lookup_eq(cnt_cur, gtbno, gtlen, &i)))
1661 goto error0; 1661 goto error0;
1662 XFS_WANT_CORRUPTED_GOTO(i == 1, error0); 1662 XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
1663 if ((error = xfs_alloc_delete(cnt_cur, &i))) 1663 if ((error = xfs_btree_delete(cnt_cur, &i)))
1664 goto error0; 1664 goto error0;
1665 XFS_WANT_CORRUPTED_GOTO(i == 1, error0); 1665 XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
1666 /* 1666 /*
1667 * Delete the old by-block entry for the right block. 1667 * Delete the old by-block entry for the right block.
1668 */ 1668 */
1669 if ((error = xfs_alloc_delete(bno_cur, &i))) 1669 if ((error = xfs_btree_delete(bno_cur, &i)))
1670 goto error0; 1670 goto error0;
1671 XFS_WANT_CORRUPTED_GOTO(i == 1, error0); 1671 XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
1672 /* 1672 /*
@@ -1711,7 +1711,7 @@ xfs_free_ag_extent(
1711 if ((error = xfs_alloc_lookup_eq(cnt_cur, ltbno, ltlen, &i))) 1711 if ((error = xfs_alloc_lookup_eq(cnt_cur, ltbno, ltlen, &i)))
1712 goto error0; 1712 goto error0;
1713 XFS_WANT_CORRUPTED_GOTO(i == 1, error0); 1713 XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
1714 if ((error = xfs_alloc_delete(cnt_cur, &i))) 1714 if ((error = xfs_btree_delete(cnt_cur, &i)))
1715 goto error0; 1715 goto error0;
1716 XFS_WANT_CORRUPTED_GOTO(i == 1, error0); 1716 XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
1717 /* 1717 /*
@@ -1737,7 +1737,7 @@ xfs_free_ag_extent(
1737 if ((error = xfs_alloc_lookup_eq(cnt_cur, gtbno, gtlen, &i))) 1737 if ((error = xfs_alloc_lookup_eq(cnt_cur, gtbno, gtlen, &i)))
1738 goto error0; 1738 goto error0;
1739 XFS_WANT_CORRUPTED_GOTO(i == 1, error0); 1739 XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
1740 if ((error = xfs_alloc_delete(cnt_cur, &i))) 1740 if ((error = xfs_btree_delete(cnt_cur, &i)))
1741 goto error0; 1741 goto error0;
1742 XFS_WANT_CORRUPTED_GOTO(i == 1, error0); 1742 XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
1743 /* 1743 /*