diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-10-30 01:56:32 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@sgi.com> | 2008-10-30 01:56:32 -0400 |
commit | 278d0ca14e889c3932a05d1a68675252a12b3466 (patch) | |
tree | a228d171d4aded60b27639e30eca1bf58ed7daa6 /fs/xfs/xfs_btree.h | |
parent | 38bb74237d2d94c1aced2ec626d7d0f317e360da (diff) |
[XFS] implement generic xfs_btree_update
From: Dave Chinner <dgc@sgi.com>
The most complicated part here is the lastrec tracking for the alloc
btree. Most logic is in the update_lastrec method which has to do some
hopefully good enough dirty magic to maintain it.
[hch: split out from bigger patch and a rework of the lastrec
logic]
SGI-PV: 985583
SGI-Modid: xfs-linux-melb:xfs-kern:32194a
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_btree.h')
-rw-r--r-- | fs/xfs/xfs_btree.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/xfs/xfs_btree.h b/fs/xfs/xfs_btree.h index ac3f527b0ac4..c3bfa5556c19 100644 --- a/fs/xfs/xfs_btree.h +++ b/fs/xfs/xfs_btree.h | |||
@@ -187,6 +187,12 @@ struct xfs_btree_ops { | |||
187 | /* cursor operations */ | 187 | /* cursor operations */ |
188 | struct xfs_btree_cur *(*dup_cursor)(struct xfs_btree_cur *); | 188 | struct xfs_btree_cur *(*dup_cursor)(struct xfs_btree_cur *); |
189 | 189 | ||
190 | /* update last record information */ | ||
191 | void (*update_lastrec)(struct xfs_btree_cur *cur, | ||
192 | struct xfs_btree_block *block, | ||
193 | union xfs_btree_rec *rec, | ||
194 | int ptr, int reason); | ||
195 | |||
190 | /* records in block/level */ | 196 | /* records in block/level */ |
191 | int (*get_maxrecs)(struct xfs_btree_cur *cur, int level); | 197 | int (*get_maxrecs)(struct xfs_btree_cur *cur, int level); |
192 | 198 | ||
@@ -221,6 +227,12 @@ struct xfs_btree_ops { | |||
221 | }; | 227 | }; |
222 | 228 | ||
223 | /* | 229 | /* |
230 | * Reasons for the update_lastrec method to be called. | ||
231 | */ | ||
232 | #define LASTREC_UPDATE 0 | ||
233 | |||
234 | |||
235 | /* | ||
224 | * Btree cursor structure. | 236 | * Btree cursor structure. |
225 | * This collects all information needed by the btree code in one place. | 237 | * This collects all information needed by the btree code in one place. |
226 | */ | 238 | */ |
@@ -264,6 +276,7 @@ typedef struct xfs_btree_cur | |||
264 | /* cursor flags */ | 276 | /* cursor flags */ |
265 | #define XFS_BTREE_LONG_PTRS (1<<0) /* pointers are 64bits long */ | 277 | #define XFS_BTREE_LONG_PTRS (1<<0) /* pointers are 64bits long */ |
266 | #define XFS_BTREE_ROOT_IN_INODE (1<<1) /* root may be variable size */ | 278 | #define XFS_BTREE_ROOT_IN_INODE (1<<1) /* root may be variable size */ |
279 | #define XFS_BTREE_LASTREC_UPDATE (1<<2) /* track last rec externally */ | ||
267 | 280 | ||
268 | 281 | ||
269 | #define XFS_BTREE_NOERROR 0 | 282 | #define XFS_BTREE_NOERROR 0 |
@@ -519,6 +532,7 @@ int xfs_btree_increment(struct xfs_btree_cur *, int, int *); | |||
519 | int xfs_btree_decrement(struct xfs_btree_cur *, int, int *); | 532 | int xfs_btree_decrement(struct xfs_btree_cur *, int, int *); |
520 | int xfs_btree_lookup(struct xfs_btree_cur *, xfs_lookup_t, int *); | 533 | int xfs_btree_lookup(struct xfs_btree_cur *, xfs_lookup_t, int *); |
521 | int xfs_btree_updkey(struct xfs_btree_cur *, union xfs_btree_key *, int); | 534 | int xfs_btree_updkey(struct xfs_btree_cur *, union xfs_btree_key *, int); |
535 | int xfs_btree_update(struct xfs_btree_cur *, union xfs_btree_rec *); | ||
522 | 536 | ||
523 | /* | 537 | /* |
524 | * Helpers. | 538 | * Helpers. |