]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/xfs/xfs_alloc_btree.h
Merge branch 'nfs-server-stable' of git://linux-nfs.org/~bfields/linux
[mv-sheeva.git] / fs / xfs / xfs_alloc_btree.h
index f857b0f248d3639e29ed40ce1216830b8cda1d50..5bd1a2c8bd0712a4ba05828802b8d7fb763727e2 100644 (file)
@@ -1,33 +1,19 @@
 /*
- * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000,2005 Silicon Graphics, Inc.
+ * All Rights Reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation.
  *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write the Free Software Foundation,
+ * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 #ifndef __XFS_ALLOC_BTREE_H__
 #define        __XFS_ALLOC_BTREE_H__
@@ -52,14 +38,19 @@ struct xfs_mount;
 /*
  * Data record/key structure
  */
-typedef struct xfs_alloc_rec
-{
+typedef struct xfs_alloc_rec {
+       __be32          ar_startblock;  /* starting block number */
+       __be32          ar_blockcount;  /* count of free blocks */
+} xfs_alloc_rec_t, xfs_alloc_key_t;
+
+typedef struct xfs_alloc_rec_incore {
        xfs_agblock_t   ar_startblock;  /* starting block number */
        xfs_extlen_t    ar_blockcount;  /* count of free blocks */
-} xfs_alloc_rec_t, xfs_alloc_key_t;
+} xfs_alloc_rec_incore_t;
 
-typedef xfs_agblock_t xfs_alloc_ptr_t; /* btree pointer type */
-                                       /* btree block header type */
+/* btree pointer type */
+typedef __be32 xfs_alloc_ptr_t;
+/* btree block header type */
 typedef        struct xfs_btree_sblock xfs_alloc_block_t;
 
 #define        XFS_BUF_TO_ALLOC_BLOCK(bp)      ((xfs_alloc_block_t *)XFS_BUF_PTR(bp))
@@ -67,7 +58,6 @@ typedef       struct xfs_btree_sblock xfs_alloc_block_t;
 /*
  * Real block structures have a size equal to the disk block size.
  */
-#define        XFS_ALLOC_BLOCK_SIZE(lev,cur)   (1 << (cur)->bc_blocklog)
 #define        XFS_ALLOC_BLOCK_MAXRECS(lev,cur) ((cur)->bc_mp->m_alloc_mxr[lev != 0])
 #define        XFS_ALLOC_BLOCK_MINRECS(lev,cur) ((cur)->bc_mp->m_alloc_mnr[lev != 0])
 
@@ -96,16 +86,13 @@ typedef     struct xfs_btree_sblock xfs_alloc_block_t;
  * Record, key, and pointer address macros for btree blocks.
  */
 #define        XFS_ALLOC_REC_ADDR(bb,i,cur)    \
-       XFS_BTREE_REC_ADDR(XFS_ALLOC_BLOCK_SIZE(0,cur), xfs_alloc, \
-                               bb, i, XFS_ALLOC_BLOCK_MAXRECS(0, cur))
+       XFS_BTREE_REC_ADDR(xfs_alloc, bb, i)
 
 #define        XFS_ALLOC_KEY_ADDR(bb,i,cur)    \
-       XFS_BTREE_KEY_ADDR(XFS_ALLOC_BLOCK_SIZE(1,cur), xfs_alloc, \
-                               bb, i, XFS_ALLOC_BLOCK_MAXRECS(1, cur))
+       XFS_BTREE_KEY_ADDR(xfs_alloc, bb, i)
 
 #define        XFS_ALLOC_PTR_ADDR(bb,i,cur)    \
-       XFS_BTREE_PTR_ADDR(XFS_ALLOC_BLOCK_SIZE(1,cur), xfs_alloc, \
-                               bb, i, XFS_ALLOC_BLOCK_MAXRECS(1, cur))
+       XFS_BTREE_PTR_ADDR(xfs_alloc, bb, i, XFS_ALLOC_BLOCK_MAXRECS(1, cur))
 
 /*
  * Decrement cursor by one record at the level.