# 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
+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
+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.
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
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 \
+++ /dev/null
-/*
- * 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__ */
#include <xfs_fs.h>
#include <xfs_types.h>
-#include <arch.h>
#include <xfs_arch.h>
#include <xfs_sb.h>
#include <xfs_bit.h>
* 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 *);
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
#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)
/*
- * 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) \
? \
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 *);
#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
(uint)(XFS_DA_LOGOFF(BASE, ADDR)), \
(uint)(XFS_DA_LOGOFF(BASE, ADDR)+(SIZE)-1)
+
+#ifdef __KERNEL__
/*========================================================================
* Function prototypes for the kernel.
*========================================================================*/
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__ */
#define __XFS_EXTFREE_ITEM_H__
struct xfs_mount;
-struct xfs_zone;
+struct kmem_zone;
typedef struct xfs_extent {
xfs_dfsbno_t ext_start;
*/
#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 *,
#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
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)
#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)
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 */
}
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;
--- /dev/null
+/*
+ * 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;
+}
--- /dev/null
+/*
+ * 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;
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
+#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <volume.h>
{
if (mnt_is_md_subvol(sb->st_rdev)) {
struct md_array_info md;
- int fd;
+ int fd;
/* Open device */
fd = open(dfile, O_RDONLY);
dfile);
exit(1);
}
+ close(fd);
/* Check state */
if (md.state) {
/* 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)
/* 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 *);
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 *);
}
}
-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)
{
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;
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:
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)
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)
} 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();