LSRCFILES = configure configure.in Makepkgs install-sh README VERSION
LDIRT = config.log config.status config.cache confdefs.h conftest* \
- Logs/* built bfbuilt .census .bfcensus install.* install-dev.* *.gz
+ Logs/* install.* install-dev.* *.gz
SUBDIRS = include libxfs libhandle libdisk \
- bmap db freeze fsck growfs logprint mkfile mkfs repair rtcp \
+ bmap db freeze fsck growfs imap logprint mkfile mkfs repair rtcp \
man doc debian build
default: $(CONFIGURE)
#
PKG_MAJOR=1
PKG_MINOR=3
-PKG_REVISION=9
+PKG_REVISION=10
PKG_BUILD=0
+xfsprogs (1.3.10-0) unstable; urgency=low
+
+ * New upstream release
+ * Fix up some issues building the bootfloppies package
+
+ -- Nathan Scott <nathans@debian.org> Fri, 12 Oct 2001 17:43:20 +1000
+
xfsprogs (1.3.9-0) unstable; urgency=low
* Upstream bug fix release
bfsopts = $(options) OPTIMIZER=-Os; export OPTIMIZER;
checkdir = test -f debian/rules
-build: bfbuilt built
-built: config
+build: built
+built: bfbuild config
@echo "== dpkg-buildpackage: build" 1>&2
$(MAKE) default
touch built
$(options) ./configure
touch .census
-bfbuilt: bfconfig
- @echo "== dpkg-buildpackage: bootfloppies build" 1>&2
- for dir in libxfs libdisk mkfs; \
- do \
- $(MAKE) -C $$dir; \
- done
- mv mkfs/mkfs.xfs mkfs/mkfs.xfs-$(bootpkg)
- $(MAKE) distclean
- touch bfbuilt
-
-bfconfig: .bfcensus
-.bfcensus:
- @echo "== dpkg-buildpackage: bootfloppies configure" 1>&2
+bfbuild:
$(checkdir)
- autoconf
- $(bfsopts) ./configure --enable-shared-uuid=yes
- touch .bfcensus
+ @echo "== dpkg-buildpackage: bootfloppies" 1>&2
+ if [ ! -f mkfs/mkfs.xfs-$(bootpkg) ]; then \
+ autoconf; \
+ $(bfsopts) ./configure --enable-shared-uuid=yes; \
+ for dir in libxfs libdisk mkfs; do $(MAKE) -C $$dir; done; \
+ mv mkfs/mkfs.xfs mkfs/mkfs.xfs-$(bootpkg); \
+ $(MAKE) distclean; \
+ fi
clean:
@echo "== dpkg-buildpackage: clean" 1>&2
$(checkdir)
- -rm -f bfbuilt built .bfcensus .census mkfs/mkfs.xfs-$(bootpkg)
+ -rm -f built .census mkfs/mkfs.xfs-$(bootpkg)
$(MAKE) distclean
-rm -rf $(dirtmp) $(dirdev) $(dirbfs) debian/*substvars debian/files*
# Note2: absolute symlinks (required by policy) confuse debstd;
# so we'll filter out symlink messages entirely now.
#
-binary-arch: checkroot bfbuilt built
+binary-arch: checkroot built
@echo "== dpkg-buildpackage: binary-arch" 1>&2
$(checkdir)
-rm -rf $(dirtmp) $(dirdev) $(dirbfs)
+xfsprogs-1.3.10 (12 October 2001)
+ - sync with XFS kernel header changes for EAs by-handle
+ - ported xfs_imap command for dumping the inode map
+
xfsprogs-1.3.9 (03 October 2001)
- fix xfs_repair bug in handling a corrupt root directory
inode with multiple "lost+found" entries
--- /dev/null
+#
+# Copyright (c) 2000 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/
+#
+
+TOPDIR = ..
+include $(TOPDIR)/include/builddefs
+
+LTCOMMAND = xfs_imap
+CFILES = xfs_imap.c
+
+default: $(LTCOMMAND)
+
+include $(BUILDRULES)
+
+install:
+install-dev:
--- /dev/null
+/*
+ * Copyright (c) 2001 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/
+ */
+
+/*
+ * Inode map display utility for XFS.
+ */
+
+#include <libxfs.h>
+#include <sys/ioctl.h>
+#include <sys/vfs.h>
+
+int main(int argc, char **argv)
+{
+ int count;
+ int nent;
+ int fd;
+ int i;
+ char *name;
+ char *progname;
+ __s64 last = 0;
+ xfs_inogrp_t *t;
+ xfs_fsop_bulkreq_t bulkreq;
+ struct statfs buf;
+
+ progname = basename(argv[0]);
+
+ if (argc < 2)
+ name = ".";
+ else
+ name = argv[1];
+ fd = open(name, O_RDONLY);
+ if (fd < 0) {
+ perror(name);
+ return 1;
+ }
+ fstatfs(fd, &buf);
+ if (buf.f_type != XFS_SUPER_MAGIC) {
+ fprintf(stderr, "%s: "
+ "specified file [\"%s\"] is not on an XFS filesystem\n",
+ progname, name);
+ exit(1);
+ }
+
+ if (argc < 3)
+ nent = 1;
+ else
+ nent = atoi(argv[2]);
+
+ t = malloc(nent * sizeof(*t));
+
+ bulkreq.lastip = &last;
+ bulkreq.icount = nent;
+ bulkreq.ubuffer = t;
+ bulkreq.ocount = &count;
+
+ while (ioctl(fd, XFS_IOC_FSINUMBERS, &bulkreq) == 0) {
+ if (count == 0)
+ return 0;
+ for (i = 0; i < count; i++) {
+ printf("ino %10lld count %2d mask %016llx\n",
+ t[i].xi_startino, t[i].xi_alloccount,
+ t[i].xi_allocmask);
+ }
+ }
+ perror("ioctl(XFS_IOC_FSINUMBERS)");
+ return 1;
+}
#include <linux/sched.h>
#endif
+/*
+ * Access Control Lists
+ */
+typedef ushort acl_perm_t;
+typedef int acl_type_t;
+typedef int acl_tag_t;
+
+#define ACL_MAX_ENTRIES 25
+#define ACL_NOT_PRESENT -1
+
+typedef struct acl_entry {
+ acl_tag_t ae_tag;
+ uid_t ae_id;
+ acl_perm_t ae_perm;
+} acl_entry_s;
+
+typedef struct acl {
+ int acl_cnt;
+ acl_entry_s acl_entry[ACL_MAX_ENTRIES];
+} acl_s;
+
+typedef struct acl_entry * acl_entry_t;
+typedef struct acl * acl_t;
+
/*
* Capabilities
*/
#define _MAC_VACCESS(v,c,m) \
(mac_enabled? (mac_never(), mac_xfs_vaccess(v,c,m)): 0)
-#define VREAD 01
-#define VWRITE 02
+#define VREAD 00400
+#define VWRITE 00200
+#define VEXEC 00100
+#define MACEXEC 00100
+#define MACWRITE 00200
+#define MACREAD 00400
#endif /* __KERNEL__ */
-#define MACWRITE 00200
-#define SGI_MAC_FILE "/dev/null"
-#define SGI_MAC_FILE_SIZE 10
-#define SGI_CAP_FILE "/dev/null"
-#define SGI_CAP_FILE_SIZE 10
+
+/* 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_BI_FILE "SGI_BI_FILE"
+#define SGI_BLS_FILE "SGI_BLS_FILE"
+#define SGI_MAC_FILE "SGI_MAC_FILE"
+#define SGI_BI_FILE_SIZE (sizeof(SGI_BI_FILE)-1)
+#define SGI_BLS_FILE_SIZE (sizeof(SGI_BLS_FILE)-1)
+#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<admin != tcsec<high */
};
/*
- * direct I/O attribute record used with F_DIOINFO
+ * Direct I/O attribute record used with XFS_IOC_DIOINFO
* d_miniosz is the min xfer size, xfer size multiple and file seek offset
* alignment.
*/
};
/*
- * Structure for F_FSGETXATTR[A] and F_FSSETXATTR.
+ * Structure for XFS_IOC_FSGETXATTR[A] and XFS_IOC_FSSETXATTR.
*/
struct fsxattr {
__u32 fsx_xflags; /* xflags field value (get/set) */
/*
- * Structure for F_GETBMAP.
+ * Structure for XFS_IOC_GETBMAP.
* On input, fill in bmv_offset and bmv_length of the first structure
* to indicate the area of interest in the file, and bmv_entry with the
* number of array elements given. The first structure is updated on
};
/*
- * Structure for F_GETBMAPX. The fields bmv_offset through bmv_entries
+ * Structure for XFS_IOC_GETBMAPX. Fields bmv_offset through bmv_entries
* are used exactly as in the getbmap structure. The getbmapx structure
* has additional bmv_iflags and bmv_oflags fields. The bmv_iflags field
* is only used for the first structure. It contains input flags
- * specifying F_GETBMAPX actions. The bmv_oflags field is filled in
- * by the F_GETBMAPX command for each returned structure after the first.
+ * specifying XFS_IOC_GETBMAPX actions. The bmv_oflags field is filled
+ * in by the XFS_IOC_GETBMAPX command for each returned structure after
+ * the first.
*/
struct getbmapx {
__s64 bmv_offset; /* file offset of segment in blocks */
__s32 bmv_unused2; /* future use */
};
-/* bmv_iflags values - set by F_GETBMAPX caller. */
-
+/* bmv_iflags values - set by XFS_IOC_GETBMAPX caller. */
#define BMV_IF_ATTRFORK 0x1 /* return attr fork rather than data */
#define BMV_IF_NO_DMAPI_READ 0x2 /* Do not generate DMAPI read event */
#define BMV_IF_PREALLOC 0x4 /* rtn status BMV_OF_PREALLOC if req */
-
#define BMV_IF_VALID (BMV_IF_ATTRFORK|BMV_IF_NO_DMAPI_READ|BMV_IF_PREALLOC)
+#ifdef __KERNEL__
+#define BMV_IF_EXTENDED 0x40000000 /* getpmapx if set */
+#endif
-/* bmv_oflags values - returned from F_GETBMAPX for each non-header segment */
-
+/* bmv_oflags values - returned for for each non-header segment */
#define BMV_OF_PREALLOC 0x1 /* segment = unwritten pre-allocation */
/* Convert getbmap <-> getbmapx - move fields from p1 to p2. */
-
#define GETBMAP_CONVERT(p1,p2) { \
p2.bmv_offset = p1.bmv_offset; \
p2.bmv_block = p1.bmv_block; \
p2.bmv_count = p1.bmv_count; \
p2.bmv_entries = p1.bmv_entries; }
-#ifdef __KERNEL__
-
-/* Kernel only bmv_iflags value. */
-#define BMV_IF_EXTENDED 0x40000000 /* getpmapx if set */
-
-#endif /* __KERNEL__ */
/*
* Structure for XFS_IOC_FSSETDM.
#define XFS_MAX_LOG_BYTES (128 * 1024 * 1024)
/*
- * XFS_IOC_FSGROWFSDATA
+ * Structures for XFS_IOC_FSGROWFSDATA, XFS_IOC_FSGROWFSLOG & XFS_IOC_FSGROWFSRT
*/
typedef struct xfs_growfs_data {
__u64 newblocks; /* new data subvol size, fsblocks */
__u32 imaxpct; /* new inode space percentage limit */
} xfs_growfs_data_t;
-/*
- * XFS_IOC_FSGROWFSLOG
- */
typedef struct xfs_growfs_log {
__u32 newblocks; /* new log size, fsblocks */
__u32 isint; /* 1 if new log is internal */
} xfs_growfs_log_t;
-/*
- * XFS_IOC_FSGROWFSRT
- */
typedef struct xfs_growfs_rt {
__u64 newblocks; /* new realtime size, fsblocks */
__u32 extsize; /* new realtime extent size, fsblocks */
/*
- * Structures returned from xfs_inumbers syssgi routine.
+ * Structures returned from xfs_inumbers routine (XFS_IOC_FSINUMBERS).
*/
typedef struct xfs_inogrp {
__u64 xi_startino; /* starting inode number */
} xfs_inogrp_t;
+/*
+ * Error injection.
+ */
+typedef struct xfs_error_injection {
+ __s32 fd;
+ __s32 errtag;
+} xfs_error_injection_t;
+
+
/*
* The user-level Handle Request interface structure.
*/
__u32 *ohandlen; /* user buffer length */
} xfs_fsop_handlereq_t;
-/*
- * Error injection can be turned on ethier by DEBUG or by INDUCE_IO_ERROR
- * below since relying only on DEBUG will undoubtedly be a different
- * code path.
- */
-/*#define INDUCE_IO_ERROR*/
-
-#if (defined(DEBUG) || defined(INDUCE_IO_ERROR))
/*
- * Error injection.
+ * Compound structures for passing args through Handle Request interfaces
+ * xfs_fssetdm_by_handle, xfs_attrlist_by_handle, xfs_attrmulti_by_handle
+ * - ioctls: XFS_IOC_FSSETDM_BY_HANDLE, XFS_IOC_ATTRLIST_BY_HANDLE, and
+ * XFS_IOC_ATTRMULTI_BY_HANDLE
*/
-typedef struct xfs_error_injection {
- __s32 fd;
- __s32 errtag;
-} xfs_error_injection_t;
-#endif /* DEBUG || INDUCE_IO_ERROR */
+
+typedef struct xfs_fsop_setdm_handlereq {
+ struct xfs_fsop_handlereq hreq; /* handle interface structure */
+ struct fsdmidata *data; /* DMAPI data to set */
+} xfs_fsop_setdm_handlereq_t;
+
+typedef struct xfs_attrlist_cursor {
+ __u32 opaque[4];
+} xfs_attrlist_cursor_t;
+
+typedef struct xfs_fsop_attrlist_handlereq {
+ struct xfs_fsop_handlereq hreq; /* handle interface structure */
+ struct xfs_attrlist_cursor pos; /* opaque cookie, list offset */
+ __u32 flags; /* flags, use ROOT/USER names */
+ __u32 buflen; /* length of buffer supplied */
+ void *buffer; /* attrlist data to return */
+} xfs_fsop_attrlist_handlereq_t;
+
+typedef struct xfs_attr_multiop {
+ __u32 am_opcode;
+ __s32 am_error;
+ void *am_attrname;
+ void *am_attrvalue;
+ __u32 am_length;
+ __u32 am_flags;
+} xfs_attr_multiop_t;
+
+typedef struct xfs_fsop_attrmulti_handlereq {
+ struct xfs_fsop_handlereq hreq; /* handle interface structure */
+ __u32 opcount; /* count of following multiop */
+ struct xfs_attr_multiop *ops; /* attr_multi data to get/set */
+} xfs_fsop_attrmulti_handlereq_t;
/*
- * Compound structure for passing args through ioctl to xfs_attrctl_by_handle
+ * Structure for XFS_IOC_ATTRCTL_BY_HANDLE ioctl, will be removed later.
*/
typedef struct xfs_fsop_attr_handlereq {
struct xfs_fsop_handlereq *hreq;/* handle request interface */
int count; /* number of attribute ops */
} xfs_fsop_attr_handlereq_t;
-/*
- * Compound structure for passing args through ioctl to xfs_fssetdm_by_handle
- */
-typedef struct xfs_fsop_setdm_handlereq {
- struct xfs_fsop_handlereq hreq; /* handle request interface */
- /* structure */
- struct fsdmidata *data; /* DMAPI data to set */
-} xfs_fsop_setdm_handlereq_t;
-
/*
* File system identifier. Should be unique (at least per machine).
*/
* "file handles".
*/
#define MAXFIDSZ 46
-
typedef struct fid {
__u16 fid_len; /* length of data in bytes */
unsigned char fid_data[MAXFIDSZ]; /* data (variable length) */
} ha_u;
xfs_fid_t ha_fid; /* file system specific file ID */
} xfs_handle_t;
-
#define ha_fsid ha_u._ha_fsid
#define XFS_HSIZE(handle) (((char *) &(handle).ha_fid.xfs_fid_pad \
#define XFS_IOC_FSCOUNTS _IOR ('X', 113, struct xfs_fsop_counts)
#define XFS_IOC_SET_RESBLKS _IOR ('X', 114, struct xfs_fsop_resblks)
#define XFS_IOC_GET_RESBLKS _IOR ('X', 115, struct xfs_fsop_resblks)
-#if (defined(DEBUG) || defined(INDUCE_IO_ERROR))
#define XFS_IOC_ERROR_INJECTION _IOW ('X', 116, struct xfs_error_injection)
#define XFS_IOC_ERROR_CLEARALL _IOW ('X', 117, struct xfs_error_injection)
-#endif /* DEBUG || INDUCE_IO_ERROR */
+/* XFS_IOC_ATTRCTL_BY_HANDLE -- deprecated 118 */
#define XFS_IOC_ATTRCTL_BY_HANDLE _IOWR('X', 118, struct xfs_fsop_attr_handlereq)
#define XFS_IOC_FREEZE _IOWR('X', 119, int)
#define XFS_IOC_THAW _IOWR('X', 120, int)
#define XFS_IOC_FSSETDM_BY_HANDLE _IOW ('X', 121, struct xfs_fsop_setdm_handlereq)
+#define XFS_IOC_ATTRLIST_BY_HANDLE _IOW ('X', 122, struct xfs_fsop_attrlist_handlereq)
+#define XFS_IOC_ATTRMULTI_BY_HANDLE _IOW ('X', 123, struct xfs_fsop_attrmulti_handlereq)
/*
* ioctl command to export information not in standard interfaces
* 140: IRIX statvfs.f_fstr field - UUID from the superblock
*/
-#define XFS_IOC_GETFSUUID _IOR ('X', 140, unsigned char[16])
+#define XFS_IOC_GETFSUUID _IOR ('X', 140, unsigned char[16])
/*
*
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
*/
-
#ifndef _XR_ATTRREPAIR_H
#define _XR_ATTRREPAIR_H
-struct blkmap;
-
-#define SGI_ACL_FILE "SGI_ACL_FILE"
-#define SGI_ACL_DEFAULT "SGI_ACL_DEFAULT"
-#define SGI_ACL_FILE_SIZE 12
-#define SGI_ACL_DEFAULT_SIZE 15
-
-#define ACL_MAX_ENTRIES 25
#define ACL_USER_OBJ 0x01 /* owner */
#define ACL_USER 0x02 /* additional users */
#define ACL_GROUP_OBJ 0x04 /* group */
#define ACL_MASK 0x10 /* mask entry */
#define ACL_OTHER_OBJ 0x20 /* other entry */
-typedef ushort acl_perm_t;
-typedef int acl_type_t;
-typedef int acl_tag_t;
-
-/*
- * On-disk representation of an ACL.
- */
-struct acl_entry {
- acl_tag_t ae_tag;
- uid_t ae_id;
- acl_perm_t ae_perm;
-};
-
-typedef struct acl_entry * acl_entry_t;
-
-struct acl {
- int acl_cnt; /* Number of entries */
- struct acl_entry acl_entry[ACL_MAX_ENTRIES];
-};
-
-int
-process_attributes(
- xfs_mount_t *mp,
- xfs_ino_t ino,
- xfs_dinode_t *dip,
- struct blkmap *blkmap,
- int *repair);
+struct blkmap;
+extern int process_attributes (xfs_mount_t *, xfs_ino_t, xfs_dinode_t *,
+ struct blkmap *, int *);
#endif /* _XR_ATTRREPAIR_H */