* [PATCH 01/15] small cleanups in xfs_btree.c
@ 2008-07-23 20:08 Christoph Hellwig
2008-07-24 23:16 ` Dave Chinner
2008-07-29 3:58 ` Timothy Shimmin
0 siblings, 2 replies; 3+ messages in thread
From: Christoph Hellwig @ 2008-07-23 20:08 UTC (permalink / raw)
To: xfs
[-- Attachment #1: xfs-btree-cleanup --]
[-- Type: text/plain, Size: 3291 bytes --]
- remove unneeded xfs_btree_get_block forward declaration
- move xfs_btree_firstrec next to xfs_btree_lastrec
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6-xfs/fs/xfs/xfs_btree.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-06 16:08:37.000000000 +0200
+++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-06 16:12:13.000000000 +0200
@@ -46,38 +46,11 @@ kmem_zone_t *xfs_btree_cur_zone;
/*
* Btree magic numbers.
*/
-const __uint32_t xfs_magics[XFS_BTNUM_MAX] =
-{
+const __uint32_t xfs_magics[XFS_BTNUM_MAX] = {
XFS_ABTB_MAGIC, XFS_ABTC_MAGIC, XFS_BMAP_MAGIC, XFS_IBT_MAGIC
};
/*
- * Prototypes for internal routines.
- */
-
-/*
- * Checking routine: return maxrecs for the block.
- */
-STATIC int /* number of records fitting in block */
-xfs_btree_maxrecs(
- xfs_btree_cur_t *cur, /* btree cursor */
- xfs_btree_block_t *block);/* generic btree block pointer */
-
-/*
- * Internal routines.
- */
-
-/*
- * Retrieve the block pointer from the cursor at the given level.
- * This may be a bmap btree root or from a buffer.
- */
-STATIC xfs_btree_block_t * /* generic btree block pointer */
-xfs_btree_get_block(
- xfs_btree_cur_t *cur, /* btree cursor */
- int level, /* level in btree */
- struct xfs_buf **bpp); /* buffer containing the block */
-
-/*
* Checking routine: return maxrecs for the block.
*/
STATIC int /* number of records fitting in block */
@@ -457,35 +430,6 @@ xfs_btree_dup_cursor(
}
/*
- * Change the cursor to point to the first record at the given level.
- * Other levels are unaffected.
- */
-int /* success=1, failure=0 */
-xfs_btree_firstrec(
- xfs_btree_cur_t *cur, /* btree cursor */
- int level) /* level to change */
-{
- xfs_btree_block_t *block; /* generic btree block pointer */
- xfs_buf_t *bp; /* buffer containing block */
-
- /*
- * Get the block pointer for this level.
- */
- block = xfs_btree_get_block(cur, level, &bp);
- xfs_btree_check_block(cur, block, level, bp);
- /*
- * It's empty, there is no such record.
- */
- if (!block->bb_h.bb_numrecs)
- return 0;
- /*
- * Set the ptr value to 1, that's the first record/key.
- */
- cur->bc_ptrs[level] = 1;
- return 1;
-}
-
-/*
* Retrieve the block pointer from the cursor at the given level.
* This may be a bmap btree root or from a buffer.
*/
@@ -671,6 +615,35 @@ xfs_btree_islastblock(
}
/*
+ * Change the cursor to point to the first record at the given level.
+ * Other levels are unaffected.
+ */
+int /* success=1, failure=0 */
+xfs_btree_firstrec(
+ xfs_btree_cur_t *cur, /* btree cursor */
+ int level) /* level to change */
+{
+ xfs_btree_block_t *block; /* generic btree block pointer */
+ xfs_buf_t *bp; /* buffer containing block */
+
+ /*
+ * Get the block pointer for this level.
+ */
+ block = xfs_btree_get_block(cur, level, &bp);
+ xfs_btree_check_block(cur, block, level, bp);
+ /*
+ * It's empty, there is no such record.
+ */
+ if (!block->bb_h.bb_numrecs)
+ return 0;
+ /*
+ * Set the ptr value to 1, that's the first record/key.
+ */
+ cur->bc_ptrs[level] = 1;
+ return 1;
+}
+
+/*
* Change the cursor to point to the last record in the current block
* at the given level. Other levels are unaffected.
*/
--
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 01/15] small cleanups in xfs_btree.c
2008-07-23 20:08 [PATCH 01/15] small cleanups in xfs_btree.c Christoph Hellwig
@ 2008-07-24 23:16 ` Dave Chinner
2008-07-29 3:58 ` Timothy Shimmin
1 sibling, 0 replies; 3+ messages in thread
From: Dave Chinner @ 2008-07-24 23:16 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
On Wed, Jul 23, 2008 at 10:08:20PM +0200, Christoph Hellwig wrote:
> - remove unneeded xfs_btree_get_block forward declaration
> - move xfs_btree_firstrec next to xfs_btree_lastrec
looks good to me.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 01/15] small cleanups in xfs_btree.c
2008-07-23 20:08 [PATCH 01/15] small cleanups in xfs_btree.c Christoph Hellwig
2008-07-24 23:16 ` Dave Chinner
@ 2008-07-29 3:58 ` Timothy Shimmin
1 sibling, 0 replies; 3+ messages in thread
From: Timothy Shimmin @ 2008-07-29 3:58 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
Fine (not much going on there:).
I'll check it in.
--Tim
Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> Index: linux-2.6-xfs/fs/xfs/xfs_btree.c
> ===================================================================
> --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-06 16:08:37.000000000 +0200
> +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-06 16:12:13.000000000 +0200
> @@ -46,38 +46,11 @@ kmem_zone_t *xfs_btree_cur_zone;
> /*
> * Btree magic numbers.
> */
> -const __uint32_t xfs_magics[XFS_BTNUM_MAX] =
> -{
> +const __uint32_t xfs_magics[XFS_BTNUM_MAX] = {
> XFS_ABTB_MAGIC, XFS_ABTC_MAGIC, XFS_BMAP_MAGIC, XFS_IBT_MAGIC
> };
>
> /*
> - * Prototypes for internal routines.
> - */
> -
> -/*
> - * Checking routine: return maxrecs for the block.
> - */
> -STATIC int /* number of records fitting in block */
> -xfs_btree_maxrecs(
> - xfs_btree_cur_t *cur, /* btree cursor */
> - xfs_btree_block_t *block);/* generic btree block pointer */
> -
> -/*
> - * Internal routines.
> - */
> -
> -/*
> - * Retrieve the block pointer from the cursor at the given level.
> - * This may be a bmap btree root or from a buffer.
> - */
> -STATIC xfs_btree_block_t * /* generic btree block pointer */
> -xfs_btree_get_block(
> - xfs_btree_cur_t *cur, /* btree cursor */
> - int level, /* level in btree */
> - struct xfs_buf **bpp); /* buffer containing the block */
> -
> -/*
> * Checking routine: return maxrecs for the block.
> */
> STATIC int /* number of records fitting in block */
> @@ -457,35 +430,6 @@ xfs_btree_dup_cursor(
> }
>
> /*
> - * Change the cursor to point to the first record at the given level.
> - * Other levels are unaffected.
> - */
> -int /* success=1, failure=0 */
> -xfs_btree_firstrec(
> - xfs_btree_cur_t *cur, /* btree cursor */
> - int level) /* level to change */
> -{
> - xfs_btree_block_t *block; /* generic btree block pointer */
> - xfs_buf_t *bp; /* buffer containing block */
> -
> - /*
> - * Get the block pointer for this level.
> - */
> - block = xfs_btree_get_block(cur, level, &bp);
> - xfs_btree_check_block(cur, block, level, bp);
> - /*
> - * It's empty, there is no such record.
> - */
> - if (!block->bb_h.bb_numrecs)
> - return 0;
> - /*
> - * Set the ptr value to 1, that's the first record/key.
> - */
> - cur->bc_ptrs[level] = 1;
> - return 1;
> -}
> -
> -/*
> * Retrieve the block pointer from the cursor at the given level.
> * This may be a bmap btree root or from a buffer.
> */
> @@ -671,6 +615,35 @@ xfs_btree_islastblock(
> }
>
> /*
> + * Change the cursor to point to the first record at the given level.
> + * Other levels are unaffected.
> + */
> +int /* success=1, failure=0 */
> +xfs_btree_firstrec(
> + xfs_btree_cur_t *cur, /* btree cursor */
> + int level) /* level to change */
> +{
> + xfs_btree_block_t *block; /* generic btree block pointer */
> + xfs_buf_t *bp; /* buffer containing block */
> +
> + /*
> + * Get the block pointer for this level.
> + */
> + block = xfs_btree_get_block(cur, level, &bp);
> + xfs_btree_check_block(cur, block, level, bp);
> + /*
> + * It's empty, there is no such record.
> + */
> + if (!block->bb_h.bb_numrecs)
> + return 0;
> + /*
> + * Set the ptr value to 1, that's the first record/key.
> + */
> + cur->bc_ptrs[level] = 1;
> + return 1;
> +}
> +
> +/*
> * Change the cursor to point to the last record in the current block
> * at the given level. Other levels are unaffected.
> */
>
> --
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-07-29 3:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-23 20:08 [PATCH 01/15] small cleanups in xfs_btree.c Christoph Hellwig
2008-07-24 23:16 ` Dave Chinner
2008-07-29 3:58 ` Timothy Shimmin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox