]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
bump version to 2.2, document changes -- sync shared headers, EVMS stripe v2.2.0
authorNathan Scott <nathans@sgi.com>
Thu, 8 Aug 2002 06:35:44 +0000 (06:35 +0000)
committerNathan Scott <nathans@sgi.com>
Thu, 8 Aug 2002 06:35:44 +0000 (06:35 +0000)
unit/width extraction, mkfs defaults to 4K blocksize again (as on IRIX) &
no longer punts on using the current pagesize.

20 files changed:
VERSION
debian/changelog
doc/CHANGES
include/Makefile
include/arch.h [deleted file]
include/libxfs.h
include/xfs_acl.h
include/xfs_arch.h
include/xfs_buf_item.h
include/xfs_cap.h
include/xfs_da_btree.h
include/xfs_extfree_item.h
include/xfs_inode.h
libdisk/Makefile
libdisk/drivers.c
libdisk/evms.c [new file with mode: 0644]
libdisk/evms.h [new file with mode: 0644]
libdisk/md.c
libxfs/xfs.h
mkfs/xfs_mkfs.c

diff --git a/VERSION b/VERSION
index 7b958737fdf8812ea40ef8d09493914e010d56af..5cafc9fcbbee3b929a9275614716cdce1b24de6b 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,6 +2,6 @@
 # This file is used by configure to get version information
 #
 PKG_MAJOR=2
-PKG_MINOR=1
-PKG_REVISION=2
+PKG_MINOR=2
+PKG_REVISION=0
 PKG_BUILD=0
index b252f3f2f6c0c7a8bb1f97fb384e9257debd53f5..32fe9abd061db688be3cd43f528a8294f3d33fc5 100644 (file)
@@ -1,3 +1,10 @@
+xfsprogs (2.2.0-1) unstable; urgency=low
+
+  * New upstream release
+  * Default mkfs.xfs blocksize is now 4096 bytes, not getpagesize(2)
+
+ -- Nathan Scott <nathans@debian.org>  Wed,  7 Aug 2002 11:37:23 +1000
+
 xfsprogs (2.1.2-1) unstable; urgency=low
 
   * New upstream release
index b0b4018919a2ccb19e3a8878e85316e85192efb6..6951681c9462a65f1bb26f0a7468268828227b9c 100644 (file)
@@ -1,8 +1,16 @@
+xfsprogs-2.2.0 (08 August 2002)
+       - mkfs.xfs defaults to a blocksize of 4096 bytes, and no longer
+         uses getpagesize(2) to dynamically configure the default size.
+       - Add EVMS stripe unit/width auto-detection support in mkfs.xfs
+         (patch from Luciano Chavez).
+       - Sync user/kernel headers (arch.h incorporated into xfs_arch.h,
+         and several other minor changes).
+
 xfsprogs-2.1.2 (17 July 2002)
        - Fix up log stripe unit specification options, and update
          man page.  Also fix suffix handling for data su/sw options
-         (disallow unit suffixes on -d sunit,swidth,sw and
-         -l sunit).  Add "s" (512-byte sectors) as valid suffix.
+         (disallow unit suffixes on -d sunit,swidth,sw and -l sunit).
+         Add "s" (512-byte sectors) as valid suffix.
        - Automatically select v2 logs if a log stripe unit is
          specified.
 
@@ -13,7 +21,7 @@ xfsprogs-2.1.1 (04 July 2002)
          now allows /lib64 and /lib32
 
 xfsprogs-2.1.0 (14 June 2002)
-       - support for xfs version 2 log format.
+       - Support for XFS version 2 log format.
        - Fix for xfs_repair mangling i8count for dir2_sf directories
        - Minor mkfs.xfs man page update for blocksize limits on Linux
        - xfs_cred.h split into xfs_acl.h, xfs_cap.h and xfs_mac.h
index 018948b9e7834f3f091ce1d27e38090886599d3b..745a0a0888acc63f547da1feea651e6384f78b0d 100644 (file)
@@ -33,7 +33,7 @@
 TOPDIR = ..
 include $(TOPDIR)/include/builddefs
 
-HFILES = arch.h handle.h jdm.h libxfs.h libxlog.h xqm.h \
+HFILES = handle.h jdm.h libxfs.h libxlog.h xqm.h \
        xfs_ag.h xfs_alloc.h xfs_alloc_btree.h xfs_arch.h xfs_attr_leaf.h \
        xfs_attr_sf.h xfs_bit.h xfs_bmap.h xfs_bmap_btree.h xfs_btree.h \
        xfs_buf_item.h xfs_da_btree.h xfs_dfrag.h xfs_dinode.h \
diff --git a/include/arch.h b/include/arch.h
deleted file mode 100644 (file)
index e6c922a..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Copyright (c) 2000-2002 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
- * 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.
- *
- * 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/
- */
-#ifndef __XFS_SUPPORT_ARCH_H__
-#define __XFS_SUPPORT_ARCH_H__
-
-#ifdef __KERNEL__
-
-#include <asm/byteorder.h>
-
-#ifdef __LITTLE_ENDIAN
-# define __BYTE_ORDER  __LITTLE_ENDIAN
-#endif
-#ifdef __BIG_ENDIAN
-# define __BYTE_ORDER  __BIG_ENDIAN
-#endif
-
-#endif /* __KERNEL__ */
-
-/* do we need conversion? */
-
-#define ARCH_NOCONVERT 1
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define ARCH_CONVERT   0
-#else
-#define ARCH_CONVERT   ARCH_NOCONVERT
-#endif
-
-/* generic swapping macros */
-
-#define INT_SWAP16(type,var) ((typeof(type))(__swab16((__u16)(var))))
-#define INT_SWAP32(type,var) ((typeof(type))(__swab32((__u32)(var))))
-#define INT_SWAP64(type,var) ((typeof(type))(__swab64((__u64)(var))))
-
-#define INT_SWAP(type, var) \
-    ((sizeof(type) == 8) ? INT_SWAP64(type,var) : \
-    ((sizeof(type) == 4) ? INT_SWAP32(type,var) : \
-    ((sizeof(type) == 2) ? INT_SWAP16(type,var) : \
-    (var))))
-
-#define INT_SWAP_UNALIGNED_32(from,to) \
-    { \
-       ((__u8*)(to))[0] = ((__u8*)(from))[3]; \
-       ((__u8*)(to))[1] = ((__u8*)(from))[2]; \
-       ((__u8*)(to))[2] = ((__u8*)(from))[1]; \
-       ((__u8*)(to))[3] = ((__u8*)(from))[0]; \
-    }
-
-#define INT_SWAP_UNALIGNED_64(from,to) \
-    { \
-       INT_SWAP_UNALIGNED_32( ((__u8*)(from)) + 4, ((__u8*)(to))); \
-       INT_SWAP_UNALIGNED_32( ((__u8*)(from)), ((__u8*)(to)) + 4); \
-    }
-
-/*
- * get and set integers from potentially unaligned locations
- */
-
-#define INT_GET_UNALIGNED_16_LE(pointer) \
-   ((__u16)((((__u8*)(pointer))[0]     ) | (((__u8*)(pointer))[1] << 8 )))
-#define INT_GET_UNALIGNED_16_BE(pointer) \
-   ((__u16)((((__u8*)(pointer))[0] << 8) | (((__u8*)(pointer))[1])))
-#define INT_SET_UNALIGNED_16_LE(pointer,value) \
-    { \
-       ((__u8*)(pointer))[0] = (((value)     ) & 0xff); \
-       ((__u8*)(pointer))[1] = (((value) >> 8) & 0xff); \
-    }
-#define INT_SET_UNALIGNED_16_BE(pointer,value) \
-    { \
-       ((__u8*)(pointer))[0] = (((value) >> 8) & 0xff); \
-       ((__u8*)(pointer))[1] = (((value)     ) & 0xff); \
-    }
-
-#define INT_GET_UNALIGNED_32_LE(pointer) \
-   ((__u32)((((__u8*)(pointer))[0]     ) | (((__u8*)(pointer))[1] << 8 ) \
-          |(((__u8*)(pointer))[2] << 16) | (((__u8*)(pointer))[3] << 24)))
-#define INT_GET_UNALIGNED_32_BE(pointer) \
-   ((__u32)((((__u8*)(pointer))[0] << 24) | (((__u8*)(pointer))[1] << 16) \
-          |(((__u8*)(pointer))[2] << 8)  | (((__u8*)(pointer))[3]      )))
-
-#define INT_GET_UNALIGNED_64_LE(pointer) \
-   (((__u64)(INT_GET_UNALIGNED_32_LE(((__u8*)(pointer))+4)) << 32 ) \
-   |((__u64)(INT_GET_UNALIGNED_32_LE(((__u8*)(pointer))         ))       ))
-#define INT_GET_UNALIGNED_64_BE(pointer) \
-   (((__u64)(INT_GET_UNALIGNED_32_BE(((__u8*)(pointer))         )) << 32  ) \
-   |((__u64)(INT_GET_UNALIGNED_32_BE(((__u8*)(pointer))+4))       ))
-
-/*
- * now pick the right ones for our MACHINE ARCHITECTURE
- */
-
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define INT_GET_UNALIGNED_16(pointer)      INT_GET_UNALIGNED_16_LE(pointer)
-#define INT_SET_UNALIGNED_16(pointer,value) INT_SET_UNALIGNED_16_LE(pointer,value)
-#define INT_GET_UNALIGNED_32(pointer)      INT_GET_UNALIGNED_32_LE(pointer)
-#define INT_GET_UNALIGNED_64(pointer)      INT_GET_UNALIGNED_64_LE(pointer)
-#else
-#define INT_GET_UNALIGNED_16(pointer)      INT_GET_UNALIGNED_16_BE(pointer)
-#define INT_SET_UNALIGNED_16(pointer,value) INT_SET_UNALIGNED_16_BE(pointer,value)
-#define INT_GET_UNALIGNED_32(pointer)      INT_GET_UNALIGNED_32_BE(pointer)
-#define INT_GET_UNALIGNED_64(pointer)      INT_GET_UNALIGNED_64_BE(pointer)
-#endif
-
-/* define generic INT_ macros */
-
-#define INT_GET(reference,arch) \
-    (((arch) == ARCH_NOCONVERT) \
-       ? \
-           (reference) \
-       : \
-           INT_SWAP((reference),(reference)) \
-    )
-
-/* does not return a value */
-#define INT_SET(reference,arch,valueref) \
-    (__builtin_constant_p(valueref) ? \
-       (void)( (reference) = ( ((arch) != ARCH_NOCONVERT) ? (INT_SWAP((reference),(valueref))) : (valueref)) ) : \
-       (void)( \
-           ((reference) = (valueref)), \
-           ( ((arch) != ARCH_NOCONVERT) ? (reference) = INT_SWAP((reference),(reference)) : 0 ) \
-       ) \
-    )
-
-/* does not return a value */
-#define INT_MOD_EXPR(reference,arch,code) \
-    (void)(((arch) == ARCH_NOCONVERT) \
-       ? \
-           ((reference) code) \
-       : \
-           ( \
-               (reference) = INT_GET((reference),arch) , \
-               ((reference) code), \
-               INT_SET(reference, arch, reference) \
-           ) \
-    )
-
-/* does not return a value */
-#define INT_MOD(reference,arch,delta) \
-    (void)( \
-       INT_MOD_EXPR(reference,arch,+=(delta)) \
-    )
-
-/*
- * INT_COPY - copy a value between two locations with the
- *           _same architecture_ but _potentially different sizes_
- *
- *         if the types of the two parameters are equal or they are
- *             in native architecture, a simple copy is done
- *
- *         otherwise, architecture conversions are done
- *
- */
-
-/* does not return a value */
-#define INT_COPY(dst,src,arch) \
-    (void)( \
-       ((sizeof(dst) == sizeof(src)) || ((arch) == ARCH_NOCONVERT)) \
-           ? \
-               ((dst) = (src)) \
-           : \
-               INT_SET(dst, arch, INT_GET(src, arch)) \
-    )
-
-/*
- * INT_XLATE - copy a value in either direction between two locations
- *            with different architectures
- *
- *                 dir < 0     - copy from memory to buffer (native to arch)
- *                 dir > 0     - copy from buffer to memory (arch to native)
- */
-
-/* does not return a value */
-#define INT_XLATE(buf,mem,dir,arch) {\
-    ASSERT(dir); \
-    if (dir>0) { \
-       (mem)=INT_GET(buf, arch); \
-    } else { \
-       INT_SET(buf, arch, mem); \
-    } \
-}
-
-#define INT_ISZERO(reference,arch) \
-    ((reference) == 0)
-
-#define INT_ZERO(reference,arch) \
-    ((reference) = 0)
-
-#define INT_GET_UNALIGNED_16_ARCH(pointer,arch) \
-    ( ((arch) == ARCH_NOCONVERT) \
-       ? \
-           (INT_GET_UNALIGNED_16(pointer)) \
-       : \
-           (INT_GET_UNALIGNED_16_BE(pointer)) \
-    )
-#define INT_SET_UNALIGNED_16_ARCH(pointer,value,arch) \
-    if ((arch) == ARCH_NOCONVERT) { \
-       INT_SET_UNALIGNED_16(pointer,value); \
-    } else { \
-       INT_SET_UNALIGNED_16_BE(pointer,value); \
-    }
-
-#endif /* __XFS_SUPPORT_ARCH_H__ */
index 9f91e0076724c4f236d2a507774601539fb2a90c..431a7831bf5327a981a9c58700b56d720c399f7e 100644 (file)
@@ -36,7 +36,6 @@
 
 #include <xfs_fs.h>
 #include <xfs_types.h>
