From: Carlos Maiolino Date: Wed, 9 Nov 2011 16:54:06 +0000 (-0200) Subject: repair: add inline function to get ino tree node X-Git-Tag: v3.1.7~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1b9f3650a0d66d0128a53969dc17c7d405f518a1;p=thirdparty%2Fxfsprogs-dev.git repair: add inline function to get ino tree node Add get_inode_offset() inline function, which will return the offset of a specific node in the AVL tree avoiding the need to calculate the the offset each time it needs to be used. Reviewed-by: Eric Sandeen Signed-off-by: Carlos Maiolino Signed-off-by: Christoph Hellwig --- diff --git a/repair/incore.h b/repair/incore.h index ee0e86acd..8e311c9e4 100644 --- a/repair/incore.h +++ b/repair/incore.h @@ -311,6 +311,12 @@ void get_inode_rec(struct xfs_mount *mp, xfs_agnumber_t agno, ino_tree_node_t *ino_rec); extern avltree_desc_t **inode_tree_ptrs; + +static inline int +get_inode_offset(struct xfs_mount *mp, xfs_ino_t ino, ino_tree_node_t *irec) +{ + return XFS_INO_TO_AGINO(mp, ino) - irec->ino_startnum; +} static inline ino_tree_node_t * findfirst_inode_rec(xfs_agnumber_t agno) {