diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-10-30 01:58:11 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@sgi.com> | 2008-10-30 01:58:11 -0400 |
commit | 8cc938fe4237e50bea4aa557ed53b06de2319d49 (patch) | |
tree | 1b9dd352d423a573d96d5b1b311286a39232ef5b /fs/xfs/xfs_ialloc.c | |
parent | 91cca5df9bc85efdabfa645f51d54259ed09f4bf (diff) |
[XFS] implement generic xfs_btree_get_rec
Not really much reason to make it generic given that it's so small, but
this is the last non-method in xfs_alloc_btree.c and xfs_ialloc_btree.c,
so it makes the whole btree implementation more structured.
SGI-PV: 985583
SGI-Modid: xfs-linux-melb:xfs-kern:32206a
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 | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c index f13f59b13cc..c8a56c52964 100644 --- a/fs/xfs/xfs_ialloc.c +++ b/fs/xfs/xfs_ialloc.c | |||
@@ -192,6 +192,29 @@ xfs_inobt_update( | |||
192 | } | 192 | } |
193 | 193 | ||
194 | /* | 194 | /* |
195 | * Get the data from the pointed-to record. | ||
196 | */ | ||
197 | int /* error */ | ||
198 | xfs_inobt_get_rec( | ||
199 | struct xfs_btree_cur *cur, /* btree cursor */ | ||
200 | xfs_agino_t *ino, /* output: starting inode of chunk */ | ||
201 | __int32_t *fcnt, /* output: number of free inodes */ | ||
202 | xfs_inofree_t *free, /* output: free inode mask */ | ||
203 | int *stat) /* output: success/failure */ | ||
204 | { | ||
205 | union xfs_btree_rec *rec; | ||
206 | int error; | ||
207 | |||
208 | error = xfs_btree_get_rec(cur, &rec, stat); | ||
209 | if (!error && *stat == 1) { | ||
210 | *ino = be32_to_cpu(rec->inobt.ir_startino); | ||
211 | *fcnt = be32_to_cpu(rec->inobt.ir_freecount); | ||
212 | *free = be64_to_cpu(rec->inobt.ir_free); | ||
213 | } | ||
214 | return error; | ||
215 | } | ||
216 | |||
217 | /* | ||
195 | * Allocate new inodes in the allocation group specified by agbp. | 218 | * Allocate new inodes in the allocation group specified by agbp. |
196 | * Return 0 for success, else error code. | 219 | * Return 0 for success, else error code. |
197 | */ | 220 | */ |