From 78a0dc91950f810acedcc79dadfaa97eee8ee18f Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Mon, 15 May 2006 15:29:58 +0000 Subject: [PATCH] Fix compilation for xfs_repair after recent optimisations. __inline -> static inline, and remove debug-only copies of some routines. Merge of master-melb:xfs-cmds:25940a by kenmcd. --- repair/avl.h | 2 +- repair/incore.h | 18 +++---- repair/incore_ino.c | 115 -------------------------------------------- 3 files changed, 10 insertions(+), 125 deletions(-) diff --git a/repair/avl.h b/repair/avl.h index d65a76ff6..2e335180d 100644 --- a/repair/avl.h +++ b/repair/avl.h @@ -84,7 +84,7 @@ avl_init_tree( avltree_desc_t *tree, avlops_t *ops); -__inline avlnode_t * +static inline avlnode_t * avl_findrange( avltree_desc_t *tree, __psunsigned_t value) diff --git a/repair/incore.h b/repair/incore.h index 25eabdc19..80d94b1ad 100644 --- a/repair/incore.h +++ b/repair/incore.h @@ -239,7 +239,7 @@ void add_dup_extent(xfs_agnumber_t agno, extern avltree_desc_t **extent_tree_ptrs; /* ARGSUSED */ -static __inline int +static inline int search_dup_extent(xfs_mount_t *mp, xfs_agnumber_t agno, xfs_agblock_t agbno) { ASSERT(agno < glob_agcount); @@ -368,12 +368,12 @@ void free_inode_rec(xfs_agnumber_t agno, ino_tree_node_t *ino_rec); void get_inode_rec(xfs_agnumber_t agno, ino_tree_node_t *ino_rec); extern avltree_desc_t **inode_tree_ptrs; -static __inline ino_tree_node_t * +static inline ino_tree_node_t * findfirst_inode_rec(xfs_agnumber_t agno) { return((ino_tree_node_t *) inode_tree_ptrs[agno]->avl_firstino); } -static __inline ino_tree_node_t * +static inline ino_tree_node_t * find_inode_rec(xfs_agnumber_t agno, xfs_agino_t ino) { return((ino_tree_node_t *) @@ -515,14 +515,14 @@ void clear_uncertain_ino_cache(xfs_agnumber_t agno); * an inode that we've counted is removed. */ -static __inline int +static inline int is_inode_reached(ino_tree_node_t *ino_rec, int ino_offset) { ASSERT(ino_rec->ino_un.backptrs != NULL); return(XFS_INO_RCHD_IS_RCHD(ino_rec, ino_offset)); } -static __inline void +static inline void add_inode_reached(ino_tree_node_t *ino_rec, int ino_offset) { ASSERT(ino_rec->ino_un.backptrs != NULL); @@ -533,7 +533,7 @@ add_inode_reached(ino_tree_node_t *ino_rec, int ino_offset) ASSERT(is_inode_reached(ino_rec, ino_offset)); } -static __inline void +static inline void add_inode_ref(ino_tree_node_t *ino_rec, int ino_offset) { ASSERT(ino_rec->ino_un.backptrs != NULL); @@ -541,7 +541,7 @@ add_inode_ref(ino_tree_node_t *ino_rec, int ino_offset) ino_rec->ino_un.backptrs->nlinks[ino_offset]++; } -static __inline void +static inline void drop_inode_ref(ino_tree_node_t *ino_rec, int ino_offset) { ASSERT(ino_rec->ino_un.backptrs != NULL); @@ -551,14 +551,14 @@ drop_inode_ref(ino_tree_node_t *ino_rec, int ino_offset) XFS_INO_RCHD_CLR_RCHD(ino_rec, ino_offset); } -static __inline int +static inline int is_inode_referenced(ino_tree_node_t *ino_rec, int ino_offset) { ASSERT(ino_rec->ino_un.backptrs != NULL); return(ino_rec->ino_un.backptrs->nlinks[ino_offset] > 0); } -static __inline __uint32_t +static inline __uint32_t num_inode_references(ino_tree_node_t *ino_rec, int ino_offset) { ASSERT(ino_rec->ino_un.backptrs != NULL); diff --git a/repair/incore_ino.c b/repair/incore_ino.c index 39093fc19..4f3e072d8 100644 --- a/repair/incore_ino.c +++ b/repair/incore_ino.c @@ -518,23 +518,6 @@ set_inode_parent(ino_tree_node_t *irec, int offset, xfs_ino_t parent) return; } -#if 0 -/* - * not needed for now since we don't set the parent info - * until phase 4 -- at which point we know that the directory - * inode won't be going away -- so we won't ever need to clear - * directory parent data that we set. - */ -void -clear_inode_parent(ino_tree_node_t *irec, int offset) -{ - ASSERT(full_backptrs == 0); - ASSERT(irec->ino_un.plist != NULL); - - return; -} -#endif - xfs_ino_t get_inode_parent(ino_tree_node_t *irec, int offset) { @@ -566,104 +549,6 @@ get_inode_parent(ino_tree_node_t *irec, int offset) return(0LL); } -/* - * code that deals with the inode descriptor appendages -- the back - * pointers, link counts and reached bits for phase 6 and phase 7. - */ - -#ifdef DEBUG -void -add_inode_reached(ino_tree_node_t *ino_rec, int ino_offset) -{ - ASSERT(ino_rec->ino_un.backptrs != NULL); - - ino_rec->ino_un.backptrs->nlinks[ino_offset]++; - XFS_INO_RCHD_SET_RCHD(ino_rec, ino_offset); - - ASSERT(is_inode_reached(ino_rec, ino_offset)); - - return; -} - -int -is_inode_reached(ino_tree_node_t *ino_rec, int ino_offset) -{ - ASSERT(ino_rec->ino_un.backptrs != NULL); - return(XFS_INO_RCHD_IS_RCHD(ino_rec, ino_offset)); -} - -void -add_inode_ref(ino_tree_node_t *ino_rec, int ino_offset) -{ - ASSERT(ino_rec->ino_un.backptrs != NULL); - - ino_rec->ino_un.backptrs->nlinks[ino_offset]++; - - return; -} - -void -drop_inode_ref(ino_tree_node_t *ino_rec, int ino_offset) -{ - ASSERT(ino_rec->ino_un.backptrs != NULL); - ASSERT(ino_rec->ino_un.backptrs->nlinks[ino_offset] > 0); - - if (--ino_rec->ino_un.backptrs->nlinks[ino_offset] == 0) - XFS_INO_RCHD_CLR_RCHD(ino_rec, ino_offset); - - return; -} - -int -is_inode_referenced(ino_tree_node_t *ino_rec, int ino_offset) -{ - ASSERT(ino_rec->ino_un.backptrs != NULL); - return(ino_rec->ino_un.backptrs->nlinks[ino_offset] > 0); -} - -__uint32_t -num_inode_references(ino_tree_node_t *ino_rec, int ino_offset) -{ - ASSERT(ino_rec->ino_un.backptrs != NULL); - return(ino_rec->ino_un.backptrs->nlinks[ino_offset]); -} -#endif /* DEBUG */ - -#if 0 -static backptrs_t *bptrs; -static int bptrs_index; -#define BPTR_ALLOC_NUM 1000 - -backptrs_t * -get_backptr(void) -{ - backptrs_t *bptr; - - if (bptrs_index == BPTR_ALLOC_NUM) { - ASSERT(bptrs == NULL); - - if ((bptrs = malloc(sizeof(backptrs_t[BPTR_ALLOC_NUM]))) - == NULL) { - do_error(_("couldn't malloc ino rec backptrs.\n")); - } - - bptrs_index = 0; - } - - ASSERT(bptrs != NULL); - - bptr = &bptrs[bptrs_index]; - bptrs_index++; - - if (bptrs_index == BPTR_ALLOC_NUM) - bptrs = NULL; - - bzero(bptr, sizeof(backptrs_t)); - - return(bptr); -} -#endif - backptrs_t * get_backptr(void) { -- 2.47.2