]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/xfs/xfs_btree.h
[CRYPTO] pcbc: Add Propagated CBC template
[linux-2.6-omap-h63xx.git] / fs / xfs / xfs_btree.h
index 30ee83712c7907926b8bb240942869467be8af0c..892b06c542637219d46be0f67798fa0e545fd43d 100644 (file)
@@ -1,33 +1,19 @@
 /*
- * Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2001,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_BTREE_H__
 #define        __XFS_BTREE_H__
@@ -53,25 +39,23 @@ struct xfs_trans;
 /*
  * Short form header: space allocation btrees.
  */
-typedef struct xfs_btree_sblock
-{
-       __uint32_t      bb_magic;       /* magic number for block type */
-       __uint16_t      bb_level;       /* 0 is a leaf */
-       __uint16_t      bb_numrecs;     /* current # of data records */
-       xfs_agblock_t   bb_leftsib;     /* left sibling block or NULLAGBLOCK */
-       xfs_agblock_t   bb_rightsib;    /* right sibling block or NULLAGBLOCK */
+typedef struct xfs_btree_sblock {
+       __be32          bb_magic;       /* magic number for block type */
+       __be16          bb_level;       /* 0 is a leaf */
+       __be16          bb_numrecs;     /* current # of data records */
+       __be32          bb_leftsib;     /* left sibling block or NULLAGBLOCK */
+       __be32          bb_rightsib;    /* right sibling block or NULLAGBLOCK */
 } xfs_btree_sblock_t;
 
 /*
  * Long form header: bmap btrees.
  */
-typedef struct xfs_btree_lblock
-{
-       __uint32_t      bb_magic;       /* magic number for block type */
-       __uint16_t      bb_level;       /* 0 is a leaf */
-       __uint16_t      bb_numrecs;     /* current # of data records */
-       xfs_dfsbno_t    bb_leftsib;     /* left sibling block or NULLDFSBNO */
-       xfs_dfsbno_t    bb_rightsib;    /* right sibling block or NULLDFSBNO */
+typedef struct xfs_btree_lblock {
+       __be32          bb_magic;       /* magic number for block type */
+       __be16          bb_level;       /* 0 is a leaf */
+       __be16          bb_numrecs;     /* current # of data records */
+       __be64          bb_leftsib;     /* left sibling block or NULLDFSBNO */
+       __be64          bb_rightsib;    /* right sibling block or NULLDFSBNO */
 } xfs_btree_lblock_t;
 
 /*
@@ -79,24 +63,23 @@ typedef struct xfs_btree_lblock
  */
 typedef struct xfs_btree_hdr
 {
-       __uint32_t      bb_magic;       /* magic number for block type */
-       __uint16_t      bb_level;       /* 0 is a leaf */
-       __uint16_t      bb_numrecs;     /* current # of data records */
+       __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
-{
+typedef struct xfs_btree_block {
        xfs_btree_hdr_t bb_h;           /* header */
-       union           {
-               struct  {
-                       xfs_agblock_t   bb_leftsib;
-                       xfs_agblock_t   bb_rightsib;
-               }       s;              /* short form pointers */
+       union {
+               struct {
+                       __be32          bb_leftsib;
+                       __be32          bb_rightsib;
+               } s;                    /* short form pointers */
                struct  {
-                       xfs_dfsbno_t    bb_leftsib;
-                       xfs_dfsbno_t    bb_rightsib;
-               }       l;              /* long form pointers */
-       }               bb_u;           /* rest */
+                       __be64          bb_leftsib;
+                       __be64          bb_rightsib;
+               } l;                    /* long form pointers */
+       } bb_u;                         /* rest */
 } xfs_btree_block_t;
 
 /*
@@ -160,9 +143,9 @@ typedef struct xfs_btree_cur
        struct xfs_trans        *bc_tp; /* transaction we're in, if any */
        struct xfs_mount        *bc_mp; /* file system mount struct */
        union {
-               xfs_alloc_rec_t         a;
+               xfs_alloc_rec_incore_t  a;
                xfs_bmbt_irec_t         b;
-               xfs_inobt_rec_t         i;
+               xfs_inobt_rec_incore_t  i;
        }               bc_rec;         /* current insert/search record value */
        struct xfs_buf  *bc_bufs[XFS_BTREE_MAXLEVELS];  /* buf ptr per level */
        int             bc_ptrs[XFS_BTREE_MAXLEVELS];   /* key/record # */
@@ -260,6 +243,9 @@ xfs_btree_check_lptr(
        xfs_dfsbno_t            ptr,    /* btree block disk address */
        int                     level); /* btree block level */
 
+#define xfs_btree_check_lptr_disk(cur, ptr, level) \
+       xfs_btree_check_lptr(cur, be64_to_cpu(ptr), level)
+
 /*
  * Checking routine: check that short form block header is ok.
  */