diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-10-30 01:58:01 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@sgi.com> | 2008-10-30 01:58:01 -0400 |
commit | 91cca5df9bc85efdabfa645f51d54259ed09f4bf (patch) | |
tree | 29032361e21d1210effb72f4018f2a202d6a9fb0 /fs/xfs/xfs_btree.h | |
parent | d4b3a4b7dd62f2e111d4d0afa9ef3f9b6cd955c0 (diff) |
[XFS] implement generic xfs_btree_delete/delrec
Make the btree delete 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:32205a
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 | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/xfs/xfs_btree.h b/fs/xfs/xfs_btree.h index ff2552febba7..06ef792e0aac 100644 --- a/fs/xfs/xfs_btree.h +++ b/fs/xfs/xfs_btree.h | |||
@@ -192,6 +192,8 @@ struct xfs_btree_ops { | |||
192 | /* update btree root pointer */ | 192 | /* update btree root pointer */ |
193 | void (*set_root)(struct xfs_btree_cur *cur, | 193 | void (*set_root)(struct xfs_btree_cur *cur, |
194 | union xfs_btree_ptr *nptr, int level_change); | 194 | union xfs_btree_ptr *nptr, int level_change); |
195 | int (*kill_root)(struct xfs_btree_cur *cur, struct xfs_buf *bp, | ||
196 | int level, union xfs_btree_ptr *newroot); | ||
195 | 197 | ||
196 | /* block allocation / freeing */ | 198 | /* block allocation / freeing */ |
197 | int (*alloc_block)(struct xfs_btree_cur *cur, | 199 | int (*alloc_block)(struct xfs_btree_cur *cur, |
@@ -207,6 +209,7 @@ struct xfs_btree_ops { | |||
207 | int ptr, int reason); | 209 | int ptr, int reason); |
208 | 210 | ||
209 | /* records in block/level */ | 211 | /* records in block/level */ |
212 | int (*get_minrecs)(struct xfs_btree_cur *cur, int level); | ||
210 | int (*get_maxrecs)(struct xfs_btree_cur *cur, int level); | 213 | int (*get_maxrecs)(struct xfs_btree_cur *cur, int level); |
211 | 214 | ||
212 | /* records on disk. Matter for the root in inode case. */ | 215 | /* records on disk. Matter for the root in inode case. */ |
@@ -251,6 +254,7 @@ struct xfs_btree_ops { | |||
251 | */ | 254 | */ |
252 | #define LASTREC_UPDATE 0 | 255 | #define LASTREC_UPDATE 0 |
253 | #define LASTREC_INSREC 1 | 256 | #define LASTREC_INSREC 1 |
257 | #define LASTREC_DELREC 2 | ||
254 | 258 | ||
255 | 259 | ||
256 | /* | 260 | /* |
@@ -562,6 +566,7 @@ int xfs_btree_new_root(struct xfs_btree_cur *, int *); | |||
562 | int xfs_btree_new_iroot(struct xfs_btree_cur *, int *, int *); | 566 | int xfs_btree_new_iroot(struct xfs_btree_cur *, int *, int *); |
563 | int xfs_btree_kill_iroot(struct xfs_btree_cur *); | 567 | int xfs_btree_kill_iroot(struct xfs_btree_cur *); |
564 | int xfs_btree_insert(struct xfs_btree_cur *, int *); | 568 | int xfs_btree_insert(struct xfs_btree_cur *, int *); |
569 | int xfs_btree_delete(struct xfs_btree_cur *, int *); | ||
565 | 570 | ||
566 | /* | 571 | /* |
567 | * Helpers. | 572 | * Helpers. |