# This file is used by configure to get version information
#
PKG_MAJOR=2
-PKG_MINOR=4
-PKG_REVISION=12
+PKG_MINOR=5
+PKG_REVISION=0
PKG_BUILD=0
+xfsprogs (2.5.0-1) unstable; urgency=low
+
+ * New upstream release
+ * Changed mkfs.xfs default log size scaling algorithm slightly, to
+ create larger logs at smaller filesystem sizes by default
+ * Enable support for sector sizes larger than 512 bytes
+
+ -- Nathan Scott <nathans@debian.org> Wed, 18 Jun 2003 12:56:16 +1000
+
xfsprogs (2.4.12-1) unstable; urgency=low
* New upstream release
+xfsprogs-2.5.0 (18 June 2003)
+ - Fix libdisk (and hence mkfs) code which warns on MD devices
+ with the clean flag not set, apparently this is not so wise.
+ - Fix libxfs_device_zero to work with smaller-than-requested
+ write return values.
+ - Fix error in xfs_io pwrite code with large request sizes.
+ - Fix rounding-down-input problems in several xfs_io commands.
+ - Changed mkfs.xfs default log size scaling algorithm slightly,
+ to create larger logs at smaller filesystem sizes by default
+ (thanks to Andi Kleen for the patch).
+ - Enable support for sector sizes larger than 512 bytes.
+
xfsprogs-2.4.12 (02 June 2003)
- Fix xfs_logprint handling of any version 2 log device.
- Remove calls to exit in libhandle, propogate errors to
S: 181 00 Praha 8
S: Czech Republic
+N: Andi Kleen
+E: ak@muc.de
+D: Most recently, fine-tuning default mkfs/mount logsize/logbufs values
+S: Schwalbenstr. 96
+S: 85551 Ottobrunn
+S: Germany
+
N: Seth Mos
E: seth@arosa.nl
D: XFS FAQ ( http://oss.sgi.com/projects/xfs/faq.html ) maintainer
#endif
#ifndef _BOOLEAN_T_DEFINED
- typedef enum { B_FALSE, B_TRUE } boolean_t;
- #define _BOOLEAN_T_DEFINED 1
+typedef enum {B_FALSE, B_TRUE} boolean_t;
+#define _BOOLEAN_T_DEFINED 1
#endif
#elif defined(__FreeBSD__)
#define XFS_IUIOSZ 0x0002 /* inode i/o sizes have been explicitly set */
#define XFS_IQUIESCE 0x0004 /* we have started quiescing for this inode */
#define XFS_IRECLAIM 0x0008 /* we have started reclaiming this inode */
+#define XFS_IRECLAIMABLE 0x0010 /* inode can be reclaimed */
/*
* Flags for inode locking.
extern xfs_mount_t *xfs_mount_init(void);
extern void xfs_mod_sb(xfs_trans_t *, __int64_t);
extern void xfs_mount_free(xfs_mount_t *mp, int remove_bhv);
-extern int xfs_mountfs(struct vfs *, xfs_mount_t *mp, dev_t, int);
+extern int xfs_mountfs(struct vfs *, xfs_mount_t *mp, int);
extern int xfs_unmountfs(xfs_mount_t *, struct cred *);
extern void xfs_unmountfs_close(xfs_mount_t *, struct cred *);
XFS_SB_VERSION_OKREALFBITS | \
XFS_SB_VERSION_OKSASHFBITS)
#define XFS_SB_VERSION_MKFS(ia,dia,extflag,dirv2,na,sflag) \
- (((ia) || (dia) || (extflag) || (dirv2) || (na)) ? \
+ (((ia) || (dia) || (extflag) || (dirv2) || (na) || (sflag)) ? \
(XFS_SB_VERSION_4 | \
((ia) ? XFS_SB_VERSION_ALIGNBIT : 0) | \
((dia) ? XFS_SB_VERSION_DALIGNBIT : 0) | \
typedef signed long long int __int64_t;
typedef unsigned long long int __uint64_t;
-#ifndef _BOOLEAN_T_DEFINED
- typedef enum { B_FALSE, B_TRUE } boolean_t;
- #define _BOOLEAN_T_DEFINED 1
-#endif
-
+typedef enum { B_FALSE,B_TRUE } boolean_t;
typedef __int64_t prid_t; /* project ID */
typedef __uint32_t inst_t; /* an instruction */
unsigned int extsize;
char *sp;
- extsize = strtoul(argv[1], &sp, 10);
+ extsize = strtoul(argv[1], &sp, 0);
if (!sp || sp == argv[1]) {
printf(_("non-numeric extsize argument -- %s\n"), argv[1]);
return 0;
printf("%s %s\n", pread_cmd.name, pread_cmd.oneline);
return 0;
}
- offset = strtoul(argv[optind], &sp, 0);
+ offset = (off64_t) strtoull(argv[optind], &sp, 0);
if (!sp || sp == argv[optind]) {
printf(_("non-numeric offset argument -- %s\n"), argv[optind]);
return 0;
memset(segment, 0, sizeof(*segment));
segment->l_whence = SEEK_SET;
- segment->l_start = strtoul(offset, &sp, 0);
+ segment->l_start = strtoull(offset, &sp, 0);
if (!sp || sp == offset) {
printf(_("non-numeric offset argument -- %s\n"), offset);
return 0;
}
- segment->l_len = strtoul(length, &sp, 0);
+ segment->l_len = strtoull(length, &sp, 0);
if (!sp || sp == length) {
printf(_("non-numeric length argument -- %s\n"), length);
return 0;
off64_t skip,
ssize_t *total)
{
- ssize_t bytes, itotal = min(bs,count);
+ ssize_t bytes, bytes_requested, itotal = min(bs, count);
*total = 0;
while (count > 0) {
if (!read_buffer(fd, skip + *total, bs, &itotal, 0, 1))
break;
}
- bytes = pwrite64(fdesc, buffer, min(itotal,count), offset);
+ bytes_requested = min(itotal, count);
+ bytes = pwrite64(fdesc, buffer, bytes_requested, offset);
if (bytes == 0)
break;
if (bytes < 0) {
return 0;
}
*total += bytes;
- if (bytes < count)
+ if (bytes < bytes_requested)
break;
offset += bytes;
count -= bytes;
infile = optarg;
break;
case 's':
- skip = strtoul(optarg, &sp, 0);
+ skip = (off64_t) strtoull(optarg, &sp, 0);
if (!sp || sp == optarg) {
printf(_("non-numeric skip -- %s\n"), optarg);
return 0;
printf("%s %s\n", pwrite_cmd.name, pwrite_cmd.oneline);
return 0;
}
- offset = strtoul(argv[optind], &sp, 0);
+ offset = (off64_t) strtoull(argv[optind], &sp, 0);
if (!sp || sp == argv[optind]) {
printf(_("non-numeric offset argument -- %s\n"), argv[optind]);
return 0;
char *sp;
if (argc == 2) {
- res.resblks = strtoul(argv[1], &sp, 10);
+ res.resblks = strtoull(argv[1], &sp, 10);
if (!sp || sp == argv[1]) {
printf(_("non-numeric argument -- %s\n"), argv[1]);
return 0;
off64_t offset;
char *sp;
- offset = strtoul(argv[1], &sp, 10);
+ offset = (off64_t) strtoull(argv[1], &sp, 10);
if (!sp || sp == argv[1]) {
printf(_("non-numeric truncate argument -- %s\n"), argv[1]);
return 0;
/*
- * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
+ * Copyright (c) 2000-2003 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
close(fd);
/* Check state */
- if (!(md.state & (1 << MD_SB_CLEAN))) {
- fprintf(stderr,
- _("warning - MD array %s not in clean state\n"),
- dfile);
- }
if (md.state & (1 << MD_SB_ERRORS)) {
fprintf(stderr,
_("warning - MD array %s in error state\n"),
/*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
+ * Copyright (c) 2000-2003 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
#define BBTOOFF64(bbs) (((xfs_off_t)(bbs)) << BBSHIFT)
#define BDSTRAT_SIZE (256 * 1024)
+#define min(x, y) ((x) < (y) ? (x) : (y))
void
libxfs_device_zero(dev_t dev, xfs_daddr_t start, uint len)
{
- xfs_daddr_t bno;
- uint nblks;
- int size;
- int fd;
+ xfs_off_t start_offset, end_offset, offset;
+ ssize_t zsize, bytes;
char *z;
+ int fd;
- size = BDSTRAT_SIZE <= BBTOB(len) ? BDSTRAT_SIZE : BBTOB(len);
- if ((z = memalign(getpagesize(), size)) == NULL) {
+ zsize = min(BDSTRAT_SIZE, BBTOB(len));
+ if ((z = memalign(getpagesize(), zsize)) == NULL) {
fprintf(stderr,
_("%s: %s can't memalign %d bytes: %s\n"),
- progname, __FUNCTION__, size, strerror(errno));
+ progname, __FUNCTION__, zsize, strerror(errno));
exit(1);
}
- memset(z, 0, size);
+ memset(z, 0, zsize);
+
fd = libxfs_device_to_fd(dev);
- for (bno = start; bno < start + len; ) {
- nblks = (uint)BTOBB(size);
- if (bno + nblks > start + len)
- nblks = (uint)(start + len - bno);
- if (pwrite64(fd, z, BBTOB(nblks), BBTOOFF64(bno)) <
- BBTOB(nblks)) {
- fprintf(stderr,
- _("%s: %s write failed: %s\n"),
+ start_offset = BBTOOFF64(start);
+
+ if ((lseek64(fd, start_offset, SEEK_SET)) < 0) {
+ fprintf(stderr, _("%s: %s seek to offset %llu failed: %s\n"),
+ progname, __FUNCTION__, start_offset, strerror(errno));
+ exit(1);
+ }
+
+ end_offset = BBTOOFF64(start + len) - start_offset;
+ for (offset = 0; offset < end_offset; ) {
+ bytes = min((ssize_t)(end_offset - offset), zsize);
+ if ((bytes = write(fd, z, bytes)) < 0) {
+ fprintf(stderr, _("%s: %s write failed: %s\n"),
progname, __FUNCTION__, strerror(errno));
exit(1);
+ } else if (bytes == 0) {
+ fprintf(stderr, _("%s: %s not progressing?\n"),
+ progname, __FUNCTION__);
+ exit(1);
}
- bno += nblks;
+ offset += bytes;
}
free(z);
}
mp->m_dev, (unsigned long long)imap.im_blkno, i,
INT_GET(dip->di_core.di_magic, ARCH_CONVERT));
#endif
- XFS_CORRUPTION_ERROR("xfs_itobp", XFS_ERRLEVEL_LOW,
+ XFS_CORRUPTION_ERROR("xfs_itobp", XFS_ERRLEVEL_HIGH,
mp, dip);
xfs_trans_brelse(tp, bp);
return XFS_ERROR(EFSCORRUPTED);
.B size
suboption is used to specify the size of the real-time section.
This suboption is only needed if the real-time section of the
-filesystem should occupy
-less space than the size of the partition or logical volume containing the section.
+filesystem should occupy less space than the size of the partition
+or logical volume containing the section.
.TP
.B \-s
Sector size options.
or in bytes with
.BR size= .
The default value is 512 bytes.
-.\" The minimum value for sector size is 512; the maximum is 32768 (32 KB).
-.\" The sector size cannot be made larger than the filesystem block size.
-This option is not yet implemented and sector size other than 512
-bytes cannot be set at this stage.
+The minimum value for sector size is 512; the maximum is 32768 (32 KB).
+The sector size must be a power of 2 size and cannot be made larger
+than the filesystem block size.
.TP
\f3\-L\f1 \f2label\f1
Set the filesystem label.
logversion = 2;
}
- /*
- * Support for non-512 byte sector sizes is a work-in-progress...
- */
-
-#ifndef EXPERIMENTAL_LARGE_SECTORS
- if (sectorsize != XFS_MIN_SECTORSIZE) {
- fprintf(stderr, _("unsupported sector size %d\n"), sectorsize);
- usage();
- }
- if (lsectorsize != XFS_MIN_SECTORSIZE) {
- fprintf(stderr, _("unsupported log sector size %d\n"), lsectorsize);
- usage();
- }
-#endif
-
if (!nvflag)
dirversion = (nsflag || nlflag) ? 2 : XFS_DFL_DIR_VERSION;
switch (dirversion) {
[dirblocklog - XFS_MIN_BLOCKSIZE_LOG];
ASSERT(i);
min_logblocks = MAX(XFS_MIN_LOG_BLOCKS, i * XFS_MIN_LOG_FACTOR);
+ if (!logsize && dblocks >= (1024*1024*1024) >> blocklog)
+ min_logblocks = MAX(min_logblocks, (10*1024*1024)>>blocklog);
if (logsize && xi.logBBsize > 0 && logblocks > DTOBT(xi.logBBsize)) {
fprintf(stderr,
_("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
else if (loginternal && !logsize) {
/*
* logblocks grows from min_logblocks to XFS_MAX_LOG_BLOCKS
- * at 1TB
+ * at 128GB
*
- * 8192 = 1TB / MAX_LOG_BYTES
+ * 2048 = 128GB / MAX_LOG_BYTES
*/
- logblocks = (dblocks << blocklog) / 8192;
+ logblocks = (dblocks << blocklog) / 2048;
logblocks = logblocks >> blocklog;
logblocks = MAX(min_logblocks, logblocks);
logblocks = MAX(logblocks,
/*
- * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
+ * Copyright (c) 2000-2003 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
* sector size info -
* sb_sectsize
* sb_sectlog
+ * sb_logsectsize
+ * sb_logsectlog
*
* not checked here -
* sb_rootino
bsize = 1;
- for (i = 0; bsize < sb->sb_blocksize && i < 32; i++) {
+ for (i = 0; bsize < sb->sb_blocksize &&
+ i < sizeof(sb->sb_blocksize) * NBBY; i++)
bsize <<= 1;
- }
- if (i < XR_LOG2BSIZE_MIN || i > XR_LOG2BSIZE_MAX)
+ if (i < XFS_MIN_BLOCKSIZE_LOG || i > XFS_MAX_BLOCKSIZE_LOG)
return(XR_BAD_BLOCKSIZE);
/* check sb blocksize field against sb blocklog field */
/* sanity check ag count, size fields against data size field */
if (sb->sb_dblocks == 0 ||
- sb->sb_dblocks > sb->sb_agcount * sb->sb_agblocks ||
- sb->sb_dblocks < (sb->sb_agcount - 1)
- * sb->sb_agblocks + XFS_MIN_AG_BLOCKS)
+ sb->sb_dblocks >
+ (__uint64_t)(sb->sb_agcount * sb->sb_agblocks) ||
+ sb->sb_dblocks <
+ (__uint64_t)((sb->sb_agcount - 1) * sb->sb_agblocks
+ + XFS_MIN_AG_BLOCKS))
return(XR_BAD_FS_SIZE_DATA);
if (sb->sb_agblklog != (__uint8_t)libxfs_log2_roundup(sb->sb_agblocks))
sb->sb_inopblock != howmany(sb->sb_blocksize,sb->sb_inodesize))
return(XR_BAD_INO_SIZE_DATA);
- /* check sector size against log(sector size) field */
+ /* check to make sure sectorsize is legal 2^N, 9 <= N <= 15 */
+
+ if (sb->sb_sectsize == 0)
+ return(XR_BAD_SECT_SIZE_DATA);
bsize = 1;
- for (i = 0; bsize < sb->sb_sectsize && i < 15; i++) {
+ for (i = 0; bsize < sb->sb_sectsize &&
+ i < sizeof(sb->sb_sectsize) * NBBY; i++) {
bsize <<= 1;
}
- if (sb->sb_sectsize == 0 || i == 16 ||
- sb->sb_sectsize != (1 << i))
+ if (i < XFS_MIN_SECTORSIZE_LOG || i > XFS_MAX_SECTORSIZE_LOG)
+ return(XR_BAD_SECT_SIZE_DATA);
+
+ /* check sb sectorsize field against sb sectlog field */
+
+ if (i != sb->sb_sectlog)
return(XR_BAD_SECT_SIZE_DATA);
+ if (XFS_SB_VERSION_HASSECTOR(sb)) {
+
+ /* check to make sure log sector is legal 2^N, 9 <= N <= 15 */
+
+ if (sb->sb_logsectsize == 0)
+ return(XR_BAD_SECT_SIZE_DATA);
+
+ bsize = 1;
+
+ for (i = 0; bsize < sb->sb_logsectsize &&
+ i < sizeof(sb->sb_logsectsize) * NBBY; i++) {
+ bsize <<= 1;
+ }
+
+ if (i < XFS_MIN_SECTORSIZE_LOG || i > XFS_MAX_SECTORSIZE_LOG)
+ return(XR_BAD_SECT_SIZE_DATA);
+
+ /* check sb log sectorsize field against sb log sectlog field */
+
+ if (i != sb->sb_logsectlog)
+ return(XR_BAD_SECT_SIZE_DATA);
+ }
+
/*
* real-time extent size is always set
*/