usr/src/grub/grub-0.97/stage2/fsys_zfs.h
changeset 10056 9f478b0e65da
parent 8044 b3af80bbf173
child 11670 1d964fb5d948
--- a/usr/src/grub/grub-0.97/stage2/fsys_zfs.h	Wed Jul 08 04:04:58 2009 -0700
+++ b/usr/src/grub/grub-0.97/stage2/fsys_zfs.h	Wed Jul 08 08:44:27 2009 -0600
@@ -17,14 +17,12 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #ifndef _FSYS_ZFS_H
 #define	_FSYS_ZFS_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #ifdef	FSYS_ZFS
 
 typedef unsigned long long uint64_t;
@@ -121,6 +119,15 @@
 	((offset + VDEV_LABEL_START_SIZE) >> SPA_MINBLOCKSHIFT)
 
 /*
+ * return x rounded down to an align boundary
+ * eg, P2ALIGN(1200, 1024) == 1024 (1*align)
+ * eg, P2ALIGN(1024, 1024) == 1024 (1*align)
+ * eg, P2ALIGN(0x1234, 0x100) == 0x1200 (0x12*align)
+ * eg, P2ALIGN(0x5600, 0x100) == 0x5600 (0x56*align)
+ */
+#define	P2ALIGN(x, align)		((x) & -(align))
+
+/*
  * For nvlist manipulation. (from nvpair.h)
  */
 #define	NV_ENCODE_NATIVE	0