]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Portability changes to get xfs_quota to compile on IRIX as well.
authorNathan Scott <nathans@sgi.com>
Fri, 3 Jun 2005 06:07:09 +0000 (06:07 +0000)
committerNathan Scott <nathans@sgi.com>
Fri, 3 Jun 2005 06:07:09 +0000 (06:07 +0000)
Merge of master-melb:xfs-cmds:22792a by kenmcd.

28 files changed:
include/path.h
include/project.h
io/attr.c
io/bmap.c
io/fadvise.c
io/file.c
io/freeze.c
io/fsync.c
io/getrusage.c
io/imap.c
io/init.c
io/inject.c
io/madvise.c
io/mincore.c
io/mmap.c
io/open.c
io/pread.c
io/prealloc.c
io/pwrite.c
io/resblks.c
io/sendfile.c
io/shutdown.c
io/truncate.c
quota/free.c
quota/irix.c
quota/path.c
quota/state.c
quota/util.c

index e2f8e41b27b7446cb342f2f4e203275dee1d0e9b..e3bf0214310f8559b6a9bdd707df96623782546b 100644 (file)
@@ -29,8 +29,8 @@
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-#ifndef __PATHS_H__
-#define __PATHS_H__
+#ifndef __PATH_H__
+#define __PATH_H__
 
 #include <xfs/libxfs.h>
 
