diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-10-30 01:55:45 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@sgi.com> | 2008-10-30 01:55:45 -0400 |
commit | 637aa50f461b8ea6b1e8bf9877b0d13d00085043 (patch) | |
tree | a7c00b821dca04fe90614461749b74eff40bd8ed /fs/xfs/xfs_ialloc.c | |
parent | 65f1eaeac0efc968797f3ac955b85ba3f5d4f9c8 (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_ialloc.c')
-rw-r--r-- | fs/xfs/xfs_ialloc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c index 11bb169561c..3a8f0670e07 100644 --- a/fs/xfs/xfs_ialloc.c +++ b/fs/xfs/xfs_ialloc.c | |||
@@ -695,7 +695,7 @@ nextag: | |||
695 | goto error0; | 695 | goto error0; |
696 | XFS_WANT_CORRUPTED_GOTO(i == 1, error0); | 696 | XFS_WANT_CORRUPTED_GOTO(i == 1, error0); |
697 | freecount += rec.ir_freecount; | 697 | freecount += rec.ir_freecount; |
698 | if ((error = xfs_inobt_increment(cur, 0, &i))) | 698 | if ((error = xfs_btree_increment(cur, 0, &i))) |
699 | goto error0; | 699 | goto error0; |
700 | } while (i == 1); | 700 | } while (i == 1); |
701 | 701 | ||
@@ -753,7 +753,7 @@ nextag: | |||
753 | /* | 753 | /* |
754 | * Search right with cur, go forward 1 record. | 754 | * Search right with cur, go forward 1 record. |
755 | */ | 755 | */ |
756 | if ((error = xfs_inobt_increment(cur, 0, &i))) | 756 | if ((error = xfs_btree_increment(cur, 0, &i))) |
757 | goto error1; | 757 | goto error1; |
758 | doneright = !i; | 758 | doneright = !i; |
759 | if (!doneright) { | 759 | if (!doneright) { |
@@ -835,7 +835,7 @@ nextag: | |||
835 | * further right. | 835 | * further right. |
836 | */ | 836 | */ |
837 | else { | 837 | else { |
838 | if ((error = xfs_inobt_increment(cur, 0, | 838 | if ((error = xfs_btree_increment(cur, 0, |
839 | &i))) | 839 | &i))) |
840 | goto error1; | 840 | goto error1; |
841 | doneright = !i; | 841 | doneright = !i; |
@@ -890,7 +890,7 @@ nextag: | |||
890 | XFS_WANT_CORRUPTED_GOTO(i == 1, error0); | 890 | XFS_WANT_CORRUPTED_GOTO(i == 1, error0); |
891 | if (rec.ir_freecount > 0) | 891 | if (rec.ir_freecount > 0) |
892 | break; | 892 | break; |
893 | if ((error = xfs_inobt_increment(cur, 0, &i))) | 893 | if ((error = xfs_btree_increment(cur, 0, &i))) |
894 | goto error0; | 894 | goto error0; |
895 | XFS_WANT_CORRUPTED_GOTO(i == 1, error0); | 895 | XFS_WANT_CORRUPTED_GOTO(i == 1, error0); |
896 | } | 896 | } |
@@ -924,7 +924,7 @@ nextag: | |||
924 | goto error0; | 924 | goto error0; |
925 | XFS_WANT_CORRUPTED_GOTO(i == 1, error0); | 925 | XFS_WANT_CORRUPTED_GOTO(i == 1, error0); |
926 | freecount += rec.ir_freecount; | 926 | freecount += rec.ir_freecount; |
927 | if ((error = xfs_inobt_increment(cur, 0, &i))) | 927 | if ((error = xfs_btree_increment(cur, 0, &i))) |
928 | goto error0; | 928 | goto error0; |
929 | } while (i == 1); | 929 | } while (i == 1); |
930 | ASSERT(freecount == be32_to_cpu(agi->agi_freecount) || | 930 | ASSERT(freecount == be32_to_cpu(agi->agi_freecount) || |
@@ -1033,7 +1033,7 @@ xfs_difree( | |||
1033 | goto error0; | 1033 | goto error0; |
1034 | if (i) { | 1034 | if (i) { |
1035 | freecount += rec.ir_freecount; | 1035 | freecount += rec.ir_freecount; |
1036 | if ((error = xfs_inobt_increment(cur, 0, &i))) | 1036 | if ((error = xfs_btree_increment(cur, 0, &i))) |
1037 | goto error0; | 1037 | goto error0; |
1038 | } | 1038 | } |
1039 | } while (i == 1); | 1039 | } while (i == 1); |
@@ -1138,7 +1138,7 @@ xfs_difree( | |||
1138 | goto error0; | 1138 | goto error0; |
1139 | if (i) { | 1139 | if (i) { |
1140 | freecount += rec.ir_freecount; | 1140 | freecount += rec.ir_freecount; |
1141 | if ((error = xfs_inobt_increment(cur, 0, &i))) | 1141 | if ((error = xfs_btree_increment(cur, 0, &i))) |
1142 | goto error0; | 1142 | goto error0; |
1143 | } | 1143 | } |
1144 | } while (i == 1); | 1144 | } while (i == 1); |