usr/src/grub/grub-0.97/stage2/fsys_zfs.h
changeset 10056 9f478b0e65da
parent 8044 b3af80bbf173
child 11670 1d964fb5d948
equal deleted inserted replaced
10055:c14dc8a84103 10056:9f478b0e65da
    15  *  You should have received a copy of the GNU General Public License
    15  *  You should have received a copy of the GNU General Public License
    16  *  along with this program; if not, write to the Free Software
    16  *  along with this program; if not, write to the Free Software
    17  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    17  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    18  */
    18  */
    19 /*
    19 /*
    20  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
    20  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
    21  * Use is subject to license terms.
    21  * Use is subject to license terms.
    22  */
    22  */
    23 #ifndef _FSYS_ZFS_H
    23 #ifndef _FSYS_ZFS_H
    24 #define	_FSYS_ZFS_H
    24 #define	_FSYS_ZFS_H
    25 
       
    26 #pragma ident	"%Z%%M%	%I%	%E% SMI"
       
    27 
    25 
    28 #ifdef	FSYS_ZFS
    26 #ifdef	FSYS_ZFS
    29 
    27 
    30 typedef unsigned long long uint64_t;
    28 typedef unsigned long long uint64_t;
    31 typedef unsigned int uint32_t;
    29 typedef unsigned int uint32_t;
   119 #define	P2PHASE(x, align)		((x) & ((align) - 1))
   117 #define	P2PHASE(x, align)		((x) & ((align) - 1))
   120 #define	DVA_OFFSET_TO_PHYS_SECTOR(offset) \
   118 #define	DVA_OFFSET_TO_PHYS_SECTOR(offset) \
   121 	((offset + VDEV_LABEL_START_SIZE) >> SPA_MINBLOCKSHIFT)
   119 	((offset + VDEV_LABEL_START_SIZE) >> SPA_MINBLOCKSHIFT)
   122 
   120 
   123 /*
   121 /*
       
   122  * return x rounded down to an align boundary
       
   123  * eg, P2ALIGN(1200, 1024) == 1024 (1*align)
       
   124  * eg, P2ALIGN(1024, 1024) == 1024 (1*align)
       
   125  * eg, P2ALIGN(0x1234, 0x100) == 0x1200 (0x12*align)
       
   126  * eg, P2ALIGN(0x5600, 0x100) == 0x5600 (0x56*align)
       
   127  */
       
   128 #define	P2ALIGN(x, align)		((x) & -(align))
       
   129 
       
   130 /*
   124  * For nvlist manipulation. (from nvpair.h)
   131  * For nvlist manipulation. (from nvpair.h)
   125  */
   132  */
   126 #define	NV_ENCODE_NATIVE	0
   133 #define	NV_ENCODE_NATIVE	0
   127 #define	NV_ENCODE_XDR		1
   134 #define	NV_ENCODE_XDR		1
   128 #define	HOST_ENDIAN		1	/* for x86 machine */
   135 #define	HOST_ENDIAN		1	/* for x86 machine */