@@ -80,4 +80,4 @@ typedef struct fs_cursor {
 extern void fs_cursor_initialise(char *__dir, uint __flags, fs_cursor_t *__cp);
 extern fs_path_t *fs_cursor_next_entry(fs_cursor_t *__cp);
 
-#endif /* __PATHS_H__ */
+#endif /* __PATH_H__ */
index b605211bf198af49cbd71b00ef3cea5a2b4984b4..defe70c2c77109fa87c614f46990d31892abbe5b 100644 (file)
 
 #include <xfs/xfs.h>
 
+#if !defined(__sgi__)
 typedef __uint32_t     prid_t;
+#endif
+
 extern int setprojid(const char *__name, int __fd, prid_t __id);
 extern int getprojid(const char *__name, int __fd, prid_t *__id);
 
index fae6d73d83ebe450274735547bf198272a83433e..8854256e6804dad7106970b8770c28b85d42f5c4 100644 (file)
--- a/io/attr.c
+++ b/io/attr.c
@@ -31,8 +31,8 @@
  */
 
 #include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
 #include "init.h"
 #include "io.h"
 
index 75fc32e9d7d9774275e348e2c8ad77c6d95a784d..7e5edb74245494bb990d549bf7f4d7fda06e9d30 100644 (file)
--- a/io/bmap.c
+++ b/io/bmap.c
@@ -31,7 +31,7 @@
  */
 
 #include <xfs/libxfs.h>
-#include "command.h"
+#include <xfs/command.h>
 #include "init.h"
 #include "io.h"
 
index 29dede4b8317f206394c4b15906da7701acf307a..429f4f57a202866b8c0a9a78ecf56ac5954f3d76 100644 (file)
@@ -31,8 +31,8 @@
  */
 
 #include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
 #include "init.h"
 #include "io.h"
 
index a82736260401f65c8f0c88c0fdfb5182cac1ea94..bb23109a2ac972eae14b9ecd9ab591b925f8cf44 100644 (file)
--- a/io/file.c
+++ b/io/file.c
@@ -31,9 +31,9 @@
  */
 
 #include <xfs/libxfs.h>
+#include <xfs/command.h>
+#include <xfs/input.h>
 #include <sys/mman.h>
-#include "command.h"
-#include "input.h"
 #include "init.h"
 #include "io.h"
 
index 03f3004386dafa24503b32cf32cb9a2858486f17..f45726844cb8fba1330aa392bbadc2189e7a989b 100644 (file)
@@ -31,8 +31,8 @@
  */
 
 #include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
 #include "init.h"
 #include "io.h"
 
index ab77bdd7915a695561f562a22324f3744411e918..928afb7eff1733e50eb6205dfcd7a81d8b9e629a 100644 (file)
@@ -31,7 +31,7 @@
  */
 
 #include <xfs/libxfs.h>
-#include "command.h"
+#include <xfs/command.h>
 #include "init.h"
 #include "io.h"
 
index 2b321fe7bb08f9605eeb429b843a9480a2e16b04..ea922e231f5919a7561a48a888a70aeed5191896 100644 (file)
  */
 
 #include <xfs/libxfs.h>
+#include <xfs/command.h>
+#include <xfs/input.h>
 #include <sys/time.h>
 #include <sys/resource.h>
-#include "command.h"
-#include "input.h"
 #include "init.h"
 
 static cmdinfo_t getrusage_cmd;
index 839b0ce0ae8dab7f3203d9b64a574228d47285a0..7ec04934167fadc4ffd0b974a1caabc42a52a41b 100644 (file)
--- a/io/imap.c
+++ b/io/imap.c
@@ -31,8 +31,8 @@
  */
 
 #include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
 #include "init.h"
 #include "io.h"
 
index 60fb024bde4a3575cb62f5f3d444ad1dc222131d..0f92b3da6709cc9029445b76424a2a41823204b9 100644 (file)
--- a/io/init.c
+++ b/io/init.c
@@ -31,8 +31,8 @@
  */
 
 #include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
 #include "init.h"
 #include "io.h"
 
index c065152283b4833931ee29d43d37d9594b72fff7..cb01f3725c62850994931ec43ab20bef5b67889c 100644 (file)
@@ -31,8 +31,8 @@
  */
 
 #include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
 #include "init.h"
 #include "io.h"
 
index d611fb107d440785327ebf7e9fe1ce5ab78edea1..f5226781022ef3aa7e9ca6acd23cbfcabd1b28d5 100644 (file)
@@ -31,9 +31,9 @@
  */
 
 #include <xfs/libxfs.h>
+#include <xfs/command.h>
+#include <xfs/input.h>
 #include <sys/mman.h>
-#include "command.h"
-#include "input.h"
 #include "init.h"
 #include "io.h"
 
index e182b954e9b44ef2339a2fde97a42f1bbcac837c..24ffea64b6fc7d63af108173e0494fc80f7898a3 100644 (file)
@@ -31,9 +31,9 @@
  */
 
 #include <xfs/libxfs.h>
+#include <xfs/command.h>
+#include <xfs/input.h>
 #include <sys/mman.h>
-#include "command.h"
-#include "input.h"
 #include "init.h"
 #include "io.h"
 
index cb7531d911c31cde70ec812cdd5c80abd4f4ea98..fd71bc73eddff33d4a54e0aece5dc73aa42e93e5 100644 (file)
--- a/io/mmap.c
+++ b/io/mmap.c
  */
 
 #include <xfs/libxfs.h>
+#include <xfs/command.h>
+#include <xfs/input.h>
 #include <sys/mman.h>
 #include <signal.h>
-#include "command.h"
-#include "input.h"
 #include "init.h"
 #include "io.h"
 
index 6a4bc3ec9e11bee935dde89db4a8e02424d4b74c..9c837912c8164111911a73e0ce00d581251be3f0 100644 (file)
--- a/io/open.c
+++ b/io/open.c
@@ -31,8 +31,8 @@
  */
 
 #include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
 #include "init.h"
 #include "io.h"
 
index 3d5a014668200bff280c13ffd05a6757b4d58f38..2ed1b9316a1abe7467019e91988d6eb83d49e7cc 100644 (file)
@@ -31,9 +31,9 @@
  */
 
 #include <xfs/libxfs.h>
+#include <xfs/command.h>
+#include <xfs/input.h>
 #include <ctype.h>
-#include "command.h"
-#include "input.h"
 #include "init.h"
 #include "io.h"
 
index ae12f50453fef024f697cce33d42e959556e7e4f..4c8dc889bdbd9a3accd23fa135b73441afe5ff41 100644 (file)
@@ -31,8 +31,8 @@
  */
 
 #include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
 #include "init.h"
 #include "io.h"
 
index 3ff05e846d2295e824666a0d299d8bafaf6cb0ea..b3956f2a718d3ab1e165a61b5c42cca17c831b47 100644 (file)
@@ -31,8 +31,8 @@
  */
 
 #include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
 #include "init.h"
 #include "io.h"
 
index 5d92ba31eb10301862b462a02f8424c7ffe0379b..a4719db0f8f9dba801f139cd2144d4cd4916e5e9 100644 (file)
@@ -31,8 +31,8 @@
  */
 
 #include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
 #include "init.h"
 #include "io.h"
 
index 5607e8f088f97afaaee75a966c1bc144d1946c6f..3a5fbdceefd532184548b1ceb13ccddc3df9d667 100644 (file)
@@ -31,9 +31,9 @@
  */
 
 #include <xfs/libxfs.h>
+#include <xfs/command.h>
+#include <xfs/input.h>
 #include <sys/sendfile.h>
-#include "command.h"
-#include "input.h"
 #include "init.h"
 #include "io.h"
 
index c9294f339db98d1092009a8206349497c3224199..c75677a0a328cd1c49266099cb37bacff777edd6 100644 (file)
@@ -31,8 +31,8 @@
  */
 
 #include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
 #include "init.h"
 #include "io.h"
 
index 1d9d6a41ae47e6f14445a79bd2d803cdfceabdf6..ce525dbe2b5730ca764bbbc2a1b3fed7b6b3424b 100644 (file)
@@ -31,8 +31,8 @@
  */
 
 #include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
 #include "init.h"
 #include "io.h"
 
index df42954bc056bef1b3e3c8cbf16c7dd93cb41934..63b1fb4b16e2ff8245f3701d82510bf575f468a2 100644 (file)
@@ -155,8 +155,7 @@ projects_free_space_data(
                return 0;
        }
 
-       if ((xfsctl(path->fs_dir, fd, XFS_IOC_GETPROJID, &projid)) < 0) {
-               perror("XFS_IOC_GETPROJID");
+       if ((getprojid(path->fs_dir, fd, &projid)) < 0) {
                close(fd);
                return 0;
        }
index e568f30006ad46f1f96fe4f133fc93621d99e8e4..f6d7cfc0fc09ab5aa849fa4cea85a132027cecbf 100644 (file)
@@ -44,15 +44,15 @@ xcommand_to_qcommand(
        case XFS_QUOTAOFF:
                return Q_XQUOTAOFF;
        case XFS_GETQUOTA:
-               if (type == XFS_GRPQUOTA)
+               if (type == XFS_GROUP_QUOTA)
                        return Q_XGETGQUOTA;
-               if (type == XFS_PRJQUOTA)
+               if (type == XFS_PROJ_QUOTA)
                        return Q_XGETPQUOTA;
                return Q_XGETQUOTA;
        case XFS_SETQLIM:
-               if (type == XFS_GRPQUOTA)
+               if (type == XFS_GROUP_QUOTA)
                        return Q_XSETGQLIM;
-               if (type == XFS_PRJQUOTA)
+               if (type == XFS_PROJ_QUOTA)
                        return Q_XSETPQLIM;
                return Q_XSETQLIM;
        case XFS_GETQSTAT:
@@ -74,5 +74,5 @@ xfsquotactl(
        int             qcommand;
 
        qcommand = xcommand_to_qcommand(command, type);
-       return quotactl(qcommand, device, id, addr);
+       return quotactl(qcommand, (char *)device, id, addr);
 }
index 7b985fb0e3364881d194803c98d2d4e42dcdef66..939e0c391427699a08bb789f40d88e431185ecdc 100644 (file)
@@ -111,11 +111,12 @@ path_f(
        int             argc,
        char            **argv)
 {
+       int     i;
+
        if (argc <= 1)
                return pathlist_f();
 
-       int     i = atoi(argv[1]);
-
+       i = atoi(argv[1]);
        if (i < 0 || i >= fs_count) {
                printf(_("value %d is out of range (0-%d)\n"),
                        i, fs_count-1);
index 32a0533ff857e5bd3e17bb7aa77239d41e4e9ff0..4fb1467d0357c5278851f7f2fbe26142e1e1e394 100644 (file)
@@ -262,8 +262,10 @@ enable_enforcement(
        uint            flags)
 {
        fs_path_t       *mount;
-       fs_quota_stat_t qstat =
-               { .qs_version = FS_QSTAT_VERSION, .qs_flags = qflags };
+       fs_quota_stat_t qstat = { 0 };
+
+       qstat.qs_version = FS_QSTAT_VERSION;
+       qstat.qs_flags = qflags;
 
        mount = fs_table_lookup(dir, FS_MOUNT_POINT);
        if (!mount) {
@@ -285,8 +287,10 @@ disable_enforcement(
        uint            flags)
 {
        fs_path_t       *mount;
-       fs_quota_stat_t qstat =
-               { .qs_version = FS_QSTAT_VERSION, .qs_flags = qflags };
+       fs_quota_stat_t qstat = { 0 };
+
+       qstat.qs_version = FS_QSTAT_VERSION;
+       qstat.qs_flags = qflags;
 
        mount = fs_table_lookup(dir, FS_MOUNT_POINT);
        if (!mount) {
@@ -308,8 +312,10 @@ quotaoff(
        uint            flags)
 {
        fs_path_t       *mount;
-       fs_quota_stat_t qstat =
-               { .qs_version = FS_QSTAT_VERSION, .qs_flags = qflags };
+       fs_quota_stat_t qstat = { 0 };
+
+       qstat.qs_version = FS_QSTAT_VERSION;
+       qstat.qs_flags = qflags;
 
        mount = fs_table_lookup(dir, FS_MOUNT_POINT);
        if (!mount) {
@@ -331,8 +337,10 @@ remove_extents(
        uint            flags)
 {
        fs_path_t       *mount;
-       fs_quota_stat_t qstat =
-               { .qs_version = FS_QSTAT_VERSION, .qs_flags = qflags };
+       fs_quota_stat_t qstat = { 0 };
+
+       qstat.qs_version = FS_QSTAT_VERSION;
+       qstat.qs_flags = qflags;
 
        mount = fs_table_lookup(dir, FS_MOUNT_POINT);
        if (!mount) {
index 7b9c1f9e2f62737e1664b0db9456aaf36f8383d6..3113b17886390bf8b6ec2c090f3b77ceccc7ba6d 100644 (file)
@@ -231,12 +231,18 @@ type_to_string(
  * Identifier caches - user/group/project names/IDs
  */
 
+#ifndef UT_NAMESIZE
+struct utmp utmp;
+#define NMAX           (sizeof(utmp.ut_name))
+#else
+#define NMAX           UT_NAMESIZE
+#endif
 #define NID            4096
 #define IDMASK         (NID-1)
 
 typedef struct {
        __uint32_t      id;
-       char            name[UT_NAMESIZE + 1];
+       char            name[NMAX+1];
 } idcache_t;
 
 static idcache_t       uidnc[NID];
@@ -258,7 +264,7 @@ getnextpwent(
        if ((pw = byid? getpwuid(id) : getpwent()) == NULL)
                return NULL;
        idc.id = pw->pw_uid;
-       strncpy(idc.name, pw->pw_name, UT_NAMESIZE);
+       strncpy(idc.name, pw->pw_name, NMAX);
        return &idc;
 }
 
@@ -273,7 +279,7 @@ getnextgrent(
        if ((gr = byid? getgrgid(id) : getgrent()) == NULL)
                return NULL;
        idc.id = gr->gr_gid;
-       strncpy(idc.name, gr->gr_name, UT_NAMESIZE);
+       strncpy(idc.name, gr->gr_name, NMAX);
        return &idc;
 }
 
@@ -288,7 +294,7 @@ getnextprent(
        if ((pr = byid? getprprid(id) : getprent()) == NULL)
                return NULL;
        idc.id = pr->pr_prid;
-       strncpy(idc.name, pr->pr_name, UT_NAMESIZE);
+       strncpy(idc.name, pr->pr_name, NMAX);
        return &idc;
 }