-#include <arch.h>
 #include <xfs_arch.h>
 #include <xfs_sb.h>
 #include <xfs_bit.h>
@@ -303,9 +302,9 @@ extern int  libxfs_trans_read_buf (xfs_mount_t *, xfs_trans_t *, dev_t,
  * Simple memory interface
  */
 typedef struct xfs_zone {
-       int     zone_unitsize;  /* Size in bytes of zone unit           */
-       char    *zone_name;     /* tag name                             */
-        int     allocated;      /* debug: How many currently allocated  */
+       int     zone_unitsize;  /* Size in bytes of zone unit           */
+       char    *zone_name;     /* tag name                             */
+       int     allocated;      /* debug: How many currently allocated  */
 } xfs_zone_t;
 
 extern xfs_zone_t      *libxfs_zone_init (int, char *);
index 9a15c73bde937d1baaa6efb710136b273d5d2369..f50ffde0c483116eb3ef16b81d9f9ec932359d31 100644 (file)
@@ -80,7 +80,7 @@ extern int xfs_acl_vset(struct vnode *, void *, size_t, int);
 extern int xfs_acl_vget(struct vnode *, void *, size_t, int);
 extern int xfs_acl_vremove(struct vnode *vp, int);
 
-extern struct xfs_zone *xfs_acl_zone;
+extern struct kmem_zone *xfs_acl_zone;
 
 #define _ACL_TYPE_ACCESS       1
 #define _ACL_TYPE_DEFAULT      2
@@ -101,9 +101,9 @@ extern struct xfs_zone *xfs_acl_zone;
 #define _ACL_CLEAR_IFLAG(inode) ((inode)->i_flags &= ~S_POSIXACL)
 
 #else
-#define xfs_acl_vset(v,p,sz,t) (-ENOTSUP)
-#define xfs_acl_vget(v,p,sz,t) (-ENOTSUP)
-#define xfs_acl_vremove(v,t)   (-ENOTSUP)
+#define xfs_acl_vset(v,p,sz,t) (-EOPNOTSUPP)
+#define xfs_acl_vget(v,p,sz,t) (-EOPNOTSUPP)
+#define xfs_acl_vremove(v,t)   (-EOPNOTSUPP)
 #define _ACL_DECL(a)           ((void)0)
 #define _ACL_ALLOC(a)          (1)     /* successfully allocate nothing */
 #define _ACL_FREE(a)           ((void)0)
index 2841d673a73bbabe86e41f481d343839d9e60c86..57a28544be96fce391735fe6444aaf5b7d94392d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2002 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
 #error XFS_BIG_FILESYSTEMS must be defined true or false
 #endif
 
+#ifdef __KERNEL__
+
+#include <asm/byteorder.h>
+
+#ifdef __LITTLE_ENDIAN
+# define __BYTE_ORDER  __LITTLE_ENDIAN
+#endif
+#ifdef __BIG_ENDIAN
+# define __BYTE_ORDER  __BIG_ENDIAN
+#endif
+
+#endif /* __KERNEL__ */
+
+/* do we need conversion? */
+
+#define ARCH_NOCONVERT 1
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define ARCH_CONVERT   0
+#else
+#define ARCH_CONVERT   ARCH_NOCONVERT
+#endif
+
+/* generic swapping macros */
+
+#define INT_SWAP16(type,var) ((typeof(type))(__swab16((__u16)(var))))
+#define INT_SWAP32(type,var) ((typeof(type))(__swab32((__u32)(var))))
+#define INT_SWAP64(type,var) ((typeof(type))(__swab64((__u64)(var))))
+
+#define INT_SWAP(type, var) \
+    ((sizeof(type) == 8) ? INT_SWAP64(type,var) : \
+    ((sizeof(type) == 4) ? INT_SWAP32(type,var) : \
+    ((sizeof(type) == 2) ? INT_SWAP16(type,var) : \
+    (var))))
+
+#define INT_SWAP_UNALIGNED_32(from,to) \
+    { \
+       ((__u8*)(to))[0] = ((__u8*)(from))[3]; \
+       ((__u8*)(to))[1] = ((__u8*)(from))[2]; \
+       ((__u8*)(to))[2] = ((__u8*)(from))[1]; \
+       ((__u8*)(to))[3] = ((__u8*)(from))[0]; \
+    }
+
+#define INT_SWAP_UNALIGNED_64(from,to) \
+    { \
+       INT_SWAP_UNALIGNED_32( ((__u8*)(from)) + 4, ((__u8*)(to))); \
+       INT_SWAP_UNALIGNED_32( ((__u8*)(from)), ((__u8*)(to)) + 4); \
+    }
+
+/*
+ * get and set integers from potentially unaligned locations
+ */
+
+#define INT_GET_UNALIGNED_16_LE(pointer) \
+   ((__u16)((((__u8*)(pointer))[0]     ) | (((__u8*)(pointer))[1] << 8 )))
+#define INT_GET_UNALIGNED_16_BE(pointer) \
+   ((__u16)((((__u8*)(pointer))[0] << 8) | (((__u8*)(pointer))[1])))
+#define INT_SET_UNALIGNED_16_LE(pointer,value) \
+    { \
+       ((__u8*)(pointer))[0] = (((value)     ) & 0xff); \
+       ((__u8*)(pointer))[1] = (((value) >> 8) & 0xff); \
+    }
+#define INT_SET_UNALIGNED_16_BE(pointer,value) \
+    { \
+       ((__u8*)(pointer))[0] = (((value) >> 8) & 0xff); \
+       ((__u8*)(pointer))[1] = (((value)     ) & 0xff); \
+    }
+
+#define INT_GET_UNALIGNED_32_LE(pointer) \
+   ((__u32)((((__u8*)(pointer))[0]     ) | (((__u8*)(pointer))[1] << 8 ) \
+          |(((__u8*)(pointer))[2] << 16) | (((__u8*)(pointer))[3] << 24)))
+#define INT_GET_UNALIGNED_32_BE(pointer) \
+   ((__u32)((((__u8*)(pointer))[0] << 24) | (((__u8*)(pointer))[1] << 16) \
+          |(((__u8*)(pointer))[2] << 8)  | (((__u8*)(pointer))[3]      )))
+
+#define INT_GET_UNALIGNED_64_LE(pointer) \
+   (((__u64)(INT_GET_UNALIGNED_32_LE(((__u8*)(pointer))+4)) << 32 ) \
+   |((__u64)(INT_GET_UNALIGNED_32_LE(((__u8*)(pointer))         ))       ))
+#define INT_GET_UNALIGNED_64_BE(pointer) \
+   (((__u64)(INT_GET_UNALIGNED_32_BE(((__u8*)(pointer))         )) << 32  ) \
+   |((__u64)(INT_GET_UNALIGNED_32_BE(((__u8*)(pointer))+4))       ))
+
+/*
+ * now pick the right ones for our MACHINE ARCHITECTURE
+ */
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define INT_GET_UNALIGNED_16(pointer)      INT_GET_UNALIGNED_16_LE(pointer)
+#define INT_SET_UNALIGNED_16(pointer,value) INT_SET_UNALIGNED_16_LE(pointer,value)
+#define INT_GET_UNALIGNED_32(pointer)      INT_GET_UNALIGNED_32_LE(pointer)
+#define INT_GET_UNALIGNED_64(pointer)      INT_GET_UNALIGNED_64_LE(pointer)
+#else
+#define INT_GET_UNALIGNED_16(pointer)      INT_GET_UNALIGNED_16_BE(pointer)
+#define INT_SET_UNALIGNED_16(pointer,value) INT_SET_UNALIGNED_16_BE(pointer,value)
+#define INT_GET_UNALIGNED_32(pointer)      INT_GET_UNALIGNED_32_BE(pointer)
+#define INT_GET_UNALIGNED_64(pointer)      INT_GET_UNALIGNED_64_BE(pointer)
+#endif
+
+/* define generic INT_ macros */
+
+#define INT_GET(reference,arch) \
+    (((arch) == ARCH_NOCONVERT) \
+       ? \
+           (reference) \
+       : \
+           INT_SWAP((reference),(reference)) \
+    )
+
+/* does not return a value */
+#define INT_SET(reference,arch,valueref) \
+    (__builtin_constant_p(valueref) ? \
+       (void)( (reference) = ( ((arch) != ARCH_NOCONVERT) ? (INT_SWAP((reference),(valueref))) : (valueref)) ) : \
+       (void)( \
+           ((reference) = (valueref)), \
+           ( ((arch) != ARCH_NOCONVERT) ? (reference) = INT_SWAP((reference),(reference)) : 0 ) \
+       ) \
+    )
+
+/* does not return a value */
+#define INT_MOD_EXPR(reference,arch,code) \
+    (void)(((arch) == ARCH_NOCONVERT) \
+       ? \
+           ((reference) code) \
+       : \
+           ( \
+               (reference) = INT_GET((reference),arch) , \
+               ((reference) code), \
+               INT_SET(reference, arch, reference) \
+           ) \
+    )
+
+/* does not return a value */
+#define INT_MOD(reference,arch,delta) \
+    (void)( \
+       INT_MOD_EXPR(reference,arch,+=(delta)) \
+    )
+
+/*
+ * INT_COPY - copy a value between two locations with the
+ *           _same architecture_ but _potentially different sizes_
+ *
+ *         if the types of the two parameters are equal or they are
+ *             in native architecture, a simple copy is done
+ *
+ *         otherwise, architecture conversions are done
+ *
+ */
+
+/* does not return a value */
+#define INT_COPY(dst,src,arch) \
+    (void)( \
+       ((sizeof(dst) == sizeof(src)) || ((arch) == ARCH_NOCONVERT)) \
+           ? \
+               ((dst) = (src)) \
+           : \
+               INT_SET(dst, arch, INT_GET(src, arch)) \
+    )
+
+/*
+ * INT_XLATE - copy a value in either direction between two locations
+ *            with different architectures
+ *
+ *                 dir < 0     - copy from memory to buffer (native to arch)
+ *                 dir > 0     - copy from buffer to memory (arch to native)
+ */
+
+/* does not return a value */
+#define INT_XLATE(buf,mem,dir,arch) {\
+    ASSERT(dir); \
+    if (dir>0) { \
+       (mem)=INT_GET(buf, arch); \
+    } else { \
+       INT_SET(buf, arch, mem); \
+    } \
+}
+
+#define INT_ISZERO(reference,arch) \
+    ((reference) == 0)
+
+#define INT_ZERO(reference,arch) \
+    ((reference) = 0)
+
+#define INT_GET_UNALIGNED_16_ARCH(pointer,arch) \
+    ( ((arch) == ARCH_NOCONVERT) \
+       ? \
+           (INT_GET_UNALIGNED_16(pointer)) \
+       : \
+           (INT_GET_UNALIGNED_16_BE(pointer)) \
+    )
+#define INT_SET_UNALIGNED_16_ARCH(pointer,value,arch) \
+    if ((arch) == ARCH_NOCONVERT) { \
+       INT_SET_UNALIGNED_16(pointer,value); \
+    } else { \
+       INT_SET_UNALIGNED_16_BE(pointer,value); \
+    }
+
 #define DIRINO4_GET_ARCH(pointer,arch) \
     ( ((arch) == ARCH_NOCONVERT) \
        ? \
index 2378217ac39459a8e8f0d8b4eae586e8228b1e95..3cd9480f72121eda853706d5199e3c9ac57fd6cb 100644 (file)
@@ -157,9 +157,6 @@ void        xfs_buf_item_init(struct xfs_buf *, struct xfs_mount *);
 void   xfs_buf_item_relse(struct xfs_buf *);
 void   xfs_buf_item_log(xfs_buf_log_item_t *, uint, uint);
 uint   xfs_buf_item_dirty(xfs_buf_log_item_t *);
-int    xfs_buf_item_bits(uint *, uint, uint);
-int    xfs_buf_item_contig_bits(uint *, uint, uint);
-int    xfs_buf_item_next_bit(uint *, uint, uint);
 void   xfs_buf_attach_iodone(struct xfs_buf *,
                              void(*)(struct xfs_buf *, xfs_log_item_t *),
                              xfs_log_item_t *);
index e714f912b72727a3985da8418f478661084907b0..aa9bf8817d8a7f01e3dd5d3278c32255e525812c 100644 (file)
@@ -73,9 +73,9 @@ extern int xfs_cap_vremove(struct vnode *vp);
 #define _CAP_EXISTS            xfs_cap_vhascap
 
 #else
-#define xfs_cap_vset(v,p,sz)   (-ENOTSUP)
-#define xfs_cap_vget(v,p,sz)   (-ENOTSUP)
-#define xfs_cap_vremove(v)     (-ENOTSUP)
+#define xfs_cap_vset(v,p,sz)   (-EOPNOTSUPP)
+#define xfs_cap_vget(v,p,sz)   (-EOPNOTSUPP)
+#define xfs_cap_vremove(v)     (-EOPNOTSUPP)
 #define _CAP_EXISTS            (NULL)
 #endif
 
index 32bdfafc5f7768da1c1244336d931ac33a1a58b4..88bfbf9e1dc4d07f2d25881f4be70d78d1ea089d 100644 (file)
@@ -275,6 +275,8 @@ typedef struct xfs_da_state {
                (uint)(XFS_DA_LOGOFF(BASE, ADDR)), \
                (uint)(XFS_DA_LOGOFF(BASE, ADDR)+(SIZE)-1)
 
+
+#ifdef __KERNEL__
 /*========================================================================
  * Function prototypes for the kernel.
  *========================================================================*/
@@ -335,6 +337,7 @@ void xfs_da_brelse(struct xfs_trans *tp, xfs_dabuf_t *dabuf);
 void xfs_da_binval(struct xfs_trans *tp, xfs_dabuf_t *dabuf);
 xfs_daddr_t xfs_da_blkno(xfs_dabuf_t *dabuf);
 
-extern struct xfs_zone *xfs_da_state_zone;
+extern struct kmem_zone *xfs_da_state_zone;
+#endif /* __KERNEL__ */
 
 #endif /* __XFS_DA_BTREE_H__ */
index 3963675429eb741686c5511cac2b8e408bf94335..d3bf293c2b96c2a5d398d348b274ac7f5ae75eba 100644 (file)
@@ -33,7 +33,7 @@
 #define __XFS_EXTFREE_ITEM_H__
 
 struct xfs_mount;
-struct xfs_zone;
+struct kmem_zone;
 
 typedef struct xfs_extent {
        xfs_dfsbno_t    ext_start;
@@ -111,8 +111,8 @@ typedef struct xfs_efd_log_item {
  */
 #define XFS_EFD_MAX_FAST_EXTENTS       16
 
-extern struct xfs_zone *xfs_efi_zone;
-extern struct xfs_zone *xfs_efd_zone;
+extern struct kmem_zone        *xfs_efi_zone;
+extern struct kmem_zone        *xfs_efd_zone;
 
 xfs_efi_log_item_t     *xfs_efi_init(struct xfs_mount *, uint);
 xfs_efd_log_item_t     *xfs_efd_init(struct xfs_mount *, xfs_efi_log_item_t *,
index a7555e455c6cec59f2fce0bcfd9267a9270d9438..350710aed62bb66855bca277594aaeb657bdde80 100644 (file)
@@ -566,10 +566,10 @@ void              xfs_inobp_check(struct xfs_mount *, struct xfs_buf *);
 #define xfs_inobp_check(mp, bp)
 #endif /* DEBUG */
 
-extern struct xfs_zone *xfs_chashlist_zone;
-extern struct xfs_zone *xfs_ifork_zone;
-extern struct xfs_zone *xfs_inode_zone;
-extern struct xfs_zone *xfs_ili_zone;
+extern struct kmem_zone        *xfs_chashlist_zone;
+extern struct kmem_zone        *xfs_ifork_zone;
+extern struct kmem_zone        *xfs_inode_zone;
+extern struct kmem_zone        *xfs_ili_zone;
 extern struct vnodeops xfs_vnodeops;
 
 #ifdef XFS_ILOCK_TRACE
index 37b39557f83fb2f40d1517fc11e252ca9b563f08..f54904d0b82e9f35fcdad8d021aee071d49f342a 100644 (file)
@@ -38,8 +38,8 @@ LT_CURRENT = 0
 LT_REVISION = 0
 LT_AGE = 0
 
-CFILES = fstype.c pttype.c md.c xvm.c lvm.c drivers.c mountinfo.c
-HFILES = fstype.h pttype.h md.h xvm.h
+CFILES = fstype.c pttype.c md.c xvm.c evms.c lvm.c drivers.c mountinfo.c
+HFILES = fstype.h pttype.h md.h xvm.h evms.h
 
 default: $(LTLIBRARY)
 
index 37556443bc084acd3012c965751fcba0083fd11a..af987fc5438db89dac0dcb2a3ee1d4c201b860a5 100644 (file)
 #include <sys/stat.h>
 #include <volume.h>
 
-extern int  md_get_subvol_stripe(char*, sv_type_t, int*, int*, struct stat64*);
-extern int lvm_get_subvol_stripe(char*, sv_type_t, int*, int*, struct stat64*);
-extern int xvm_get_subvol_stripe(char*, sv_type_t, int*, int*, struct stat64*);
+extern int   md_get_subvol_stripe(char*, sv_type_t, int*, int*, struct stat64*);
+extern int  lvm_get_subvol_stripe(char*, sv_type_t, int*, int*, struct stat64*);
+extern int  xvm_get_subvol_stripe(char*, sv_type_t, int*, int*, struct stat64*);
+extern int evms_get_subvol_stripe(char*, sv_type_t, int*, int*, struct stat64*);
 
 void
 get_subvol_stripe_wrapper(char *dev, sv_type_t type, int *sunit, int *swidth)
@@ -53,13 +54,16 @@ get_subvol_stripe_wrapper(char *dev, sv_type_t type, int *sunit, int *swidth)
                fprintf(stderr, "Cannot stat %s: %s\n", dev, strerror(errno));
                exit(1);
        }
-
-       if ( md_get_subvol_stripe(dev, type, sunit, swidth, &sb))
+        
+       if (  md_get_subvol_stripe(dev, type, sunit, swidth, &sb))
+               return;
+       if ( lvm_get_subvol_stripe(dev, type, sunit, swidth, &sb))
                return;
-       if (lvm_get_subvol_stripe(dev, type, sunit, swidth, &sb))
+       if ( xvm_get_subvol_stripe(dev, type, sunit, swidth, &sb))
                return;
-       if (xvm_get_subvol_stripe(dev, type, sunit, swidth, &sb))
+       if (evms_get_subvol_stripe(dev, type, sunit, swidth, &sb))
                return;
+
        /* ... add new device drivers here */
 }
 
@@ -79,11 +83,11 @@ get_driver_block_major(const char *driver)
        if ((f = fopen(PROC_DEVICES, "r")) == NULL)
                return major;
        while (fgets(buf, sizeof(buf), f))      /* skip to block dev section */
-               if (strcmp("Block devices:\n", buf) == 0)
+               if (strncmp("Block devices:\n", buf, sizeof(buf)) == 0)
                        break;
        while (fgets(buf, sizeof(buf), f))
                if ((sscanf(buf, "%u %s\n", &major, puf) == 2) &&
-                   (strcmp(puf, driver) == 0))
+                   (strncmp(puf, driver, sizeof(puf)) == 0))
                        break;
        fclose(f);
        return major;
diff --git a/libdisk/evms.c b/libdisk/evms.c
new file mode 100644 (file)
index 0000000..67d2b3b
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ *   Copyright (c) International Business Machines  Corp., 2002
+ *
+ *   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; either version 2 of the License, or 
+ *   (at your option) any later version.
+ * 
+ *   This program is distributed in the hope that it will 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.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program;  if not, write to the Free Software 
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <sys/sysmacros.h>
+#include <volume.h>
+#include "evms.h"
+
+int
+mnt_is_evms_subvol(dev_t dev)
+{
+       if (major(dev) == EVMS_MAJOR)
+               return 1;
+       if (major(dev) == get_driver_block_major("evms"))
+               return 1;
+       return 0;
+}
+
+int
+evms_get_subvol_stripe(
+       char            *device,
+       sv_type_t       type,
+       int             *sunit,
+       int             *swidth,
+       struct stat64   *sb)
+{
+       if (mnt_is_evms_subvol(sb->st_rdev)) {
+               evms_vol_stripe_info_t  info;
+               int                     fd;
+
+               fd = open(device, O_RDONLY);
+               if (fd == -1)
+                       return 0;
+
+               if (ioctl(fd, EVMS_GET_VOL_STRIPE_INFO, &info)) {
+                       close(fd);
+                       return 0;
+               }
+
+               /* Update sizes */
+               *sunit = info.size;
+               *swidth = *sunit * info.width;
+
+               close(fd);
+               return 1;
+       }
+       return 0;
+}
diff --git a/libdisk/evms.h b/libdisk/evms.h
new file mode 100644 (file)
index 0000000..daa105f
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ *   Copyright (c) International Business Machines  Corp., 2002
+ *
+ *   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; either version 2 of the License, or 
+ *   (at your option) any later version.
+ * 
+ *   This program is distributed in the hope that it will 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.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program;  if not, write to the Free Software 
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#define EVMS_MAJOR                     117
+#define EVMS_GET_VOL_STRIPE_INFO       \
+               _IOR(EVMS_MAJOR, 0xF0, struct evms_vol_stripe_info_s)
+
+/*
+ * struct evms_vol_stripe_info_s - contains stripe information for a volume
+ *
+ * unit: the stripe unit specified in 512 byte block units
+ * width: the number of stripe members or RAID data disks
+ */
+typedef struct evms_vol_stripe_info_s {
+       u_int32_t       size;
+       u_int32_t       width;
+} evms_vol_stripe_info_t;
index 63630bf08b0d47cc97183425eb79ca9e2cc4eff6..5fe10cb5b9a8cfa5189e7706df215c085d818330 100644 (file)
@@ -33,6 +33,7 @@
 #include <stdio.h>
 #include <fcntl.h>
 #include <stdlib.h>
+#include <unistd.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <volume.h>
@@ -58,7 +59,7 @@ md_get_subvol_stripe(
 {
        if (mnt_is_md_subvol(sb->st_rdev)) {
                struct md_array_info    md;
-               int  fd;
+               int                     fd;
 
                /* Open device */
                fd = open(dfile, O_RDONLY);
@@ -71,6 +72,7 @@ md_get_subvol_stripe(
                                dfile);
                        exit(1);
                }
+               close(fd);
 
                /* Check state */
                if (md.state) {
index bf6ad9037f2e401591d8ab1cdccb99075a3983b5..7090060b0ca1dd3d5c24b879d7d0b58e951b6cd6 100644 (file)
 /* memory management */
 #define KM_SLEEP       1
 #define KM_SLEEP_IO    2
+#define kmem_zone              xfs_zone        
+#define kmem_zone_t            xfs_zone_t
 #define kmem_zone_init(a, b)   libxfs_zone_init(a, b)
 #define kmem_zone_alloc(z, f)  libxfs_zone_zalloc(z)
 #define kmem_zone_zalloc(z, f) libxfs_zone_zalloc(z)
@@ -461,6 +463,8 @@ int  xfs_alloc_split (xfs_btree_cur_t *, int, xfs_agblock_t *,
 
 /* xfs_da_btree.c */
 xfs_dabuf_t *xfs_da_buf_make (int, xfs_buf_t **, inst_t *);
+void xfs_da_binval (struct xfs_trans *, xfs_dabuf_t *);
+void xfs_da_buf_done (xfs_dabuf_t *);
 int  xfs_da_root_join (xfs_da_state_t *, xfs_da_state_blk_t *);
 int  xfs_da_root_split (xfs_da_state_t *, xfs_da_state_blk_t *,
                        xfs_da_state_blk_t *);
@@ -478,6 +482,21 @@ int  xfs_da_node_toosmall (xfs_da_state_t *, int *);
 uint xfs_da_node_lasthash (xfs_dabuf_t *, int *);
 int  xfs_da_do_buf (xfs_trans_t *, xfs_inode_t *, xfs_dablk_t, xfs_daddr_t *,
                        xfs_dabuf_t **, int, int, inst_t *);
+int  xfs_da_split (xfs_da_state_t *);
+int  xfs_da_node_create (xfs_da_args_t *, xfs_dablk_t, int,
+                       xfs_dabuf_t **, int);
+int  xfs_da_join (xfs_da_state_t *);
+void xfs_da_fixhashpath (xfs_da_state_t *, xfs_da_state_path_t *);
+int  xfs_da_node_lookup_int (xfs_da_state_t *, int *);
+int  xfs_da_path_shift (xfs_da_state_t *, xfs_da_state_path_t *,
+                       int, int, int *);
+int  xfs_da_blk_unlink (xfs_da_state_t *, xfs_da_state_blk_t *,
+                       xfs_da_state_blk_t *);
+int  xfs_da_blk_link (xfs_da_state_t *, xfs_da_state_blk_t *,
+                       xfs_da_state_blk_t *);
+xfs_da_state_t *xfs_da_state_alloc (void);
+void xfs_da_state_free (xfs_da_state_t *);
+void xfs_da_state_kill_altpath (xfs_da_state_t *);
 
 /* xfs_dir.c */
 int  xfs_dir_node_addname (xfs_da_args_t *);
index a7cf0be5a02e07248e9d3ad48213c555d600f024..34106f68082d3dfce67cbf2309f491d2da5c75c2 100644 (file)
@@ -339,19 +339,6 @@ calc_stripe_factors(int dsu, int dsw, int lsu, int *dsunit, int *dswidth, int *l
        }
 }
 
-static int
-get_default_blocksize(void)
-{
-       size_t  pagesize = getpagesize();
-       int     i;
-
-       /* default is between 4K and 16K */
-       for (i = 12; i <= 16; i++)
-               if ((1 << i) == pagesize)
-                       return pagesize;
-       return (1 << XFS_DFL_BLOCKSIZE_LOG);
-}
-
 static int
 check_overwrite(char *device)
 {
@@ -514,8 +501,7 @@ main(int argc, char **argv)
        agcount = 8;
        blflag = bsflag = 0;
        dasize = daflag = 0;
-       blocksize = get_default_blocksize();
-       blocklog = libxfs_highbit32(blocksize);
+       blocklog = blocksize = 0;
        agsize = daflag = dblocks = 0;
        ilflag = imflag = ipflag = isflag = 0;
        liflag = laflag = lsflag = ldflag = lvflag = 0;
@@ -608,11 +594,7 @@ main(int argc, char **argv)
                                                reqval('d', dopts, D_AGSIZE);
                                        if (dasize)
                                                respec('d', dopts, D_AGSIZE);
-                                       if (blflag || bsflag)
-                                               agsize = cvtnum(blocksize,
-                                                               value);
-                                       else
-                                               agsize = cvtnum(0, value);
+                                       agsize = cvtnum(blocksize, value);
                                        dasize = 1;
                                        break;
                                case D_FILE:
@@ -669,11 +651,7 @@ main(int argc, char **argv)
                                                reqval('d', dopts, D_SU);
                                        if (dsu)
                                                respec('d', dopts, D_SU);
-                                       if (blflag || bsflag)
-                                               dsu = cvtnum(blocksize,
-                                                               value);
-                                       else
-                                               dsu = cvtnum(0, value);
+                                       dsu = cvtnum(blocksize, value);
                                        break;
                                case D_SW:
                                        if (!value)
@@ -854,11 +832,7 @@ main(int argc, char **argv)
                                                reqval('l', lopts, L_SU);
                                        if (lsu)
                                                respec('l', lopts, L_SU);
-                                       if (blflag || bsflag)
-                                               lsu = cvtnum(blocksize,
-                                                               value);
-                                       else
-                                               lsu = cvtnum(0, value);
+                                       lsu = cvtnum(blocksize, value);
                                        break;
                                case L_SUNIT:
                                        if (!value)
@@ -1041,6 +1015,13 @@ main(int argc, char **argv)
        } else
                dfile = xi.dname;
        /* option post-processing */
+       /*
+        * blocksize first, other things depend on it
+        */
+       if (!blflag && !bsflag) {
+               blocklog = XFS_DFL_BLOCKSIZE_LOG;
+               blocksize = 1 << XFS_DFL_BLOCKSIZE_LOG;
+       }
        if (blocksize < XFS_MIN_BLOCKSIZE || blocksize > XFS_MAX_BLOCKSIZE) {
                fprintf(stderr, "illegal block size %d\n", blocksize);
                usage();