add a couple more inode flags needed initially on IRIX (Linux soon).
Bump version number.
#
PKG_MAJOR=2
PKG_MINOR=6
-PKG_REVISION=21
+PKG_REVISION=22
PKG_BUILD=1
/*
- * 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
{ "rtinherit", FLDT_UINT1,
OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_RTINHERIT_BIT-1), C1,
0, TYP_NONE },
+ { "projinherit", FLDT_UINT1,
+ OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_PROJINHERIT_BIT-1),C1,
+ 0, TYP_NONE },
+ { "nosymlinks", FLDT_UINT1,
+ OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_NOSYMLINKS_BIT-1), C1,
+ 0, TYP_NONE },
{ "gen", FLDT_UINT32D, OI(COFF(gen)), C1, 0, TYP_NONE },
{ NULL }
};
+xfsprogs (2.6.22-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Nathan Scott <nathans@debian.org> Fri, 10 Sep 2004 11:10:57 +1000
+
xfsprogs (2.6.21-1) unstable; urgency=low
* New upstream release.
-[cvs]
+xfsprogs-2.6.22 (10 September 2004)
+ - Update xfs_io to get a clean compile on IRIX with the
+ MIPSPro compilers.
- Add documentation about additional XFS inode flags.
+ - Add xfs_io write options to include fsync/fdatasync
+ in the timing results it displays.
+ - Add xfs_fsop_counts output to the xfs_io statfs data,
+ which also shows free realtime space, etc.
+ - Add knowledge of additional inode flags for nosymlinks
+ and project ID inheritance.
xfsprogs-2.6.21 (09 August 2004)
- Support realtime bit inheritance on directories.
#include <sys/syssgi.h>
#include <sys/sysmacros.h>
#include <sys/fs/xfs_fsops.h>
-//#include <sys/fs/xfs_itable.h>
+#include <sys/fs/xfs_itable.h>
#define __s8 char
#define __s16 short
#define __BYTE_ORDER BYTE_ORDER
#define __BIG_ENDIAN BIG_ENDIAN
#define __LITTLE_ENDIAN LITTLE_ENDIAN
-#include <xfs/swab.h>
+#define __fswab16(x) (x)
+#define __fswab32(x) (x)
+#define __fswab64(x) (x)
+
+/* Map some gcc macros for the MipsPRO compiler */
+#ifndef __GNUC__
+#define __sgi__ __sgi
+#define __inline__ __inline
+#endif
#define INT_MAX INT32_MAX
#define UINT_MAX UINT32_MAX
#define HAVE_IOCMACROS 1
#define HAVE_BBMACROS 1
-#define __XFS_FS_H__
+#define __XFS_FS_H__ 1
#define XFS_IOC_DIOINFO F_DIOINFO
#define XFS_IOC_FSGETXATTR F_FSGETXATTR
#define XFS_IOC_FSGEOMETRY XFS_FS_GEOMETRY
#define XFS_IOC_GOINGDOWN XFS_FS_GOINGDOWN
-#define XFS_XFLAG_REALTIME 0x00000001 /* data in realtime volume */
-#define XFS_XFLAG_PREALLOC 0x00000002 /* preallocated file extents */
-#define XFS_XFLAG_IMMUTABLE 0x00000008 /* file cannot be modified */
-#define XFS_XFLAG_APPEND 0x00000010 /* all writes append */
-#define XFS_XFLAG_SYNC 0x00000020 /* all writes synchronous */
-#define XFS_XFLAG_NOATIME 0x00000040 /* do not update access time */
-#define XFS_XFLAG_NODUMP 0x00000080 /* do not include in backups */
-#define XFS_XFLAG_RTINHERIT 0x00000100 /* new files have rt bit set */
-#define XFS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */
-
-
#endif /* __XFS_IRIX_H__ */
#include <xfs/freebsd.h>
#elif defined(__APPLE__)
#include <xfs/darwin.h>
-#elif defined(__sgi__)
+#elif defined(__sgi__) || defined(___sgi)
#include <xfs/irix.h>
#else
# error unknown platform... have fun porting!
#define XFS_DIFLAG_NOATIME_BIT 6 /* do not update atime */
#define XFS_DIFLAG_NODUMP_BIT 7 /* do not dump */
#define XFS_DIFLAG_RTINHERIT_BIT 8 /* create with realtime bit set */
+#define XFS_DIFLAG_PROJINHERIT_BIT 9 /* create with parents project id */
+#define XFS_DIFLAG_NOSYMLINKS_BIT 10 /* disallow symlink creation */
#define XFS_DIFLAG_REALTIME (1 << XFS_DIFLAG_REALTIME_BIT)
#define XFS_DIFLAG_PREALLOC (1 << XFS_DIFLAG_PREALLOC_BIT)
#define XFS_DIFLAG_NEWRTBM (1 << XFS_DIFLAG_NEWRTBM_BIT)
#define XFS_DIFLAG_NOATIME (1 << XFS_DIFLAG_NOATIME_BIT)
#define XFS_DIFLAG_NODUMP (1 << XFS_DIFLAG_NODUMP_BIT)
#define XFS_DIFLAG_RTINHERIT (1 << XFS_DIFLAG_RTINHERIT_BIT)
+#define XFS_DIFLAG_PROJINHERIT (1 << XFS_DIFLAG_PROJINHERIT_BIT)
+#define XFS_DIFLAG_NOSYMLINKS (1 << XFS_DIFLAG_NOSYMLINKS_BIT)
#define XFS_DIFLAG_ANY \
(XFS_DIFLAG_REALTIME | XFS_DIFLAG_PREALLOC | XFS_DIFLAG_NEWRTBM | \
XFS_DIFLAG_IMMUTABLE | XFS_DIFLAG_APPEND | XFS_DIFLAG_SYNC | \
- XFS_DIFLAG_NOATIME | XFS_DIFLAG_NODUMP | XFS_DIFLAG_RTINHERIT)
+ XFS_DIFLAG_NOATIME | XFS_DIFLAG_NODUMP | XFS_DIFLAG_RTINHERIT | \
+ XFS_DIFLAG_PROJINHERIT | XFS_DIFLAG_NOSYMLINKS)
#endif /* __XFS_DINODE_H__ */
#define XFS_XFLAG_NOATIME 0x00000040 /* do not update access time */
#define XFS_XFLAG_NODUMP 0x00000080 /* do not include in backups */
#define XFS_XFLAG_RTINHERIT 0x00000100 /* create with rt bit set */
+#define XFS_XFLAG_PROJINHERIT 0x00000200 /* create with parents projid */
+#define XFS_XFLAG_NOSYMLINKS 0x00000400 /* disallow symlink creation */
#define XFS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */
/*
printf("%c%d%c 0x%lx - 0x%lx %s %14s (%lld : %ld)\n",
braces? '[' : ' ', index, braces? ']' : ' ',
(unsigned long)map->addr,
- (unsigned long)(map->addr + map->length),
+ (unsigned long)((char *)map->addr + map->length),
buffer, map->name ? map->name : "???",
(long long)map->offset, (long)map->length);
}
(long long)mapping->offset, (long)mapping->length);
return NULL;
}
- if (pagealign && (long)(mapping->addr + relative) % pagesize) {
+ if (pagealign && (long)((char *)mapping->addr + relative) % pagesize) {
printf(_("offset address (%p) is not page aligned\n"),
- mapping->addr + relative);
+ (char *)mapping->addr + relative);
return NULL;
}
- return mapping->addr + relative;
+ return (char *)mapping->addr + relative;
}
int
char **argv)
{
off64_t offset;
- size_t length;
+ ssize_t length;
void *address;
char *filename;
int blocksize, sectsize;
char **argv)
{
off64_t offset;
- size_t length;
+ ssize_t length;
void *start;
int c, flags = 0, blocksize, sectsize;
char **argv)
{
off64_t offset, tmp;
- size_t length, dumplen;
+ ssize_t length;
+ size_t dumplen;
char *bp;
void *start;
int dump = 0, rflag = 0;
int argc,
char **argv)
{
- size_t length;
+ ssize_t length;
unsigned int offset;
if (munmap(mapping->addr, mapping->length) < 0) {
char **argv)
{
off64_t offset, tmp;
- size_t length;
+ ssize_t length;
void *start;
char *sp;
int seed = 'X';
static cmdinfo_t statfs_cmd;
static cmdinfo_t chattr_cmd;
static cmdinfo_t lsattr_cmd;
+static cmdinfo_t chproj_cmd;
+static cmdinfo_t lsproj_cmd;
static cmdinfo_t extsize_cmd;
off64_t
{ XFS_XFLAG_NOATIME, "A", "no-atime" },
{ XFS_XFLAG_NODUMP, "d", "no-dump" },
{ XFS_XFLAG_RTINHERIT, "R", "rt-inherit" },
+ { XFS_XFLAG_PROJINHERIT,"P", "proj-inherit" },
+ { XFS_XFLAG_NOSYMLINKS, "S", "nosymlinks" },
{ 0, NULL, NULL }
};
int first = 1;
" s -- all updates are synchronous\n"
" A -- the access time is not updated for this inode\n"
" d -- do not include this file in a dump of the filesystem\n"
+" R -- child created in this directory has realtime bit set by default\n"
+" P -- child created in this directory has parents project ID by default\n"
+" S -- symbolic links cannot be created in this directory\n"
"\n"
" Options:\n"
" -a -- show all flags which can be set alongside those which are set\n"
{ XFS_XFLAG_NOATIME, 'A' },
{ XFS_XFLAG_NODUMP, 'd' },
{ XFS_XFLAG_RTINHERIT, 'R' },
+ { XFS_XFLAG_PROJINHERIT,'P' },
+ { XFS_XFLAG_NOSYMLINKS, 'S' },
{ 0, '\0' }
};
struct fsxattr attr;
" +/-s -- set/clear the sync flag\n"
" +/-A -- set/clear the no-atime flag\n"
" +/-d -- set/clear the no-dump flag\n"
+" +/-R -- set/clear the realtime inheritance flag\n"
+" +/-P -- set/clear the project ID inheritance flag\n"
+" +/-S -- set/clear the no-symbolic-links flag\n"
" Note1: user must have certain capabilities to modify immutable/append-only.\n"
" Note2: immutable/append-only files cannot be deleted; removing these files\n"
" requires the immutable/append-only flag to be cleared first.\n"
"\n"));
}
+static int
+lsproj_f(
+ int argc,
+ char **argv)
+{
+ __uint32_t id;
+
+#if defined(__sgi__)
+ struct stat64 st;
+ if (fstat64(file->fd, &st) < 0) {
+ perror("fstat64");
+ return 0;
+ }
+ id = st.st_projid;
+#else
+ id = 0;
+#endif
+ printf("projid = %u\n", (unsigned int)id);
+ return 0;
+}
+
+static int
+chproj_f(
+ int argc,
+ char **argv)
+{
+ __uint32_t id;
+ char *sp;
+
+ id = (__uint32_t) strtoul(argv[1], &sp, 0);
+ if (!sp || sp == argv[1]) {
+ printf(_("non-numeric project ID -- %s\n"), argv[1]);
+ return 0;
+ }
+#if defined(__sgi__)
+ if (fchproj(file->fd, id) < 0)
+ perror("fchproj");
+#else
+ printf(_("Not yet implemented\n"));
+#endif
+ return 0;
+}
+
static int
setfl_f(
int argc,
int argc,
char **argv)
{
+ struct xfs_fsop_counts fscounts;
struct xfs_fsop_geom fsgeo;
struct statfs st;
printf(_("geom.sunit = %u\n"), fsgeo.sunit);
printf(_("geom.swidth = %u\n"), fsgeo.swidth);
}
+ if ((xfsctl(file->name, file->fd, XFS_IOC_FSCOUNTS, &fscounts)) < 0) {
+ perror("XFS_IOC_FSCOUNTS");
+ } else {
+ printf(_("counts.freedata = %llu\n"),
+ (unsigned long long) fscounts.freedata);
+ printf(_("counts.freertx = %llu\n"),
+ (unsigned long long) fscounts.freertx);
+ printf(_("counts.freeino = %llu\n"),
+ (unsigned long long) fscounts.freeino);
+ printf(_("counts.allocino = %llu\n"),
+ (unsigned long long) fscounts.allocino);
+ }
return 0;
}
_("list extended inode flags set on the currently open file");
lsattr_cmd.help = lsattr_help;
+ chproj_cmd.name = _("chproj");
+ chproj_cmd.cfunc = chproj_f;
+ chproj_cmd.args = _("projid");
+ chproj_cmd.argmin = 1;
+ chproj_cmd.argmax = 1;
+ chproj_cmd.flags = CMD_NOMAP_OK;
+ chproj_cmd.oneline =
+ _("change project identifier on the currently open file");
+
+ lsproj_cmd.name = _("lsproj");
+ lsproj_cmd.cfunc = lsproj_f;
+ lsproj_cmd.argmin = 0;
+ lsproj_cmd.argmax = 0;
+ lsproj_cmd.flags = CMD_NOMAP_OK;
+ lsproj_cmd.oneline =
+ _("list project identifier set on the currently open file");
+
extsize_cmd.name = _("extsize");
extsize_cmd.cfunc = extsize_f;
extsize_cmd.argmin = 1;
add_command(&statfs_cmd);
add_command(&chattr_cmd);
add_command(&lsattr_cmd);
+ add_command(&chproj_cmd);
+ add_command(&lsproj_cmd);
if (expert)
add_command(&extsize_cmd);
{
off64_t offset;
long long count, total;
- unsigned int blocksize, sectsize;
+ int blocksize, sectsize;
struct timeval t1, t2;
char s1[64], s2[64], ts[64];
int uflag = 0, vflag = 0;
" -i -- specifies an input file from which to source data to write\n"
" -d -- open the input file for direct IO\n"
" -s -- skip a number of bytes at the start of the input file\n"
+" -w -- call fdatasync(2) at the end (included in timing results)\n"
+" -W -- call fsync(2) at the end (included in timing results)\n"
" The writes are performed in sequential blocks starting at offset, with the\n"
" blocksize tunable using the -b option (default blocksize is 4096 bytes).\n"
"\n"));
off64_t offset, skip = 0;
long long count, total;
unsigned int seed = 0xcdcdcdcd;
- unsigned int blocksize, sectsize;
+ int blocksize, sectsize;
struct timeval t1, t2;
char s1[64], s2[64], ts[64];
char *sp, *infile = NULL;
- int c, fd = -1, uflag = 0, dflag = 0;
+ int c, fd = -1, uflag = 0, dflag = 0, wflag = 0, Wflag = 0;
init_cvtnum(&blocksize, §size);
- while ((c = getopt(argc, argv, "b:df:i:s:S:u")) != EOF) {
+ while ((c = getopt(argc, argv, "b:df:i:s:S:uwW")) != EOF) {
switch (c) {
case 'b':
blocksize = cvtnum(blocksize, sectsize, optarg);
case 'u':
uflag = 1;
break;
+ case 'w':
+ wflag = 1;
+ break;
+ case 'W':
+ Wflag = 1;
+ break;
default:
return command_usage(&pwrite_cmd);
}
close(fd);
return 0;
}
+ if (Wflag)
+ fsync(file->fd);
+ if (wflag)
+ fdatasync(file->fd);
gettimeofday(&t2, NULL);
t2 = tsub(t2, t1);
pwrite_cmd.argmax = -1;
pwrite_cmd.flags = CMD_NOMAP_OK | CMD_FOREIGN_OK;
pwrite_cmd.args =
- _("[-i infile [-d] [-s skip]] [-b bs] [-S seed] off len");
+ _("[-i infile [-d] [-s skip]] [-b bs] [-S seed] [-wW] off len");
pwrite_cmd.oneline =
_("writes a number of bytes at a specified offset");
pwrite_cmd.help = pwrite_help;