From 33a4da693ed24e9ddc3a28256afc161da36d0bdf Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Tue, 20 Jan 2004 00:41:43 +0000 Subject: [PATCH] xfsprogs update - Debian installer support, sync user/kernel stuff. --- VERSION | 2 +- debian/Makefile | 15 +---- debian/changelog | 19 ++++--- debian/control | 22 ++++---- debian/rules | 54 +++++++++--------- doc/CHANGES | 11 ++++ include/Makefile | 6 +- include/buildmacros | 3 +- include/libxfs.h | 4 +- include/xfs_acl.h | 120 ---------------------------------------- include/xfs_ag.h | 9 +-- include/xfs_attr_leaf.h | 16 ++++-- include/xfs_cap.h | 84 ---------------------------- include/xfs_mac.h | 120 ---------------------------------------- include/xfs_types.h | 18 +----- io/pread.c | 4 +- io/pwrite.c | 4 +- libxfs/xfs.h | 5 +- libxfs/xfs_attr_leaf.c | 5 +- libxfs/xfs_dir2_node.c | 15 ++--- mkfs/xfs_mkfs.h | 10 +++- repair/attr_repair.c | 5 +- repair/attr_repair.h | 82 ++++++++++++++++++++++++++- 23 files changed, 190 insertions(+), 443 deletions(-) delete mode 100644 include/xfs_acl.h delete mode 100644 include/xfs_cap.h delete mode 100644 include/xfs_mac.h diff --git a/VERSION b/VERSION index 224eedb86..1c2cf1f87 100644 --- a/VERSION +++ b/VERSION @@ -3,5 +3,5 @@ # PKG_MAJOR=2 PKG_MINOR=6 -PKG_REVISION=2 +PKG_REVISION=3 PKG_BUILD=0 diff --git a/debian/Makefile b/debian/Makefile index 4cfaa7bf6..b15a7615a 100644 --- a/debian/Makefile +++ b/debian/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. +# Copyright (c) 2000-2004 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 @@ -35,10 +35,7 @@ include $(TOPDIR)/include/builddefs LSRCFILES = changelog control copyright rules DEV_DOC_DIR = $(PKG_DOC_DIR)/../xfslibs-dev -BOOT_DOC_DIR = $(PKG_DOC_DIR)/../xfsprogs-bf -BOOT_MAN_DIR = $(PKG_MAN_DIR)/man8 -BOOT_MKFS_BIN = $(TOPDIR)/mkfs/mkfs.xfs-xfsprogs-bf -BOOT_MKFS_MAN = $(TOPDIR)/man/man8/mkfs.xfs.8 +BOOT_MKFS_BIN = $(TOPDIR)/mkfs/mkfs.xfs-xfsprogs-udeb default: @@ -58,14 +55,8 @@ ifeq ($(PKG_DISTRIBUTION), debian) $(INSTALL) -m 644 changelog $(DEV_DOC_DIR)/changelog.Debian endif -install-boot: default +install-d-i: default ifeq ($(PKG_DISTRIBUTION), debian) - $(INSTALL) -m 755 -d $(PKG_DOC_DIR) $(INSTALL) -m 755 -d $(PKG_SBIN_DIR) - $(INSTALL) -m 755 -d $(BOOT_DOC_DIR) - $(INSTALL) -m 755 -d $(BOOT_MAN_DIR) - $(INSTALL) -m 644 copyright $(BOOT_DOC_DIR) - $(INSTALL) -m 644 changelog $(BOOT_DOC_DIR)/changelog.Debian $(INSTALL) -m 755 $(BOOT_MKFS_BIN) $(PKG_SBIN_DIR)/mkfs.xfs - $(INSTALL) -m 644 $(BOOT_MKFS_MAN) $(BOOT_MAN_DIR)/mkfs.xfs.8 endif diff --git a/debian/changelog b/debian/changelog index 6b2020432..7c8bd4927 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,14 +1,15 @@ -xfsprogs (2.6.2-1) unstable; urgency=low +xfsprogs (2.6.3-1) unstable; urgency=low * New upstream release. + * Add support for debian-installer. (closes: #225444) + Author: Steve Langasek. + * Use debhelper instead of debmake, for proper udeb building. + Author: Steve Langasek. + * Drop boot-floppies support. (closes: #112715) + Author: Steve Langasek. + * Add support for the security attribute namespace. - -- Nathan Scott Wed, 17 Dec 2003 21:16:53 +1100 - -xfsprogs (2.6.1-1) unstable; urgency=low - - * New upstream release. - - -- Nathan Scott Thu, 27 Nov 2003 13:47:17 +1100 + -- Nathan Scott Mon, 19 Jan 2004 10:08:59 +1100 xfsprogs (2.6.0-1) unstable; urgency=low @@ -38,7 +39,7 @@ xfsprogs (2.5.5-1) unstable; urgency=low xfsprogs (2.5.4-1) unstable; urgency=low * New upstream release, includes xfs_copy command - * Fix shell quoting in xfs_bmap, from Kai S. Juse (closes: 202588) + * Fix shell quoting in xfs_bmap, from Kai S. Juse (closes: #202588) -- Nathan Scott Wed, 23 Jul 2003 10:36:28 +1000 diff --git a/debian/control b/debian/control index a284fb89e..720fb0540 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: xfsprogs Section: admin Priority: optional Maintainer: Nathan Scott -Build-Depends: uuid-dev, autoconf, debmake, gettext, libtool, libreadline4-dev +Build-Depends: uuid-dev, autoconf, debhelper, gettext, libtool, libreadline4-dev Standards-Version: 3.5.9 Package: xfsprogs @@ -33,17 +33,15 @@ Architecture: any Description: XFS filesystem-specific static libraries and headers xfslibs-dev contains the libraries and header files needed to develop XFS filesystem-specific programs. - -Package: xfsprogs-bf -Section: devel -Priority: extra -Depends: ${shlibs:Depends} -Conflicts: e2fsprogs, xfsprogs + +Package: xfsprogs-udeb +Section: debian-installer +Priority: standard Architecture: any -Description: A stripped-down versions of xfsprogs, for boot-floppies - This package is an xfsprogs package built for a reduced size, so that - it can help to save space on installation boot-floppies. +Depends: ${shlibs:Depends} +Description: A stripped-down version of xfsprogs, for debian-installer + This package is an xfsprogs package built for reduced size, so that it + can help to save space in debian-installer. . Don't attempt to install this package, it has no support for a couple of - features you surely want. Anyway it should refuse to install. - + features you surely want. Anyway, it should fail to install. diff --git a/debian/rules b/debian/rules index b6e5eec59..4bb9d59ea 100755 --- a/debian/rules +++ b/debian/rules @@ -2,22 +2,26 @@ package = xfsprogs develop = xfslibs-dev -bootpkg = xfsprogs-bf +bootpkg = xfsprogs-udeb + +version = $(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2) +target ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) +udebpkg = $(bootpkg)_$(version)_$(target).udeb dirtmp = debian/tmp dirdev = debian/$(develop) -dirbfs = debian/$(bootpkg) +dirdi = debian/$(bootpkg) pkgtmp = DIST_ROOT=`pwd`/$(dirtmp); export DIST_ROOT; pkgdev = DIST_ROOT=`pwd`/$(dirdev); export DIST_ROOT; -pkgbfs = DIST_ROOT=`pwd`/$(dirbfs); export DIST_ROOT; +pkgdi = DIST_ROOT=`pwd`/$(dirdi); export DIST_ROOT; stdenv = @GZIP=-q; export GZIP; options = DEBUG=-DNDEBUG; DISTRIBUTION=debian; LOCAL_CONFIGURE_OPTIONS=--enable-readline=yes; export DEBUG DISTRIBUTION LOCAL_CONFIGURE_OPTIONS; -bfsopts = $(options) OPTIMIZER=-Os; LOCAL_CONFIGURE_OPTIONS="--enable-shared-uuid=yes --enable-gettext=no"; export OPTIMIZER LOCAL_CONFIGURE_OPTIONS; +diopts = $(options) OPTIMIZER=-Os; LOCAL_CONFIGURE_OPTIONS="--enable-shared-uuid=yes --enable-gettext=no"; export OPTIMIZER LOCAL_CONFIGURE_OPTIONS; checkdir = test -f debian/rules build: built -built: bfbuild config +built: dibuild config @echo "== dpkg-buildpackage: build" 1>&2 $(MAKE) default touch built @@ -29,11 +33,11 @@ config: .census $(options) $(MAKE) configure touch .census -bfbuild: +dibuild: $(checkdir) @echo "== dpkg-buildpackage: bootfloppies" 1>&2 if [ ! -f mkfs/mkfs.xfs-$(bootpkg) ]; then \ - $(bfsopts) $(MAKE) configure; \ + $(diopts) $(MAKE) configure; \ for dir in include libxfs libdisk mkfs; do \ $(MAKE) -C $$dir; \ done; \ @@ -46,33 +50,33 @@ clean: $(checkdir) -rm -f built .census mkfs/mkfs.xfs-$(bootpkg) $(MAKE) distclean - -rm -rf $(dirtmp) $(dirdev) $(dirbfs) debian/*substvars debian/files* + -rm -rf $(dirtmp) $(dirdev) $(dirdi) debian/*substvars debian/files* binary-indep: -# Note1: dev pkg with .so symlinks to base pkg confuses debstd; -# so the .so 'Dangling symlink' message is benign. -# Note2: absolute symlinks (required by policy) confuse debstd; -# so we'll filter out symlink messages entirely now. -# binary-arch: checkroot built @echo "== dpkg-buildpackage: binary-arch" 1>&2 $(checkdir) - -rm -rf $(dirtmp) $(dirdev) $(dirbfs) + -rm -rf $(dirtmp) $(dirdev) $(dirdi) $(pkgtmp) $(MAKE) -C . install $(pkgdev) $(MAKE) -C . install-dev - $(pkgbfs) $(MAKE) -C debian install-boot + $(pkgdi) $(MAKE) -C debian install-d-i $(pkgtmp) $(MAKE) -C build src-manifest - @echo "== dpkg-buildpackage: debstd" 1>&2 - $(stdenv) debstd -m | grep -v 'Dangling symlink' - dpkg-gencontrol -isp -p$(package) -P$(dirtmp) - dpkg-gencontrol -isp -p$(develop) -P$(dirdev) - dpkg-gencontrol -isp -p$(bootpkg) -P$(dirbfs) - chown -R root.root $(dirtmp) $(dirdev) $(dirbfs) - chmod -R go=rX $(dirtmp) $(dirdev) $(dirbfs) - dpkg --build $(dirtmp) .. - dpkg --build $(dirdev) .. - dpkg --build $(dirbfs) .. + + dh_installdocs -p$(package) -p$(develop) + dh_installchangelogs -N$(bootpkg) + dh_strip + dh_compress + dh_fixperms + dh_makeshlibs -p$(package) + dh_installdeb -N$(bootpkg) + dh_shlibdeps + dh_gencontrol -N$(bootpkg) + dh_gencontrol -p$(bootpkg) -- -n$(udebpkg) + + dh_md5sums -N$(bootpkg) + dh_builddeb -N$(bootpkg) + dh_builddeb -p$(bootpkg) --filename=$(udebpkg) binary: binary-indep binary-arch diff --git a/doc/CHANGES b/doc/CHANGES index c21cfce75..d6b4376e9 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,3 +1,14 @@ +xfsprogs-2.6.3 (19 January 2003) + - Merge Steve Langasek's work on the Debian installer + support for xfsprogs. + - Add knowledge to xfs_db about the security namespace in + its extended attributes commands. + - Sync up user/kernel source in libxfs and headers. + - Fix a couple of compilation warnings. + - Workaround for some versions of autoconf mishandling the + AC_CHECK_SIZEOF macro. + - Fix a memory leak in libxfs, most noticable in xfs_repair. + xfsprogs-2.6.2 (17 December 2003) - Fix dev_t sizing issues in user tools - glibc uses a 64 bit number and XFS has a 32 device bit number, confusion diff --git a/include/Makefile b/include/Makefile index 2d0033400..7e0ed581b 100644 --- a/include/Makefile +++ b/include/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. +# Copyright (c) 2000-2004 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 @@ -44,10 +44,8 @@ HFILES = handle.h jdm.h libxfs.h libxlog.h swab.h xqm.h \ xfs_log.h xfs_log_priv.h xfs_log_recover.h xfs_mount.h xfs_quota.h \ xfs_rtalloc.h xfs_sb.h xfs_trans.h xfs_trans_space.h xfs_types.h -LHFILES = xfs_acl.h xfs_cap.h xfs_mac.h DKHFILES = volume.h fstyp.h dvh.h -LSRCFILES = platform_defs.h.in builddefs.in buildmacros buildrules \ - $(LHFILES) $(DKHFILES) +LSRCFILES = platform_defs.h.in builddefs.in buildmacros buildrules $(DKHFILES) LDIRT = xfs disk default install : diff --git a/include/buildmacros b/include/buildmacros index bce094c29..2cfaa52fe 100644 --- a/include/buildmacros +++ b/include/buildmacros @@ -1,5 +1,5 @@ # -# Copyright (c) 2002-2003 Silicon Graphics, Inc. All Rights Reserved. +# Copyright (c) 2002-2004 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 @@ -84,7 +84,6 @@ INSTALL_LTLIB = \ cd $(TOPDIR)/$(LIBNAME)/.libs; \ ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \ ../$(INSTALL) -m 644 -T so_dot_version $(LIBNAME).lai $(PKG_LIB_DIR); \ - test "$(PKG_DISTRIBUTION)" = debian || \ ../$(INSTALL) -T so_dot_current $(LIBNAME).lai $(PKG_LIB_DIR) endif diff --git a/include/libxfs.h b/include/libxfs.h index a069b0b06..641b08e4c 100644 --- a/include/libxfs.h +++ b/include/libxfs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2004 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 @@ -364,7 +364,7 @@ extern int libxfs_inode_alloc (xfs_trans_t **, xfs_inode_t *, mode_t, extern void libxfs_trans_inode_alloc_buf (xfs_trans_t *, xfs_buf_t *); extern void libxfs_idata_realloc (xfs_inode_t *, int, int); -extern void libxfs_idestroy_fork (xfs_inode_t *, int); +extern void libxfs_idestroy_fork (xfs_inode_t *, int); extern int libxfs_iread (xfs_mount_t *, xfs_trans_t *, xfs_ino_t, xfs_inode_t **, xfs_daddr_t); extern void libxfs_ichgtime (xfs_inode_t *, int); diff --git a/include/xfs_acl.h b/include/xfs_acl.h deleted file mode 100644 index 0fbaecec8..000000000 --- a/include/xfs_acl.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2001-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_ACL_H__ -#define __XFS_ACL_H__ - -/* - * Access Control Lists - */ -typedef __uint16_t xfs_acl_perm_t; -typedef __int32_t xfs_acl_type_t; -typedef __int32_t xfs_acl_tag_t; -typedef __int32_t xfs_acl_id_t; - -#define XFS_ACL_MAX_ENTRIES 25 -#define XFS_ACL_NOT_PRESENT (-1) - -typedef struct xfs_acl_entry { - xfs_acl_tag_t ae_tag; - xfs_acl_id_t ae_id; - xfs_acl_perm_t ae_perm; -} xfs_acl_entry_t; - -typedef struct xfs_acl { - __int32_t acl_cnt; - xfs_acl_entry_t acl_entry[XFS_ACL_MAX_ENTRIES]; -} xfs_acl_t; - -/* On-disk XFS extended attribute names */ -#define SGI_ACL_FILE "SGI_ACL_FILE" -#define SGI_ACL_DEFAULT "SGI_ACL_DEFAULT" -#define SGI_ACL_FILE_SIZE (sizeof(SGI_ACL_FILE)-1) -#define SGI_ACL_DEFAULT_SIZE (sizeof(SGI_ACL_DEFAULT)-1) - - -#ifdef __KERNEL__ - -#ifdef CONFIG_XFS_POSIX_ACL - -struct vattr; -struct vnode; -struct xfs_inode; - -extern int xfs_acl_inherit(struct vnode *, struct vattr *, xfs_acl_t *); -extern int xfs_acl_iaccess(struct xfs_inode *, mode_t, cred_t *); -extern int xfs_acl_get(struct vnode *, xfs_acl_t *, xfs_acl_t *); -extern int xfs_acl_set(struct vnode *, xfs_acl_t *, xfs_acl_t *); -extern int xfs_acl_vtoacl(struct vnode *, xfs_acl_t *, xfs_acl_t *); -extern int xfs_acl_vhasacl_access(struct vnode *); -extern int xfs_acl_vhasacl_default(struct vnode *); -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 kmem_zone *xfs_acl_zone; - -#define _ACL_TYPE_ACCESS 1 -#define _ACL_TYPE_DEFAULT 2 -#define _ACL_PERM_INVALID(perm) ((perm) & ~(ACL_READ|ACL_WRITE|ACL_EXECUTE)) - -#define _ACL_DECL(a) xfs_acl_t *(a) = NULL -#define _ACL_ALLOC(a) ((a) = kmem_zone_alloc(xfs_acl_zone, KM_SLEEP)) -#define _ACL_FREE(a) ((a)? kmem_zone_free(xfs_acl_zone, (a)) : 0) -#define _ACL_ZONE_INIT(z,name) ((z) = kmem_zone_init(sizeof(xfs_acl_t), name)) -#define _ACL_ZONE_DESTROY(z) (kmem_cache_destroy(z)) -#define _ACL_INHERIT(c,v,d) (xfs_acl_inherit(c,v,d)) -#define _ACL_GET_ACCESS(pv,pa) (xfs_acl_vtoacl(pv,pa,NULL) == 0) -#define _ACL_GET_DEFAULT(pv,pd) (xfs_acl_vtoacl(pv,NULL,pd) == 0) -#define _ACL_ACCESS_EXISTS xfs_acl_vhasacl_access -#define _ACL_DEFAULT_EXISTS xfs_acl_vhasacl_default -#define _ACL_XFS_IACCESS(i,m,c) (XFS_IFORK_Q(i) ? xfs_acl_iaccess(i,m,c) : -1) - -#else -#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) -#define _ACL_ZONE_INIT(z,name) ((void)0) -#define _ACL_ZONE_DESTROY(z) ((void)0) -#define _ACL_INHERIT(c,v,d) (0) -#define _ACL_GET_ACCESS(pv,pa) (0) -#define _ACL_GET_DEFAULT(pv,pd) (0) -#define _ACL_ACCESS_EXISTS (NULL) -#define _ACL_DEFAULT_EXISTS (NULL) -#define _ACL_XFS_IACCESS(i,m,c) (-1) -#endif - -#endif /* __KERNEL__ */ - -#endif /* __XFS_ACL_H__ */ diff --git a/include/xfs_ag.h b/include/xfs_ag.h index 1b302a200..f47e13e39 100644 --- a/include/xfs_ag.h +++ b/include/xfs_ag.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2004 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 @@ -230,13 +230,6 @@ typedef struct xfs_perag xfs_perag_busy_t *pagb_list; /* unstable blocks */ } xfs_perag_t; -#define XFS_AG_BYTES(bblog) ((long long)BBSIZE << (bblog)) -#define XFS_AG_MIN_BYTES ((XFS_AG_BYTES(15))) /* 16 MB */ -#define XFS_AG_MIN_BLOCKS(blog) ((XFS_AG_BYTES(15)) >> (blog)) -#define XFS_AG_MAX_BLOCKS(blog) ((XFS_AG_BYTES(31) - 1) >> (blog)) - -#define XFS_MAX_AGNUMBER ((xfs_agnumber_t)(NULLAGNUMBER - 1)) - #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_AG_MAXLEVELS) int xfs_ag_maxlevels(struct xfs_mount *mp); #define XFS_AG_MAXLEVELS(mp) xfs_ag_maxlevels(mp) diff --git a/include/xfs_attr_leaf.h b/include/xfs_attr_leaf.h index 97b213a4b..af0ecf5b3 100644 --- a/include/xfs_attr_leaf.h +++ b/include/xfs_attr_leaf.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2002 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000, 2002-2004 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 @@ -44,6 +44,7 @@ struct attrlist; struct attrlist_cursor_kern; +struct attrnames; struct xfs_dabuf; struct xfs_da_args; struct xfs_da_state; @@ -72,9 +73,9 @@ struct xfs_trans; * to work "forw"ard. If none matches, continue with the "forw"ard leaf * nodes until the hash key changes or the attribute name is found. * - * We store the fact that an attribute is a ROOT versus USER attribute in + * We store the fact that an attribute is a ROOT/USER/SECURE attribute in * the leaf_entry. The namespaces are independent only because we also look - * at the root/user bit when we are looking for a matching attribute name. + * at the namespace bit when we are looking for a matching attribute name. * * We also store a "incomplete" bit in the leaf_entry. It shows that an * attribute is in the middle of being created and should not be shown to @@ -101,7 +102,7 @@ typedef struct xfs_attr_leafblock { struct xfs_attr_leaf_entry { /* sorted on key, not name */ xfs_dahash_t hashval; /* hash value of name */ __uint16_t nameidx; /* index into buffer of name/value */ - __uint8_t flags; /* LOCAL, ROOT and INCOMPLETE flags */ + __uint8_t flags; /* LOCAL/ROOT/SECURE/INCOMPLETE flag */ __uint8_t pad2; /* unused pad byte */ } entries[1]; /* variable sized array */ struct xfs_attr_leaf_name_local { @@ -128,10 +129,12 @@ typedef struct xfs_attr_leaf_name_remote xfs_attr_leaf_name_remote_t; * on the system call, they are "or"ed together for various operations. */ #define XFS_ATTR_LOCAL_BIT 0 /* attr is stored locally */ -#define XFS_ATTR_ROOT_BIT 1 /* limit access to attr to userid 0 */ +#define XFS_ATTR_ROOT_BIT 1 /* limit access to trusted attrs */ +#define XFS_ATTR_SECURE_BIT 2 /* limit access to secure attrs */ #define XFS_ATTR_INCOMPLETE_BIT 7 /* attr in middle of create/delete */ #define XFS_ATTR_LOCAL (1 << XFS_ATTR_LOCAL_BIT) #define XFS_ATTR_ROOT (1 << XFS_ATTR_ROOT_BIT) +#define XFS_ATTR_SECURE (1 << XFS_ATTR_SECURE_BIT) #define XFS_ATTR_INCOMPLETE (1 << XFS_ATTR_INCOMPLETE_BIT) /* @@ -299,7 +302,8 @@ int xfs_attr_leaf_newentsize(struct xfs_da_args *args, int blocksize, int *local); int xfs_attr_leaf_entsize(struct xfs_attr_leafblock *leaf, int index); int xfs_attr_put_listent(struct xfs_attr_list_context *context, - int ns, char *name, int namelen, int valuelen); + struct attrnames *, char *name, int namelen, + int valuelen); int xfs_attr_rolltrans(struct xfs_trans **transp, struct xfs_inode *dp); #endif /* __XFS_ATTR_LEAF_H__ */ diff --git a/include/xfs_cap.h b/include/xfs_cap.h deleted file mode 100644 index 2deac7303..000000000 --- a/include/xfs_cap.h +++ /dev/null @@ -1,84 +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_CAP_H__ -#define __XFS_CAP_H__ - -/* - * Capabilities - */ -typedef __uint64_t xfs_cap_value_t; - -typedef struct xfs_cap_set { - xfs_cap_value_t cap_effective; /* use in capability checks */ - xfs_cap_value_t cap_permitted; /* combined with file attrs */ - xfs_cap_value_t cap_inheritable;/* pass through exec */ -} xfs_cap_set_t; - -/* On-disk XFS extended attribute names */ -#define SGI_CAP_FILE "SGI_CAP_FILE" -#define SGI_CAP_FILE_SIZE (sizeof(SGI_CAP_FILE)-1) -#define SGI_CAP_LINUX "SGI_CAP_LINUX" -#define SGI_CAP_LINUX_SIZE (sizeof(SGI_CAP_LINUX)-1) - -/* - * For Linux, we take the bitfields directly from capability.h - * and no longer attempt to keep this attribute ondisk compatible - * with IRIX. Since this attribute is only set on exectuables, - * it just doesn't make much sense to try. We do use a different - * named attribute though, to avoid confusion. - */ - -#ifdef __KERNEL__ - -#ifdef CONFIG_FS_POSIX_CAP - -#include - -struct vnode; - -extern int xfs_cap_vhascap(struct vnode *); -extern int xfs_cap_vset(struct vnode *, void *, size_t); -extern int xfs_cap_vget(struct vnode *, void *, size_t); -extern int xfs_cap_vremove(struct vnode *vp); - -#define _CAP_EXISTS xfs_cap_vhascap - -#else -#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 - -#endif /* __KERNEL__ */ - -#endif /* __XFS_CAP_H__ */ diff --git a/include/xfs_mac.h b/include/xfs_mac.h deleted file mode 100644 index 8d59aaffe..000000000 --- a/include/xfs_mac.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2001-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_MAC_H__ -#define __XFS_MAC_H__ - -/* - * Mandatory Access Control - * - * Layout of a composite MAC label: - * ml_list contains the list of categories (MSEN) followed by the list of - * divisions (MINT). This is actually a header for the data structure which - * will have an ml_list with more than one element. - * - * ------------------------------- - * | ml_msen_type | ml_mint_type | - * ------------------------------- - * | ml_level | ml_grade | - * ------------------------------- - * | ml_catcount | - * ------------------------------- - * | ml_divcount | - * ------------------------------- - * | category 1 | - * | . . . | - * | category N | (where N = ml_catcount) - * ------------------------------- - * | division 1 | - * | . . . | - * | division M | (where M = ml_divcount) - * ------------------------------- - */ -#define XFS_MAC_MAX_SETS 250 -typedef struct xfs_mac_label { - __uint8_t ml_msen_type; /* MSEN label type */ - __uint8_t ml_mint_type; /* MINT label type */ - __uint8_t ml_level; /* Hierarchical level */ - __uint8_t ml_grade; /* Hierarchical grade */ - __uint16_t ml_catcount; /* Category count */ - __uint16_t ml_divcount; /* Division count */ - /* Category set, then Division set */ - __uint16_t ml_list[XFS_MAC_MAX_SETS]; -} xfs_mac_label_t; - -/* MSEN label type names. Choose an upper case ASCII character. */ -#define XFS_MSEN_ADMIN_LABEL 'A' /* Admin: low>XFS_DEV_BITSMINOR) \ - & XFS_DEV_MAXMAJ)) -#define XFS_DEV_MINOR(dev) ((int)((dev)&XFS_DEV_MAXMIN)) -#define XFS_MKDEV(major,minor) ((xfs_dev_t)(((major)<size, ARCH_CONVERT)); INT_SET(entry->hashval, ARCH_CONVERT, args->hashval); entry->flags = tmp ? XFS_ATTR_LOCAL : 0; - entry->flags |= (args->flags & ATTR_ROOT) ? XFS_ATTR_ROOT : 0; + entry->flags |= (args->flags & ATTR_SECURE) ? XFS_ATTR_SECURE : + ((args->flags & ATTR_ROOT) ? XFS_ATTR_ROOT : 0); if (args->rename) { entry->flags |= XFS_ATTR_INCOMPLETE; if ((args->blkno2 == args->blkno) && diff --git a/libxfs/xfs_dir2_node.c b/libxfs/xfs_dir2_node.c index 1345a17c6..e95bf9874 100644 --- a/libxfs/xfs_dir2_node.c +++ b/libxfs/xfs_dir2_node.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2004 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 @@ -1526,15 +1526,16 @@ xfs_dir2_node_addname_int( "%llu needed freesp block %lld for\n" " data block %lld, got %lld\n" " ifbno %llu lastfbno %d\n", - dp->i_ino, - XFS_DIR2_DB_TO_FDB(mp, dbno), - dbno, fbno, - ifbno, lastfbno); + (unsigned long long)dp->i_ino, + (long long)XFS_DIR2_DB_TO_FDB(mp, dbno), + (long long)dbno, (long long)fbno, + (unsigned long long)ifbno, lastfbno); if (fblk) { cmn_err(CE_ALERT, - " fblk 0x%llu blkno %llu " + " fblk 0x%p blkno %llu " "index %d magic 0x%x\n", - fblk, fblk->blkno, + fblk, + (unsigned long long)fblk->blkno, fblk->index, fblk->magic); } else { diff --git a/mkfs/xfs_mkfs.h b/mkfs/xfs_mkfs.h index 99a18deb3..8236a1ef8 100644 --- a/mkfs/xfs_mkfs.h +++ b/mkfs/xfs_mkfs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2001,2004 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 @@ -49,6 +49,14 @@ * accept w/o warnings */ +#define XFS_AG_BYTES(bblog) ((long long)BBSIZE << (bblog)) +#define XFS_AG_MIN_BYTES ((XFS_AG_BYTES(15))) /* 16 MB */ +#define XFS_AG_MIN_BLOCKS(blog) ((XFS_AG_BYTES(15)) >> (blog)) +#define XFS_AG_MAX_BLOCKS(blog) ((XFS_AG_BYTES(31) - 1) >> (blog)) + +#define XFS_MAX_AGNUMBER ((xfs_agnumber_t)(NULLAGNUMBER - 1)) + + /* xfs_mkfs.c */ extern void usage (void); extern int isdigits (char *str); diff --git a/repair/attr_repair.c b/repair/attr_repair.c index 91831f4c5..d64129cfe 100644 --- a/repair/attr_repair.c +++ b/repair/attr_repair.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2002,2004 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 @@ -31,9 +31,6 @@ */ #include -#include -#include -#include #include "globals.h" #include "err_protos.h" #include "attr_repair.h" diff --git a/repair/attr_repair.h b/repair/attr_repair.h index 0dec185d0..253b91f95 100644 --- a/repair/attr_repair.h +++ b/repair/attr_repair.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2002,2004 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 @@ -32,6 +32,9 @@ #ifndef _XR_ATTRREPAIR_H #define _XR_ATTRREPAIR_H +/* + * Access Control Lists + */ #define ACL_USER_OBJ 0x01 /* owner */ #define ACL_USER 0x02 /* additional users */ #define ACL_GROUP_OBJ 0x04 /* group */ @@ -43,6 +46,83 @@ #define ACL_WRITE 02 #define ACL_EXECUTE 01 +typedef __uint16_t xfs_acl_perm_t; +typedef __int32_t xfs_acl_type_t; +typedef __int32_t xfs_acl_tag_t; +typedef __int32_t xfs_acl_id_t; + +typedef struct xfs_acl_entry { + xfs_acl_tag_t ae_tag; + xfs_acl_id_t ae_id; + xfs_acl_perm_t ae_perm; +} xfs_acl_entry_t; + +#define XFS_ACL_MAX_ENTRIES 25 +typedef struct xfs_acl { + __int32_t acl_cnt; + xfs_acl_entry_t acl_entry[XFS_ACL_MAX_ENTRIES]; +} xfs_acl_t; + +#define SGI_ACL_FILE "SGI_ACL_FILE" +#define SGI_ACL_DEFAULT "SGI_ACL_DEFAULT" +#define SGI_ACL_FILE_SIZE (sizeof(SGI_ACL_FILE)-1) +#define SGI_ACL_DEFAULT_SIZE (sizeof(SGI_ACL_DEFAULT)-1) + + +/* + * Mandatory Access Control Labels (IRIX) + */ +#define XFS_MAC_MAX_SETS 250 +typedef struct xfs_mac_label { + __uint8_t ml_msen_type; /* MSEN label type */ + __uint8_t ml_mint_type; /* MINT label type */ + __uint8_t ml_level; /* Hierarchical level */ + __uint8_t ml_grade; /* Hierarchical grade */ + __uint16_t ml_catcount; /* Category count */ + __uint16_t ml_divcount; /* Division count */ + /* Category set, then Division set */ + __uint16_t ml_list[XFS_MAC_MAX_SETS]; +} xfs_mac_label_t; + +/* MSEN label type names. Choose an upper case ASCII character. */ +#define XFS_MSEN_ADMIN_LABEL 'A' /* Admin: low