From: Nathan Scott Date: Thu, 8 Aug 2002 06:35:44 +0000 (+0000) Subject: bump version to 2.2, document changes -- sync shared headers, EVMS stripe X-Git-Tag: v2.2.0 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=836f654f9ade120181d6bb95060de613fef3d554;p=thirdparty%2Fxfsprogs-dev.git bump version to 2.2, document changes -- sync shared headers, EVMS stripe unit/width extraction, mkfs defaults to 4K blocksize again (as on IRIX) & no longer punts on using the current pagesize. --- diff --git a/VERSION b/VERSION index 7b958737f..5cafc9fcb 100644 --- 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 diff --git a/debian/changelog b/debian/changelog index b252f3f2f..32fe9abd0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Wed, 7 Aug 2002 11:37:23 +1000 + xfsprogs (2.1.2-1) unstable; urgency=low * New upstream release diff --git a/doc/CHANGES b/doc/CHANGES index b0b401891..6951681c9 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -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 diff --git a/include/Makefile b/include/Makefile index 018948b9e..745a0a088 100644 --- a/include/Makefile +++ b/include/Makefile @@ -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 index e6c922a36..000000000 --- a/include/arch.h +++ /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 - -#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__ */ diff --git a/include/libxfs.h b/include/libxfs.h index 9f91e0076..431a7831b 100644 --- a/include/libxfs.h +++ b/include/libxfs.h @@ -36,7 +36,6 @@ #include #include -#include #include #include #include @@ -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 *); diff --git a/include/xfs_acl.h b/include/xfs_acl.h index 9a15c73bd..f50ffde0c 100644 --- a/include/xfs_acl.h +++ b/include/xfs_acl.h @@ -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) diff --git a/include/xfs_arch.h b/include/xfs_arch.h index 2841d673a..57a28544b 100644 --- a/include/xfs_arch.h +++ b/include/xfs_arch.h @@ -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 @@ -36,6 +36,201 @@ #error XFS_BIG_FILESYSTEMS must be defined true or false #endif +#ifdef __KERNEL__ + +#include + +#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) \ ? \ diff --git a/include/xfs_buf_item.h b/include/xfs_buf_item.h index 2378217ac..3cd9480f7 100644 --- a/include/xfs_buf_item.h +++ b/include/xfs_buf_item.h @@ -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 *); diff --git a/include/xfs_cap.h b/include/xfs_cap.h index e714f912b..aa9bf8817 100644 --- a/include/xfs_cap.h +++ b/include/xfs_cap.h @@ -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 diff --git a/include/xfs_da_btree.h b/include/xfs_da_btree.h index 32bdfafc5..88bfbf9e1 100644 --- a/include/xfs_da_btree.h +++ b/include/xfs_da_btree.h @@ -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__ */ diff --git a/include/xfs_extfree_item.h b/include/xfs_extfree_item.h index 396367542..d3bf293c2 100644 --- a/include/xfs_extfree_item.h +++ b/include/xfs_extfree_item.h @@ -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 *, diff --git a/include/xfs_inode.h b/include/xfs_inode.h index a7555e455..350710aed 100644 --- a/include/xfs_inode.h +++ b/include/xfs_inode.h @@ -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 diff --git a/libdisk/Makefile b/libdisk/Makefile index 37b39557f..f54904d0b 100644 --- a/libdisk/Makefile +++ b/libdisk/Makefile @@ -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) diff --git a/libdisk/drivers.c b/libdisk/drivers.c index 37556443b..af987fc54 100644 --- a/libdisk/drivers.c +++ b/libdisk/drivers.c @@ -37,9 +37,10 @@ #include #include -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 index 000000000..67d2b3bce --- /dev/null +++ b/libdisk/evms.c @@ -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 +#include +#include +#include +#include +#include +#include +#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 index 000000000..daa105fb3 --- /dev/null +++ b/libdisk/evms.h @@ -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; diff --git a/libdisk/md.c b/libdisk/md.c index 63630bf08..5fe10cb5b 100644 --- a/libdisk/md.c +++ b/libdisk/md.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -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) { diff --git a/libxfs/xfs.h b/libxfs/xfs.h index bf6ad9037..7090060b0 100644 --- a/libxfs/xfs.h +++ b/libxfs/xfs.h @@ -187,6 +187,8 @@ /* 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 *); diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index a7cf0be5a..34106f680 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -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();