aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_alloc.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-10-30 01:55:45 -0400
committerLachlan McIlroy <lachlan@sgi.com>2008-10-30 01:55:45 -0400
commit637aa50f461b8ea6b1e8bf9877b0d13d00085043 (patch)
treea7c00b821dca04fe90614461749b74eff40bd8ed /fs/xfs/xfs_alloc.c
parent65f1eaeac0efc968797f3ac955b85ba3f5d4f9c8 (diff)
[XFS] implement generic xfs_btree_increment
From: Dave Chinner <dgc@sgi.com> Because this is the first major generic btree routine this patch includes some infrastrucure, first a few routines to deal with a btree block that can be either in short or long form, second xfs_btree_read_buf_block, which is the new central routine to read a btree block given a cursor, and third the new xfs_btree_ptr_addr routine to calculate the address for a given btree pointer record. [hch: split out from bigger patch and minor adaptions] SGI-PV: 985583 SGI-Modid: xfs-linux-melb:xfs-kern:32190a 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.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c
index 69833eb1de4f..b8bb694b7da3 100644
--- a/fs/xfs/xfs_alloc.c
+++ b/fs/xfs/xfs_alloc.c
@@ -818,7 +818,7 @@ xfs_alloc_ag_vextent_near(
818 XFS_WANT_CORRUPTED_GOTO(i == 1, error0); 818 XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
819 if (ltlen >= args->minlen) 819 if (ltlen >= args->minlen)
820 break; 820 break;
821 if ((error = xfs_alloc_increment(cnt_cur, 0, &i))) 821 if ((error = xfs_btree_increment(cnt_cur, 0, &i)))
822 goto error0; 822 goto error0;
823 } while (i); 823 } while (i);
824 ASSERT(ltlen >= args->minlen); 824 ASSERT(ltlen >= args->minlen);
@@ -828,7 +828,7 @@ xfs_alloc_ag_vextent_near(
828 i = cnt_cur->bc_ptrs[0]; 828 i = cnt_cur->bc_ptrs[0];
829 for (j = 1, blen = 0, bdiff = 0; 829 for (j = 1, blen = 0, bdiff = 0;
830 !error && j && (blen < args->maxlen || bdiff > 0); 830 !error && j && (blen < args->maxlen || bdiff > 0);
831 error = xfs_alloc_increment(cnt_cur, 0, &j)) { 831 error = xfs_btree_increment(cnt_cur, 0, &j)) {
832 /* 832 /*
833 * For each entry, decide if it's better than 833 * For each entry, decide if it's better than
834 * the previous best entry. 834 * the previous best entry.
@@ -938,7 +938,7 @@ xfs_alloc_ag_vextent_near(
938 * Increment the cursor, so we will point at the entry just right 938 * Increment the cursor, so we will point at the entry just right
939 * of the leftward entry if any, or to the leftmost entry. 939 * of the leftward entry if any, or to the leftmost entry.
940 */ 940 */
941 if ((error = xfs_alloc_increment(bno_cur_gt, 0, &i))) 941 if ((error = xfs_btree_increment(bno_cur_gt, 0, &i)))
942 goto error0; 942 goto error0;
943 if (!i) { 943 if (!i) {
944 /* 944 /*
@@ -977,7 +977,7 @@ xfs_alloc_ag_vextent_near(
977 args->minlen, &gtbnoa, &gtlena); 977 args->minlen, &gtbnoa, &gtlena);
978 if (gtlena >= args->minlen) 978 if (gtlena >= args->minlen)
979 break; 979 break;
980 if ((error = xfs_alloc_increment(bno_cur_gt, 0, &i))) 980 if ((error = xfs_btree_increment(bno_cur_gt, 0, &i)))
981 goto error0; 981 goto error0;
982 if (!i) { 982 if (!i) {
983 xfs_btree_del_cursor(bno_cur_gt, 983 xfs_btree_del_cursor(bno_cur_gt,
@@ -1066,7 +1066,7 @@ xfs_alloc_ag_vextent_near(
1066 /* 1066 /*
1067 * Fell off the right end. 1067 * Fell off the right end.
1068 */ 1068 */
1069 if ((error = xfs_alloc_increment( 1069 if ((error = xfs_btree_increment(
1070 bno_cur_gt, 0, &i))) 1070 bno_cur_gt, 0, &i)))
1071 goto error0; 1071 goto error0;
1072 if (!i) { 1072 if (!i) {
@@ -1548,7 +1548,7 @@ xfs_free_ag_extent(
1548 * Look for a neighboring block on the right (higher block numbers) 1548 * Look for a neighboring block on the right (higher block numbers)
1549 * that is contiguous with this space. 1549 * that is contiguous with this space.
1550 */ 1550 */
1551 if ((error = xfs_alloc_increment(bno_cur, 0, &haveright))) 1551 if ((error = xfs_btree_increment(bno_cur, 0, &haveright)))
1552 goto error0; 1552 goto error0;
1553 if (haveright) { 1553 if (haveright) {
1554 /* 1554 /*