diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-10-30 01:57:40 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@sgi.com> | 2008-10-30 01:57:40 -0400 |
commit | 4b22a57188d87e873346b73c227607715be96399 (patch) | |
tree | 4cf2d0deede695968b7a32b098c0c64fac8610e5 /fs/xfs/xfs_alloc.c | |
parent | ea77b0a66e6c910ef265d9af522d6303ea6b3055 (diff) |
[XFS] implement generic xfs_btree_insert/insrec
Make the btree insert 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:32202a
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.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c index 875e1bae1941..a983824c12be 100644 --- a/fs/xfs/xfs_alloc.c +++ b/fs/xfs/xfs_alloc.c | |||
@@ -408,7 +408,7 @@ xfs_alloc_fixup_trees( | |||
408 | if ((error = xfs_alloc_lookup_eq(cnt_cur, nfbno1, nflen1, &i))) | 408 | if ((error = xfs_alloc_lookup_eq(cnt_cur, nfbno1, nflen1, &i))) |
409 | return error; | 409 | return error; |
410 | XFS_WANT_CORRUPTED_RETURN(i == 0); | 410 | XFS_WANT_CORRUPTED_RETURN(i == 0); |
411 | if ((error = xfs_alloc_insert(cnt_cur, &i))) | 411 | if ((error = xfs_btree_insert(cnt_cur, &i))) |
412 | return error; | 412 | return error; |
413 | XFS_WANT_CORRUPTED_RETURN(i == 1); | 413 | XFS_WANT_CORRUPTED_RETURN(i == 1); |
414 | } | 414 | } |
@@ -416,7 +416,7 @@ xfs_alloc_fixup_trees( | |||
416 | if ((error = xfs_alloc_lookup_eq(cnt_cur, nfbno2, nflen2, &i))) | 416 | if ((error = xfs_alloc_lookup_eq(cnt_cur, nfbno2, nflen2, &i))) |
417 | return error; | 417 | return error; |
418 | XFS_WANT_CORRUPTED_RETURN(i == 0); | 418 | XFS_WANT_CORRUPTED_RETURN(i == 0); |
419 | if ((error = xfs_alloc_insert(cnt_cur, &i))) | 419 | if ((error = xfs_btree_insert(cnt_cur, &i))) |
420 | return error; | 420 | return error; |
421 | XFS_WANT_CORRUPTED_RETURN(i == 1); | 421 | XFS_WANT_CORRUPTED_RETURN(i == 1); |
422 | } | 422 | } |
@@ -444,7 +444,7 @@ xfs_alloc_fixup_trees( | |||
444 | if ((error = xfs_alloc_lookup_eq(bno_cur, nfbno2, nflen2, &i))) | 444 | if ((error = xfs_alloc_lookup_eq(bno_cur, nfbno2, nflen2, &i))) |
445 | return error; | 445 | return error; |
446 | XFS_WANT_CORRUPTED_RETURN(i == 0); | 446 | XFS_WANT_CORRUPTED_RETURN(i == 0); |
447 | if ((error = xfs_alloc_insert(bno_cur, &i))) | 447 | if ((error = xfs_btree_insert(bno_cur, &i))) |
448 | return error; | 448 | return error; |
449 | XFS_WANT_CORRUPTED_RETURN(i == 1); | 449 | XFS_WANT_CORRUPTED_RETURN(i == 1); |
450 | } | 450 | } |
@@ -1756,7 +1756,7 @@ xfs_free_ag_extent( | |||
1756 | else { | 1756 | else { |
1757 | nbno = bno; | 1757 | nbno = bno; |
1758 | nlen = len; | 1758 | nlen = len; |
1759 | if ((error = xfs_alloc_insert(bno_cur, &i))) | 1759 | if ((error = xfs_btree_insert(bno_cur, &i))) |
1760 | goto error0; | 1760 | goto error0; |
1761 | XFS_WANT_CORRUPTED_GOTO(i == 1, error0); | 1761 | XFS_WANT_CORRUPTED_GOTO(i == 1, error0); |
1762 | } | 1762 | } |
@@ -1768,7 +1768,7 @@ xfs_free_ag_extent( | |||
1768 | if ((error = xfs_alloc_lookup_eq(cnt_cur, nbno, nlen, &i))) | 1768 | if ((error = xfs_alloc_lookup_eq(cnt_cur, nbno, nlen, &i))) |
1769 | goto error0; | 1769 | goto error0; |
1770 | XFS_WANT_CORRUPTED_GOTO(i == 0, error0); | 1770 | XFS_WANT_CORRUPTED_GOTO(i == 0, error0); |
1771 | if ((error = xfs_alloc_insert(cnt_cur, &i))) | 1771 | if ((error = xfs_btree_insert(cnt_cur, &i))) |
1772 | goto error0; | 1772 | goto error0; |
1773 | XFS_WANT_CORRUPTED_GOTO(i == 1, error0); | 1773 | XFS_WANT_CORRUPTED_GOTO(i == 1, error0); |
1774 | xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); | 1774 | xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); |