From: Nathan Scott Date: Fri, 11 Nov 2005 14:28:31 +0000 (+0000) Subject: Fix up compiler warnings and other issues when building on IRIX. X-Git-Tag: v2.8.0~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a1888c5f9046ddca682e26614bc3045e7b03017;p=thirdparty%2Fxfsprogs-dev.git Fix up compiler warnings and other issues when building on IRIX. Merge of master-melb:xfs-cmds:24375a by kenmcd. --- diff --git a/include/input.h b/include/input.h index 20d2077f4..b2279835c 100644 --- a/include/input.h +++ b/include/input.h @@ -38,7 +38,7 @@ extern double tdiv(double value, struct timeval tv); enum { DEFAULT_TIME = 0x0, TERSE_FIXED_TIME = 0x1, - VERBOSE_FIXED_TIME = 0x2, + VERBOSE_FIXED_TIME = 0x2 }; extern void timestr(struct timeval *tv, char *str, size_t sz, int flags); diff --git a/include/irix.h b/include/irix.h index 0c80bec2e..ca9345713 100644 --- a/include/irix.h +++ b/include/irix.h @@ -129,6 +129,7 @@ typedef struct xfs_fsop_attrmulti_handlereq { #ifndef __GNUC__ #define __sgi__ __sgi #define __inline__ __inline +#define inline __inline #endif #define constpp char * const * diff --git a/include/path.h b/include/path.h index 576842da8..6bf7338f0 100644 --- a/include/path.h +++ b/include/path.h @@ -18,7 +18,7 @@ #ifndef __PATH_H__ #define __PATH_H__ -#include +#include /* * XFS Filesystem Paths diff --git a/io/attr.c b/io/attr.c index 83784aba1..c59b3d928 100644 --- a/io/attr.c +++ b/io/attr.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include "init.h" diff --git a/io/bmap.c b/io/bmap.c index 7fe840b6a..a364759cd 100644 --- a/io/bmap.c +++ b/io/bmap.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include "init.h" #include "io.h" diff --git a/io/fadvise.c b/io/fadvise.c index 61724b5ce..b5ab65227 100644 --- a/io/fadvise.c +++ b/io/fadvise.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include "init.h" diff --git a/io/file.c b/io/file.c index 958cebda3..55bf31ae4 100644 --- a/io/file.c +++ b/io/file.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include diff --git a/io/freeze.c b/io/freeze.c index 0c8b1331b..334b0cf7f 100644 --- a/io/freeze.c +++ b/io/freeze.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include "init.h" diff --git a/io/fsync.c b/io/fsync.c index 1f2394966..83fc0f437 100644 --- a/io/fsync.c +++ b/io/fsync.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include "init.h" #include "io.h" diff --git a/io/getrusage.c b/io/getrusage.c index 40599211e..ba35c5d55 100644 --- a/io/getrusage.c +++ b/io/getrusage.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include diff --git a/io/imap.c b/io/imap.c index 3c35722b3..73f37d00b 100644 --- a/io/imap.c +++ b/io/imap.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include "init.h" diff --git a/io/init.c b/io/init.c index a07f2fa1e..33361b933 100644 --- a/io/init.c +++ b/io/init.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include "init.h" diff --git a/io/inject.c b/io/inject.c index c9244398d..4be9d06a0 100644 --- a/io/inject.c +++ b/io/inject.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include "init.h" diff --git a/io/madvise.c b/io/madvise.c index 618794aff..694cd415c 100644 --- a/io/madvise.c +++ b/io/madvise.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include diff --git a/io/mincore.c b/io/mincore.c index f8028700b..f863f8480 100644 --- a/io/mincore.c +++ b/io/mincore.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include diff --git a/io/mmap.c b/io/mmap.c index 6af48d933..faace11c6 100644 --- a/io/mmap.c +++ b/io/mmap.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include diff --git a/io/open.c b/io/open.c index 08425ebd4..1361e6610 100644 --- a/io/open.c +++ b/io/open.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include "init.h" @@ -380,7 +380,7 @@ lsproj_callback( progname, path, strerror(errno)); } else { if (getprojid(path, fd, &projid) == 0) - printf("[%u] %s\n", projid, path); + printf("[%u] %s\n", (unsigned int)projid, path); close(fd); } return 0; @@ -418,7 +418,7 @@ lsproj_f( else if (getprojid(file->name, file->fd, &projid) < 0) perror("getprojid"); else - printf(_("projid = %u\n"), projid); + printf(_("projid = %u\n"), (unsigned int)projid); return 0; } diff --git a/io/pread.c b/io/pread.c index 8c4956051..8816b3657 100644 --- a/io/pread.c +++ b/io/pread.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include diff --git a/io/prealloc.c b/io/prealloc.c index e96c11286..6a2563e8b 100644 --- a/io/prealloc.c +++ b/io/prealloc.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include "init.h" diff --git a/io/pwrite.c b/io/pwrite.c index 5f6fa1302..90c362083 100644 --- a/io/pwrite.c +++ b/io/pwrite.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include "init.h" diff --git a/io/resblks.c b/io/resblks.c index 67847799d..face1755b 100644 --- a/io/resblks.c +++ b/io/resblks.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include "init.h" diff --git a/io/sendfile.c b/io/sendfile.c index 342eed36e..a36f8bb74 100644 --- a/io/sendfile.c +++ b/io/sendfile.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include diff --git a/io/shutdown.c b/io/shutdown.c index 700223549..cf306fb88 100644 --- a/io/shutdown.c +++ b/io/shutdown.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include "init.h" diff --git a/io/truncate.c b/io/truncate.c index d40001e12..e7638da3f 100644 --- a/io/truncate.c +++ b/io/truncate.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include "init.h" diff --git a/libhandle/handle.c b/libhandle/handle.c index 935dcb653..dbd40f182 100644 --- a/libhandle/handle.c +++ b/libhandle/handle.c @@ -16,11 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include - -/* attributes.h (purposefully) unavailable to xfsprogs, make do */ -struct attrlist_cursor { __u32 opaque[4]; }; - +#include #include /* just pick a value we know is more than big enough */ diff --git a/libhandle/jdm.c b/libhandle/jdm.c index e3ca789f7..ae94ed3d7 100644 --- a/libhandle/jdm.c +++ b/libhandle/jdm.c @@ -16,11 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include - -/* attributes.h (purposefully) unavailable to xfsprogs, make do */ -struct attrlist_cursor { __u32 opaque[4]; }; - +#include #include #include diff --git a/libxcmd/command.c b/libxcmd/command.c index 21b5c4333..dfde33b9e 100644 --- a/libxcmd/command.c +++ b/libxcmd/command.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include diff --git a/libxcmd/help.c b/libxcmd/help.c index 4e0c00563..c7a71b784 100644 --- a/libxcmd/help.c +++ b/libxcmd/help.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include static cmdinfo_t help_cmd; diff --git a/libxcmd/input.c b/libxcmd/input.c index cc782bcb2..5814e2212 100644 --- a/libxcmd/input.c +++ b/libxcmd/input.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #if defined(ENABLE_READLINE) @@ -26,6 +26,8 @@ # include #endif +extern char *progname; + static char * get_prompt(void) { @@ -329,7 +331,7 @@ prid_from_string( prid_t prid; char *sp; - prid = strtoul(project, &sp, 10); + prid = (prid_t)strtoul(project, &sp, 10); if (sp != project) return prid; prj = getprnam(project); @@ -346,7 +348,7 @@ uid_from_string( uid_t uid; char *sp; - uid = strtoul(user, &sp, 10); + uid = (uid_t)strtoul(user, &sp, 10); if (sp != user) return uid; pwd = getpwnam(user); @@ -363,7 +365,7 @@ gid_from_string( gid_t gid; char *sp; - gid = strtoul(group, &sp, 10); + gid = (gid_t)strtoul(group, &sp, 10); if (sp != group) return gid; grp = getgrnam(group); diff --git a/libxcmd/paths.c b/libxcmd/paths.c index b37a2ac91..1a0a21771 100644 --- a/libxcmd/paths.c +++ b/libxcmd/paths.c @@ -28,6 +28,8 @@ #include #include +extern char *progname; + int fs_count; struct fs_path *fs_table; struct fs_path *fs_path; @@ -136,9 +138,7 @@ fs_extract_mount_options( char **logp, char **rtp) { - char *fslog, *fsrt, *fslogend, *fsrtend; - - fslog = fsrt = fslogend = fsrtend = NULL; + char *fslog, *fsrt; /* Extract log device and realtime device from mount options */ if ((fslog = hasmntopt(mnt, "logdev="))) @@ -148,11 +148,11 @@ fs_extract_mount_options( /* Do this only after we've finished processing mount options */ if (fslog) { - fslogend = strtok(fslog, " ,"); + strtok(fslog, " ,"); fslog = strdup(fslog); } if (fsrt) { - fsrtend = strtok(fsrt, " ,"); + strtok(fsrt, " ,"); fsrt = strdup(fsrt); } diff --git a/libxcmd/projects.c b/libxcmd/projects.c index f593cd89b..9ea4a7fc0 100644 --- a/libxcmd/projects.c +++ b/libxcmd/projects.c @@ -81,7 +81,7 @@ getprent(void) if (!projects) return NULL; - do { + for (;;) { if (!fgets(projects_buffer, size, projects)) break; /* @@ -101,7 +101,7 @@ getprent(void) p.pr_prid = atoi(idstart+1); p.pr_name = &projects_buffer[0]; return &p; - } while (1); + } return NULL; } @@ -142,7 +142,7 @@ getprpathent(void) if (!project_paths) return NULL; - do { + for (;;) { if (!fgets(project_paths_buffer, size, project_paths)) break; /* @@ -162,7 +162,7 @@ getprpathent(void) pp.pp_pathname = nmstart + 1; pp.pp_prid = atoi(&project_paths_buffer[0]); return &pp; - } while (1); + } return NULL; } diff --git a/libxcmd/quit.c b/libxcmd/quit.c index 590e74172..89498455a 100644 --- a/libxcmd/quit.c +++ b/libxcmd/quit.c @@ -16,11 +16,12 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include static cmdinfo_t quit_cmd; +/* ARGSUSED */ static int quit_f( int argc, diff --git a/man/man8/xfs_io.8 b/man/man8/xfs_io.8 index c7a95a639..673c65bcb 100644 --- a/man/man8/xfs_io.8 +++ b/man/man8/xfs_io.8 @@ -6,7 +6,7 @@ xfs_io \- debug the I/O path of an XFS filesystem \f3xfs_io\f1 [ \f3\-c\f1 cmd ] ... [ \f3\-p\f1 prog ] [ \f3\-adFfmrRstx\f1 ] file .fi .SH DESCRIPTION -\f2xfs_io\f1 is a debugging tool like \f2xfs_db\f1(8), but is aimed +\f2xfs_io\f1 is a debugging tool like \f2xfs_db\f1, but is aimed at examining the regular file I/O path rather than the raw XFS volume itself. .PP @@ -135,15 +135,15 @@ See the \f3pwrite\f1 command. .TP \f3bmap\f1 [ \f2\-adlpv\f1 ] [ \f2\-n nx\f1 ] Prints the block mapping for the current open file. -Refer to \f2xfs_bmap\f1(8) for complete documentation. +Refer to the \f2xfs_bmap\f1 manual page for complete documentation. .TP \f3allocsp\f1 \f2offset\f1 \f2length\f1 Allocates zeroed space for part of a file using the XFS_IOC_ALLOCSP -system call described in \f2xfs\f1(5). +system call described in the \f2xfs\f1 manual page. .TP \f3freesp\f1 \f2offset\f1 \f2length\f1 Frees space for part of a file using the XFS_IOC_FREESP -system call described in \f2xfs\f1(5). +system call described in the \f2xfs\f1 manual page. .TP \f3fadvise\f1 [ \f2\-dnrsw\f1 ] On platforms which support it, allows hints be given to the system @@ -162,11 +162,11 @@ See the \f3fsync\f1 command. .TP \f3resvsp\f1 \f2offset\f1 \f2length\f1 Allocates reserved, unwritten space for part of a file using the XFS_IOC_RESVSP -system call described in \f2xfs\f1(5). +system call described in the \f2xfs\f1 manual page. .TP \f3unresvsp\f1 \f2offset\f1 \f2length\f1 Frees reserved space for part of a file using the XFS_IOC_UNRESVSP -system call described in \f2xfs\f1(5). +system call described in the \f2xfs\f1 manual page. .TP \f3truncate\f1 \f2offset\f1 Truncates the current file at the given offset using \f2ftruncate\f1(2). @@ -292,8 +292,7 @@ Only available in expert mode and requires privileges. .TP \f3resblks\f1 [ \f2blocks\f1 ] Get and/or set count of reserved filesystem blocks using the -XFS_IOC_GET_RESBLKS or XFS_IOC_SET_RESBLKS system calls, -as described in \f2xfs\f1(5). +XFS_IOC_GET_RESBLKS or XFS_IOC_SET_RESBLKS system calls. Note \-\- this can be useful for exercising out of space behavior. Only available in expert mode and requires privileges. .TP @@ -303,14 +302,27 @@ Only available in expert mode and requires privileges. .TP \f3stat\f1 [ \f2\-v\f1 ] Selected statistics from \f2stat\f1(2) and the XFS_IOC_GETXATTR -system call from \f2xfs\f1(5) on the current file. +system call on the current file. If the \f2-v\f1 option is specified, the atime (last access), mtime (last modify), and ctime (last change) timestamps are also displayed. .TP \f3statfs\f1 Selected statistics from \f2statfs\f1(2) and the XFS_IOC_FSGEOMETRY -system call from \f2xfs\f1(5) on the filesystem where the current -file resides. +system call on the filesystem where the current file resides. + +.SH IRIX SEE ALSO +mkfs_xfs(1M), +syssgi(2), +xfs_bmap(1M), +xfs_db(1M), +xfs(4). + +.SH LINUX SEE ALSO +mkfs.xfs(8), +xfsctl(3), +xfs_bmap(8), +xfs_db(8), +xfs(5). .SH SEE ALSO fdatasync(2), @@ -318,11 +330,7 @@ fstat(2), fstatfs(2), fsync(2), ftruncate(2), -mkfs.xfs(8), mmap(2), open(2), pread(2), -pwrite(2), -xfs_bmap(8), -xfs_db(8), -xfs(5). +pwrite(2). diff --git a/man/man8/xfs_quota.8 b/man/man8/xfs_quota.8 index d596507ba..34212069c 100644 --- a/man/man8/xfs_quota.8 +++ b/man/man8/xfs_quota.8 @@ -165,8 +165,9 @@ guarantee of consistency. As such, it is administered differently, in particular: .TP 1. -.BR quotacheck (8) -has no effect on XFS filesystems. +The +.B quotacheck +command has no effect on XFS filesystems. The first time quota accounting is turned on (at mount time), XFS does an automatic quotacheck internally; afterwards, the quota system will always be completely consistent until quotas are manually turned off. @@ -181,7 +182,7 @@ filesystem. However, it is possible to turn on/off limit enforcement any time quota accounting is turned on. The "quota" option to the -.BR mount (8) +.B mount command turns on both (user) quota accounting and enforcement. The "uqnoenforce" option must be used to turn on user accounting with limit enforcement disabled. @@ -190,7 +191,7 @@ limit enforcement disabled. Turning on quotas on the root filesystem is slightly different from the above. For IRIX XFS, refer to -.BR quotaon (1) +.BR quotaon (1M). For Linux XFS, the quota mount flags must be passed in with the "rootflags=" boot parameter. .TP @@ -201,7 +202,7 @@ and also to monitor the space occupied by the quota system itself.. .TP 6. There is a mechanism built into -.BR xfsdump (8) +.B xfsdump that allows quota limit information to be backed up for later restoration, should the need arise. .TP @@ -452,8 +453,15 @@ Mapping of numeric project identifiers to directories trees. .BR /etc/projid Mapping of numeric project identifiers to project names. .PD +.SH IRIX SEE ALSO +quotaon(1M), +xfs(4). + +.SH LINUX SEE ALSO +warnquota(8), +xfs(5). + .SH SEE ALSO df(1), mount(1), sync(2), -xfs(5). diff --git a/quota/project.c b/quota/project.c index 714ec7d8d..6eae4dff2 100644 --- a/quota/project.c +++ b/quota/project.c @@ -93,7 +93,7 @@ check_project( if (fsx.fsx_projid != prid) printf(_("%s - project identifier is not set" " (inode=%u, tree=%u)\n"), - path, fsx.fsx_projid, prid); + path, fsx.fsx_projid, (unsigned int)prid); if (!(fsx.fsx_xflags & XFS_XFLAG_PROJINHERIT)) printf(_("%s - project inheritance flag is not set\n"), path); diff --git a/quota/quota.c b/quota/quota.c index 469c51fe9..e0c7a75a0 100644 --- a/quota/quota.c +++ b/quota/quota.c @@ -314,7 +314,7 @@ getprojectname( if ((p = getprprid(prid))) return p->pr_name; - snprintf(buffer, sizeof(buffer), "#%u", prid); + snprintf(buffer, sizeof(buffer), "#%u", (unsigned int)prid); return &buffer[0]; } diff --git a/quota/report.c b/quota/report.c index 7adde82be..0d6d8d0b3 100644 --- a/quota/report.c +++ b/quota/report.c @@ -478,7 +478,8 @@ report_project_mount( setprent(); while ((p = getprent()) != NULL) { if (flags & NO_LOOKUP_FLAG) - snprintf(n, sizeof(n)-1, "#%u", p->pr_prid); + snprintf(n, sizeof(n)-1, "#%u", + (unsigned int)p->pr_prid); else strncpy(n, p->pr_name, sizeof(n)-1); if (report_mount(fp, p->pr_prid, n, diff --git a/quota/util.c b/quota/util.c index acea6ead9..6499c3ef7 100644 --- a/quota/util.c +++ b/quota/util.c @@ -20,6 +20,7 @@ #include #include #include +#include "init.h" #include "quota.h" #define SECONDS_IN_A_DAY (24 * 60 * 60)