DUSTAT(2,L) AIX Technical Reference DUSTAT(2,L)
-------------------------------------------------------------------------------
dustat
PURPOSE
Gets file system statistics.
SYNTAX
#include <sys/types.h>
#include <dustat.h>
int dustat (gfs, packno, buffer, length)
gfs_t gfs;
pckno_t packno;
struct dustat *buffer;
int length;
DESCRIPTION
The dustat system call returns information about a mounted file system. The
gfs argument is a global file system number identifying a device containing a
mounted file system. If the file system is not replicated, the packno argument
is ignored; otherwise, it specifies the particular pack for which information
is desired. The buffer is a pointer to a dustat structure, length bytes long,
with the following format:
fstore_t du_fstore; /* copy's fstore flags */
commitcnt_t du_hwm; /* high-water mark for commits */
commitcnt_t du_lwm; /* low-water mark for commits */
daddr_t du_fsize; /* size of entire volume */
union du_mix {
daddr_t dum_tfree; /* number of free blocks */
dev_t dum_majmin /* major-minor #'s of the device */
} DU_mix;
ino_t du_tinode; /* # of free inodes */
short du_bsize; /* size of blocks */
pckno_t du_pckno; /* pack # of this copy of */
/* a replicated gfs */
ino_t du_isize; /* address of first data block. */
siteno_t du_site; /* site where this copy */
/* is mounted. */
unsigned short du_flags; /* from s_flags */
Processed November 7, 1990 DUSTAT(2,L) 1
DUSTAT(2,L) AIX Technical Reference DUSTAT(2,L)
char du_inopb; /* inodes per block */
char du_version; /* data format of fs */
char du_packcnt; /* number of valid entries in */
/* du_dpacklst */
char du_dummy[5]; /* for future use */
char du_fsmnt[32]; /* name of this file system */
char du_fpack[8]; /* name of this physical vol */
struct dpacklst du_dpacklst[MAXPACKNO];
/* array of packlists, info on other */
/* mounted copies of this gfs */
The following defines are automatically made for easy access:
#define du_majmin DU_mix.dum_majmin
#define du_tfree DU_mix.dum_tfree
and the dpacklst structure consists of:
fstore_t dpk_fstore;
siteno_t dpk_site;
unsigned short dpk_flags;
pckno_t dpk_pack;
short dpk_dummy; /* future expansion */
The dustat system call interprets a pack number (packno argument) of 0 as the
CSS's pack and a pack number of -1 as the local site's pack. In the latter
case, the major-minor field (du_majmin) of the dustat structure is filled in;
otherwise, the free block field (du_tfree) is filled in.
The dustat system call does not report the actual number of inodes allocated
when run on nonprimary packs of replicated file systems. Only the primary copy
will show the correct number of inodes allocated.
RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1
is returned, and errno is set to indicate the error.
ERROR CONDITIONS
The dustat system call fails if one or more of the following are true:
ENOSTORE gfs specifies a replicated file system, and packno is -1, but there
is no local copy of the file system.
EINVAL gfs is not in the range of valid file system numbers.
EINVAL The device is not mounted, or the specified pack is not available.
Processed November 7, 1990 DUSTAT(2,L) 2
DUSTAT(2,L) AIX Technical Reference DUSTAT(2,L)
EFAULT buffer points outside the process's allocated address space.
EFAULT The length parameter to dustat is not the same as size of (struct
dustat).
EINTR The call is interrupted by a signal.
ESITEDN1 The site which had this pack mounted has left the current partition.
ESITEDN2 The operation was terminated because a site failed.
RELATED INFORMATION
In this book: "ustat" and "fs."
Processed November 7, 1990 DUSTAT(2,L) 3