From: Nathan Scott Date: Thu, 20 Jun 2002 04:51:39 +0000 (+0000) Subject: bump to latest version. X-Git-Tag: v2.2.0~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e49e365fd02abeb2e56f7af5bb89dd73adb751c6;p=thirdparty%2Fxfsprogs-dev.git bump to latest version. --- diff --git a/debian/changelog b/debian/changelog index ccadbc237..7b3ad135d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +xfsprogs (2.1.0-1) unstable; urgency=low + + * New upstream release + * Support for the XFS version 2 log format + + -- Nathan Scott Thu, 20 Jun 2002 14:43:07 +1000 + xfsprogs (2.0.6-2) unstable; urgency=low * Fix a problem in xfs_repair's handling of ACLs diff --git a/doc/CHANGES b/doc/CHANGES index 4e54705bd..f1ab44c16 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -2,6 +2,7 @@ xfsprogs-2.1.0 (14 Jun 2002) - 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 xfsprogs-2.0.6 (30 May 2002) - Fix error returns from log recovery (affects xfs_repair). diff --git a/include/Makefile b/include/Makefile index 149d2f915..018948b9e 100644 --- a/include/Makefile +++ b/include/Makefile @@ -36,7 +36,7 @@ include $(TOPDIR)/include/builddefs HFILES = arch.h 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_cred.h xfs_da_btree.h xfs_dfrag.h xfs_dinode.h \ + xfs_buf_item.h xfs_da_btree.h xfs_dfrag.h xfs_dinode.h \ xfs_dir.h xfs_dir2.h xfs_dir2_block.h xfs_dir2_data.h xfs_dir2_leaf.h \ xfs_dir2_node.h xfs_dir2_sf.h xfs_dir_leaf.h xfs_dir_sf.h xfs_dqblk.h \ xfs_dquot_item.h xfs_extfree_item.h xfs_fs.h xfs_ialloc.h \ @@ -44,8 +44,10 @@ HFILES = arch.h handle.h jdm.h libxfs.h libxlog.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 -DK_HFILES = mountinfo.h volume.h fstyp.h dvh.h -LSRCFILES = platform_defs.h.in builddefs.in buildmacros buildrules $(DK_HFILES) +LHFILES = xfs_acl.h xfs_cap.h xfs_mac.h +DKHFILES = mountinfo.h volume.h fstyp.h dvh.h +LSRCFILES = platform_defs.h.in builddefs.in buildmacros buildrules \ + $(LHFILES) $(DKHFILES) LDIRT = xfs default install : @@ -59,4 +61,4 @@ install-dev: default $(INSTALL) -m 644 $(HFILES) $(PKG_INC_DIR) $(INSTALL) -m 644 platform_defs.h $(PKG_INC_DIR) $(INSTALL) -m 755 -d $(DK_INC_DIR) - $(INSTALL) -m 644 $(DK_HFILES) $(DK_INC_DIR) + $(INSTALL) -m 644 $(DKHFILES) $(DK_INC_DIR) diff --git a/include/libxfs.h b/include/libxfs.h index 430dcc140..9f91e0076 100644 --- a/include/libxfs.h +++ b/include/libxfs.h @@ -69,7 +69,6 @@ #include #include #include -#include #include #include #include diff --git a/include/xfs_acl.h b/include/xfs_acl.h new file mode 100644 index 000000000..35b6e66d8 --- /dev/null +++ b/include/xfs_acl.h @@ -0,0 +1,119 @@ +/* + * 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_FS_POSIX_ACL + +#include + +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 xfs_zone *xfs_acl_zone; + +#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) (-ENOTSUP) +#define xfs_acl_vget(v,p,sz,t) (-ENOTSUP) +#define xfs_acl_vremove(v,t) (-ENOTSUP) +#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_bit.h b/include/xfs_bit.h index 3bf2e83a3..6ba040944 100644 --- a/include/xfs_bit.h +++ b/include/xfs_bit.h @@ -64,9 +64,6 @@ __uint64_t xfs_mask64lo(int n); #define XFS_MASK64LO(n) (((__uint64_t)1 << (n)) - 1) #endif -/* Get low bit set out of 32-bit argument, -1 if none set */ -extern int xfs_lowbit32(__uint32_t v); - /* Get high bit set out of 32-bit argument, -1 if none set */ extern int xfs_highbit32(__uint32_t v); diff --git a/include/xfs_cap.h b/include/xfs_cap.h new file mode 100644 index 000000000..9f3cd16f5 --- /dev/null +++ b/include/xfs_cap.h @@ -0,0 +1,111 @@ +/* + * 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) + +/* On-disk bitfield values, as defined for us by IRIX */ +#define XFS_CAP_CHOWN (0x01LL << 1) +#define XFS_CAP_DAC_WRITE (0x01LL << 2) +#define XFS_CAP_DAC_READ_SEARCH (0x01LL << 3) +#define XFS_CAP_FOWNER (0x01LL << 4) +#define XFS_CAP_DAC_OVERRIDE \ + (XFS_CAP_DAC_WRITE|XFS_CAP_DAC_READ_SEARCH|XFS_CAP_FOWNER) +#define XFS_CAP_FSETID (0x01LL << 5) +#define XFS_CAP_KILL (0x01LL << 6) +#define XFS_CAP_LINK_DIR (0x01LL << 7) +#define XFS_CAP_SETFPRIV (0x01LL << 8) +#define XFS_CAP_SETFCAP XFS_CAP_SETFPRIV +#define XFS_CAP_SETPPRIV (0x01LL << 9) +#define XFS_CAP_SETPCAP XFS_CAP_SETPPRIV +#define XFS_CAP_SETGID (0x01LL << 10) +#define XFS_CAP_SETUID (0x01LL << 11) +#define XFS_CAP_MAC_DOWNGRADE (0x01LL << 12) +#define XFS_CAP_MAC_READ (0x01LL << 13) +#define XFS_CAP_MAC_RELABEL_SUBJ (0x01LL << 14) +#define XFS_CAP_MAC_WRITE (0x01LL << 15) +#define XFS_CAP_MAC_UPGRADE (0x01LL << 16) +#define XFS_CAP_INF_NOFLOAT_OBJ (0x01LL << 17) /* Currently unused */ +#define XFS_CAP_INF_NOFLOAT_SUBJ (0x01LL << 18) /* Currently unused */ +#define XFS_CAP_INF_DOWNGRADE (0x01LL << 19) /* Currently unused */ +#define XFS_CAP_INF_UPGRADE (0x01LL << 20) /* Currently unused */ +#define XFS_CAP_INF_RELABEL_SUBJ (0x01LL << 21) /* Currently unused */ +#define XFS_CAP_AUDIT_CONTROL (0x01LL << 22) +#define XFS_CAP_AUDIT_WRITE (0x01LL << 23) +#define XFS_CAP_MAC_MLD (0x01LL << 24) +#define XFS_CAP_MEMORY_MGT (0x01LL << 25) +#define XFS_CAP_SWAP_MGT (0x01LL << 26) +#define XFS_CAP_TIME_MGT (0x01LL << 27) +#define XFS_CAP_SYSINFO_MGT (0x01LL << 28) +#define XFS_CAP_NVRAM_MGT XFS_CAP_SYSINFO_MGT +#define XFS_CAP_MOUNT_MGT (0x01LL << 29) +#define XFS_CAP_QUOTA_MGT (0x01LL << 30) +#define XFS_CAP_PRIV_PORT (0x01LL << 31) +#define XFS_CAP_STREAMS_MGT (0x01LL << 32) +#define XFS_CAP_SCHED_MGT (0x01LL << 33) +#define XFS_CAP_PROC_MGT (0x01LL << 34) +#define XFS_CAP_SVIPC_MGT (0x01LL << 35) +#define XFS_CAP_NETWORK_MGT (0x01LL << 36) +#define XFS_CAP_DEVICE_MGT (0x01LL << 37) +#define XFS_CAP_MKNOD XFS_CAP_DEVICE_MGT +#define XFS_CAP_ACCT_MGT (0x01LL << 38) +#define XFS_CAP_SHUTDOWN (0x01LL << 39) +#define XFS_CAP_CHROOT (0x01LL << 40) +#define XFS_CAP_DAC_EXECUTE (0x01LL << 41) +#define XFS_CAP_MAC_RELABEL_OPEN (0x01LL << 42) +#define XFS_CAP_SIGMASK (0x01LL << 43) /* Not implemented */ +#define XFS_CAP_XTCB (0x01LL << 44) /* X11 Trusted Client */ + + +#ifdef __KERNEL__ + +#ifdef CONFIG_POSIX_CAP +/* NOT YET IMPLEMENTED */ +#endif + +#endif /* __KERNEL__ */ + +#endif /* __XFS_CAP_H__ */ diff --git a/include/xfs_cred.h b/include/xfs_cred.h deleted file mode 100644 index f2d566e0d..000000000 --- a/include/xfs_cred.h +++ /dev/null @@ -1,183 +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_CRED_H__ -#define __XFS_CRED_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; - -/* - * 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; - - -/* - * 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; - -/* On-disk XFS extended attribute names (access control lists) */ -#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) - -/* On-disk XFS extended attribute names (mandatory access control) */ -#define SGI_MAC_FILE "SGI_MAC_FILE" -#define SGI_MAC_FILE_SIZE (sizeof(SGI_MAC_FILE)-1) - -/* On-disk XFS extended attribute names (capabilities) */ -#define SGI_CAP_FILE "SGI_CAP_FILE" -#define SGI_CAP_FILE_SIZE (sizeof(SGI_CAP_FILE)-1) - -/* MSEN label type names. Choose an upper case ASCII character. */ -#define MSEN_ADMIN_LABEL 'A' /* Admin: low /* For NGROUPS */ -#include -#include - -/* - * Credentials - */ -typedef struct cred { - int cr_ref; /* reference count */ - ushort cr_ngroups; /* number of groups in cr_groups */ - uid_t cr_uid; /* effective user id */ - gid_t cr_gid; /* effective group id */ - uid_t cr_ruid; /* real user id */ - gid_t cr_rgid; /* real group id */ - uid_t cr_suid; /* "saved" user id (from exec) */ - gid_t cr_sgid; /* "saved" group id (from exec) */ - xfs_mac_label_t *cr_mac; /* MAC label for B1 and beyond */ - xfs_cap_set_t cr_cap; /* capability (privilege) sets */ - gid_t cr_groups[NGROUPS]; /* supplementary group list */ -} cred_t; - -#define VREAD 00400 -#define VWRITE 00200 -#define VEXEC 00100 -#define MACEXEC 00100 -#define MACWRITE 00200 -#define MACREAD 00400 - -extern void cred_init(void); -static __inline cred_t *get_current_cred(void) { return NULL; } -/* - * XXX: tes - * This is a hack. - * It assumes that if cred is not null then it is sys_cred which - * has all capabilities. - * One solution may be to implement capable_cred based on linux' capable() - * and initialize all credentials in our xfs linvfs layer. - */ -static __inline int capable_cred(cred_t *cr, int cid) { return (cr==NULL) ? capable(cid) : 1; } -extern struct cred *sys_cred; -#endif /* __KERNEL__ */ - -#endif /* __XFS_CRED_H__ */ diff --git a/include/xfs_mac.h b/include/xfs_mac.h new file mode 100644 index 000000000..813e8927d --- /dev/null +++ b/include/xfs_mac.h @@ -0,0 +1,114 @@ +/* + * 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: lowm_sb.sb_rblocks == 0)? 0 : (ENOSYS)) +# define xfs_rtmount_inodes(m) (((mp)->m_sb.sb_rblocks == 0)? 0 : (ENOSYS)) +#endif /* CONFIG_XFS_RT */ + +#endif /* __KERNEL__ */ #endif /* __XFS_RTALLOC_H__ */ diff --git a/libxfs/xfs_rtalloc.c b/libxfs/xfs_rtalloc.c index befebb3ca..220eae45e 100644 --- a/libxfs/xfs_rtalloc.c +++ b/libxfs/xfs_rtalloc.c @@ -35,6 +35,7 @@ */ #include +extern int xfs_lowbit32(__uint32_t); /* * Get a buffer for the bitmap or summary file block specified. @@ -46,10 +47,10 @@ xfs_rtbuf_get( xfs_trans_t *tp, /* transaction pointer */ xfs_rtblock_t block, /* block number in bitmap or summary */ int issum, /* is summary not bitmap */ - xfs_buf_t **bpp) /* output: buffer for the block */ + xfs_buf_t **bpp) /* output: buffer for the block */ { - xfs_buf_t *bp; /* block buffer, result */ - xfs_daddr_t d; /* disk addr of block */ + xfs_buf_t *bp; /* block buffer, result */ + xfs_daddr_t d; /* disk addr of block */ int error; /* error value */ xfs_fsblock_t fsb; /* fs block number for block */ xfs_inode_t *ip; /* bitmap or summary inode */ @@ -96,7 +97,7 @@ xfs_rtfind_back( xfs_rtword_t *b; /* current word in buffer */ int bit; /* bit number in the word */ xfs_rtblock_t block; /* bitmap block number */ - xfs_buf_t *bp; /* buf for the block */ + xfs_buf_t *bp; /* buf for the block */ xfs_rtword_t *bufp; /* starting word in buffer */ int error; /* error value */ xfs_rtblock_t firstbit; /* first useful bit in the word */ @@ -271,7 +272,7 @@ xfs_rtfind_forw( xfs_rtword_t *b; /* current word in buffer */ int bit; /* bit number in the word */ xfs_rtblock_t block; /* bitmap block number */ - xfs_buf_t *bp; /* buf for the block */ + xfs_buf_t *bp; /* buf for the block */ xfs_rtword_t *bufp; /* starting word in buffer */ int error; /* error value */ xfs_rtblock_t i; /* current bit number rel. to start */ @@ -436,7 +437,7 @@ xfs_rtfree_range( xfs_trans_t *tp, /* transaction pointer */ xfs_rtblock_t start, /* starting block to free */ xfs_extlen_t len, /* length to free */ - xfs_buf_t **rbpp, /* in/out: summary block buffer */ + xfs_buf_t **rbpp, /* in/out: summary block buffer */ xfs_fsblock_t *rsb) /* in/out: summary block number */ { xfs_rtblock_t end; /* end of the freed extent */ @@ -670,10 +671,10 @@ xfs_rtmodify_summary( int log, /* log2 of extent size */ xfs_rtblock_t bbno, /* bitmap block number */ int delta, /* change to make to summary info */ - xfs_buf_t **rbpp, /* in/out: summary block buffer */ + xfs_buf_t **rbpp, /* in/out: summary block buffer */ xfs_fsblock_t *rsb) /* in/out: summary block number */ { - xfs_buf_t *bp; /* buffer for the summary block */ + xfs_buf_t *bp; /* buffer for the summary block */ int error; /* error value */ xfs_fsblock_t sb; /* summary fsblock */ int so; /* index into the summary file */ @@ -737,7 +738,7 @@ xfs_rtfree_extent( xfs_inode_t *ip; /* bitmap file inode */ xfs_mount_t *mp; /* file system mount structure */ xfs_fsblock_t sb; /* summary file block number */ - xfs_buf_t *sumbp; /* summary file block buffer */ + xfs_buf_t *sumbp; /* summary file block buffer */ mp = tp->t_mountp; /* diff --git a/repair/attr_repair.c b/repair/attr_repair.c index f01f49fe4..11a8f0301 100644 --- a/repair/attr_repair.c +++ b/repair/attr_repair.c @@ -31,6 +31,9 @@ */ #include +#include +#include +#include #include "globals.h" #include "err_protos.h" #include "attr_repair.h" @@ -1032,23 +1035,23 @@ xfs_mac_valid(xfs_mac_label_t *lp) * appropriate level, category association. */ switch (lp->ml_msen_type) { - case MSEN_ADMIN_LABEL: - case MSEN_EQUAL_LABEL: - case MSEN_HIGH_LABEL: - case MSEN_MLD_HIGH_LABEL: - case MSEN_LOW_LABEL: - case MSEN_MLD_LOW_LABEL: + case XFS_MSEN_ADMIN_LABEL: + case XFS_MSEN_EQUAL_LABEL: + case XFS_MSEN_HIGH_LABEL: + case XFS_MSEN_MLD_HIGH_LABEL: + case XFS_MSEN_LOW_LABEL: + case XFS_MSEN_MLD_LOW_LABEL: if (lp->ml_level != 0 || lp->ml_catcount > 0 ) return (0); break; - case MSEN_TCSEC_LABEL: - case MSEN_MLD_LABEL: + case XFS_MSEN_TCSEC_LABEL: + case XFS_MSEN_MLD_LABEL: if (lp->ml_catcount > 0 && __check_setvalue(lp->ml_list, lp->ml_catcount) == -1) return (0); break; - case MSEN_UNKNOWN_LABEL: + case XFS_MSEN_UNKNOWN_LABEL: default: return (0); } @@ -1058,15 +1061,15 @@ xfs_mac_valid(xfs_mac_label_t *lp) * appropriate grade, division association. */ switch (lp->ml_mint_type) { - case MINT_BIBA_LABEL: + case XFS_MINT_BIBA_LABEL: if (lp->ml_divcount > 0 && __check_setvalue(lp->ml_list + lp->ml_catcount, lp->ml_divcount) == -1) return(0); break; - case MINT_EQUAL_LABEL: - case MINT_HIGH_LABEL: - case MINT_LOW_LABEL: + case XFS_MINT_EQUAL_LABEL: + case XFS_MINT_HIGH_LABEL: + case XFS_MINT_LOW_LABEL: if (lp->ml_grade != 0 || lp->ml_divcount > 0 ) return(0); break;