From 9d77aaddafd5aa180bca78a583f1474f90874ce0 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Tue, 3 Sep 2002 02:15:45 +0000 Subject: [PATCH] do some additional cleanup after autoconf has run. --- Makefile | 1 + VERSION | 4 ++-- bmap/xfs_bmap.c | 4 ++-- debian/changelog | 8 ++++++++ doc/CHANGES | 6 ++++++ growfs/xfs_growfs.c | 20 +++++++++++++++----- mkfs/xfs_mkfs.c | 2 +- rtcp/xfs_rtcp.c | 8 ++++---- 8 files changed, 39 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index b37c0b954..728a9032a 100644 --- a/Makefile +++ b/Makefile @@ -85,4 +85,5 @@ install-dev: default realclean distclean: clean rm -f $(LDIRT) $(CONFIGURE) + rm -rf autom4te.cache [ ! -d Logs ] || rmdir Logs diff --git a/VERSION b/VERSION index 1dff2c48a..5acbc3844 100644 --- a/VERSION +++ b/VERSION @@ -2,6 +2,6 @@ # This file is used by configure to get version information # PKG_MAJOR=2 -PKG_MINOR=2 -PKG_REVISION=3 +PKG_MINOR=3 +PKG_REVISION=0 PKG_BUILD=0 diff --git a/bmap/xfs_bmap.c b/bmap/xfs_bmap.c index f70c95e3c..aa3fe360b 100644 --- a/bmap/xfs_bmap.c +++ b/bmap/xfs_bmap.c @@ -129,7 +129,7 @@ dofile(char *fname) struct getbmapx *map; int map_size; int loop = 0; - xfs_fsop_geom_t fsgeo; + xfs_fsop_geom_v1_t fsgeo; fd = open(fname, O_RDONLY); if (fd < 0) { @@ -147,7 +147,7 @@ dofile(char *fname) } if (vflag) { - if (ioctl(fd, XFS_IOC_FSGEOMETRY, &fsgeo) < 0) { + if (ioctl(fd, XFS_IOC_FSGEOMETRY_V1, &fsgeo) < 0) { fprintf(stderr, "%s: can't get geometry [\"%s\"]: %s\n", progname, fname, strerror(errno)); close(fd); diff --git a/debian/changelog b/debian/changelog index 85cfca34c..702454e2b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +xfsprogs (2.3.0-1) unstable; urgency=low + + * New upstream release + * Improve backwards compatibility of tools using the XFS geometry + ioctl for older kernel versions which don't support the new ioctl + + -- Nathan Scott Tue, 3 Sep 2002 09:55:48 +1000 + xfsprogs (2.2.1-1) unstable; urgency=low * New upstream release diff --git a/doc/CHANGES b/doc/CHANGES index 8d0122b03..b3c68a3cc 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,3 +1,9 @@ +xfsprogs-2.3.0 (03 September 2002) + - Several changes to geometry ioctl callers which will make + the tools useable on older kernel versions too. + - Mainly affects xfs_bmap and xfs_growfs. + - Do some additional cleanup after autoconf has run. + xfsprogs-2.2.3 (28 August 2002) - Update libdisk for a few other filesystems. - Fix call to lvdisplay on LVM volumes so that lvdisplay diff --git a/growfs/xfs_growfs.c b/growfs/xfs_growfs.c index 1c3320aca..ab883cd51 100644 --- a/growfs/xfs_growfs.c +++ b/growfs/xfs_growfs.c @@ -270,10 +270,20 @@ main(int argc, char **argv) /* get the current filesystem size & geometry */ if (ioctl(ffd, XFS_IOC_FSGEOMETRY, &geo) < 0) { - fprintf(stderr, "%s: cannot determine geometry of filesystem" - " mounted at %s: %s\n", - progname, fname, strerror(errno)); - exit(1); + /* + * OK, new ioctl barfed - back off and try earlier version + * as we're probably running an older kernel version. + * Only field added in the v2 geometry ioctl is "logsunit" + * so we'll zero that out for later display (as zero). + */ + geo.logsunit = 1; /* 1 BB */ + if (ioctl(ffd, XFS_IOC_FSGEOMETRY_V1, &geo) < 0) { + fprintf(stderr, + "%s: cannot determine geometry of filesystem" + " mounted at %s: %s\n", + progname, fname, strerror(errno)); + exit(1); + } } isint = geo.logstart > 0; unwritten = geo.flags & XFS_FSOP_GEOM_FLAGS_EXTFLG ? 1 : 0; @@ -462,7 +472,7 @@ main(int argc, char **argv) } } - if (ioctl(ffd, XFS_IOC_FSGEOMETRY, &ngeo) < 0) { + if (ioctl(ffd, XFS_IOC_FSGEOMETRY_V1, &ngeo) < 0) { fprintf(stderr, "%s: ioctl failed - XFS_IOC_FSGEOMETRY: %s\n", progname, strerror(errno)); exit(1); diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 34106f680..d67e97862 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -1218,7 +1218,7 @@ main(int argc, char **argv) } /* if lsu or lsunit was specified, automatically use v2 logs */ - if (lsu || lsunit) { + if ((lsu || lsunit) && logversion == 1) { fprintf(stderr, "log stripe unit specified, using v2 logs\n"); logversion = 2; } diff --git a/rtcp/xfs_rtcp.c b/rtcp/xfs_rtcp.c index 3d28c587a..a59ffae16 100644 --- a/rtcp/xfs_rtcp.c +++ b/rtcp/xfs_rtcp.c @@ -388,7 +388,7 @@ int xfsrtextsize( char *path) { int fd, rval, rtextsize; - xfs_fsop_geom_t geo; + xfs_fsop_geom_v1_t geo; fd = open( path, O_RDONLY ); if ( fd < 0 ) { @@ -396,12 +396,12 @@ xfsrtextsize( char *path) perror(path); return -1; } - rval = ioctl(fd, XFS_IOC_FSGEOMETRY, &geo ); + rval = ioctl( fd, XFS_IOC_FSGEOMETRY_V1, &geo ); close(fd); + if ( rval < 0 ) + return -1; rtextsize = geo.rtextsize * geo.blocksize; - if ( rval < 0 ) - return -1; return rtextsize; } -- 2.47.2