Merge of master-melb:xfs-cmds:22792a by kenmcd.
*
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
*/
-#ifndef __PATHS_H__
-#define __PATHS_H__
+#ifndef __PATH_H__
+#define __PATH_H__
#include <xfs/libxfs.h>
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__ */
#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);
*/
#include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
#include "init.h"
#include "io.h"
*/
#include <xfs/libxfs.h>
-#include "command.h"
+#include <xfs/command.h>
#include "init.h"
#include "io.h"
*/
#include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
#include "init.h"
#include "io.h"
*/
#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"
*/
#include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
#include "init.h"
#include "io.h"
*/
#include <xfs/libxfs.h>
-#include "command.h"
+#include <xfs/command.h>
#include "init.h"
#include "io.h"
*/
#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;
*/
#include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
#include "init.h"
#include "io.h"
*/
#include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
#include "init.h"
#include "io.h"
*/
#include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
#include "init.h"
#include "io.h"
*/
#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"
*/
#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"
*/
#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"
*/
#include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
#include "init.h"
#include "io.h"
*/
#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"
*/
#include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
#include "init.h"
#include "io.h"
*/
#include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
#include "init.h"
#include "io.h"
*/
#include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
#include "init.h"
#include "io.h"
*/
#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"
*/
#include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
#include "init.h"
#include "io.h"
*/
#include <xfs/libxfs.h>
-#include "command.h"
-#include "input.h"
+#include <xfs/command.h>
+#include <xfs/input.h>
#include "init.h"
#include "io.h"
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;
}
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:
int qcommand;
qcommand = xcommand_to_qcommand(command, type);
- return quotactl(qcommand, device, id, addr);
+ return quotactl(qcommand, (char *)device, id, addr);
}
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);
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) {
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) {
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) {
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) {
* 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];
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;
}
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;
}
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;
}