public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/26] kill struct xfs_btree_hdr
@ 2008-08-04  1:32 Christoph Hellwig
  2008-08-04  1:46 ` Dave Chinner
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2008-08-04  1:32 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: xfs-kill-btree-hdr --]
[-- Type: text/plain, Size: 2541 bytes --]

This type is only embedded in struct xfs_btree_block and never used
directly.  By moving the fields directly into struct xfs_btree_block
a lot of the macros for struct xfs_btree_sblock and struct xfs_btree_lblock
can be used for struct xfs_btree_block too now which helps greatly
with some of the migrations during implementing the generic btree code.


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-08-02 04:01:21.000000000 +0200
+++ linux-2.6-xfs/fs/xfs/xfs_btree.c	2008-08-02 04:04:22.000000000 +0200
@@ -62,13 +62,13 @@ xfs_btree_maxrecs(
 	case XFS_BTNUM_BNO:
 	case XFS_BTNUM_CNT:
 		return (int)XFS_ALLOC_BLOCK_MAXRECS(
-				be16_to_cpu(block->bb_h.bb_level), cur);
+				be16_to_cpu(block->bb_level), cur);
 	case XFS_BTNUM_BMAP:
 		return (int)XFS_BMAP_BLOCK_IMAXRECS(
-				be16_to_cpu(block->bb_h.bb_level), cur);
+				be16_to_cpu(block->bb_level), cur);
 	case XFS_BTNUM_INO:
 		return (int)XFS_INOBT_BLOCK_MAXRECS(
-				be16_to_cpu(block->bb_h.bb_level), cur);
+				be16_to_cpu(block->bb_level), cur);
 	default:
 		ASSERT(0);
 		return 0;
@@ -634,7 +634,7 @@ xfs_btree_firstrec(
 	/*
 	 * It's empty, there is no such record.
 	 */
-	if (!block->bb_h.bb_numrecs)
+	if (!block->bb_numrecs)
 		return 0;
 	/*
 	 * Set the ptr value to 1, that's the first record/key.
@@ -663,12 +663,12 @@ xfs_btree_lastrec(
 	/*
 	 * It's empty, there is no such record.
 	 */
-	if (!block->bb_h.bb_numrecs)
+	if (!block->bb_numrecs)
 		return 0;
 	/*
 	 * Set the ptr value to numrecs, that's the last record/key.
 	 */
-	cur->bc_ptrs[level] = be16_to_cpu(block->bb_h.bb_numrecs);
+	cur->bc_ptrs[level] = be16_to_cpu(block->bb_numrecs);
 	return 1;
 }
 
Index: linux-2.6-xfs/fs/xfs/xfs_btree.h
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h	2008-08-02 04:00:28.000000000 +0200
+++ linux-2.6-xfs/fs/xfs/xfs_btree.h	2008-08-02 04:05:00.000000000 +0200
@@ -63,15 +63,10 @@ typedef struct xfs_btree_lblock {
 /*
  * Combined header and structure, used by common code.
  */
-typedef struct xfs_btree_hdr
-{
+typedef struct xfs_btree_block {
 	__be32		bb_magic;	/* magic number for block type */
 	__be16		bb_level;	/* 0 is a leaf */
 	__be16		bb_numrecs;	/* current # of data records */
-} xfs_btree_hdr_t;
-
-typedef struct xfs_btree_block {
-	xfs_btree_hdr_t	bb_h;		/* header */
 	union {
 		struct {
 			__be32		bb_leftsib;

-- 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-08-04  1:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-04  1:32 [PATCH 01/26] kill struct xfs_btree_hdr Christoph Hellwig
2008-08-04  1:46 ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox