List File System Status
Purpose
Lists status information of a file system. As input, use an FS_ID or an FS_ID2, which specifies the z/OS® UNIX file system name (the mount name). For an FS_ID2, the file system must be mounted using that z/OS UNIX file system name. The aggregate that contains the file system must be attached and the aggregate cannot be quiesced.
IBM recommends that you should use the List Detailed File System Information API instead of List Aggregate Status or List File System Status.
Format
syscall_parmlist
opcode int 142 FSOP_GETSTAT_PARMDATA
parms[0] int Offset to FS_ID
parms[1] int Offset to FS_STATUS
parms[2] int 0
parms[3] int 0
parms[4] int 0
parms[5] int 0
parms[6] int 0
FS_ID or FS_ID2
fsid_eye char[4] "FSID"
fsid_len char sizeof(FS_ID)
fsid_ver char 1
fsid_res1 char Reserved
fsid_res2 char Reserved
fsid_id
high unsigned int High portion of generated ID
low unsigned int Low portion of generated ID
fsid_aggrname char[45] Aggregate name
fsid_name char[45] File system name
fsid_reserved char[32] Reserved
fsid_reserved2 char[2] Reserved
FS_ID2 or FS_ID
fsid_eye char[4] "FSID"
fsid_len char sizeof(FS_ID2)
fsid_ver char 2
fsid_res1 char Reserved
fsid_res2 char Reserved
fsid_id
high unsigned int High portion of generated ID
low unsigned int Low portion of generated ID
fsid_aggrname char[45] Aggregate name
fsid_name char[45] File system name
fsid_mtname char[45] Name used when mounted
fsid_reserved char[49] Reserved
FS_STATUS
fs_eye char[4] "FSST"
fs_len short sizeof(FS_STATUS)
fs_ver char 1
fs_res1 char Reserved
fs_id
high unsigned int High portion of generated ID
low unsigned int Low portion of generated ID
fsid_aggrname char[45] Aggregate name
fsid_name char[45] File system name
fsid_mtname char[45] Name used when mounted
fsid_reserved char[49] Reserved
fs_cloneTime timeval Time file system cloned
fs_createTime timeval Time file system created
fs_updateTime timeval Time of last update
fs_accessTime timeval Time of last access
fs_allocLimit unsigned int Number of blocks available
fs_allocUsage unsigned int Number of blocks in use
fs_visQuotaLimit unsigned int Quota for file system
fs_visQuotaUsage unsigned int Blocks used in file system
fs_accError unsigned int Error for invalid operation
fs_accStatus int Operations being performed
fs_states int File system state
fs_nodeMax int Maximum inode number
fs_minQuota int Minimum inode number
fs_type int Type of file system
fs_threshold char FSFULL threshold monitoring
fs_increment char FSFULL monitoring increment
fs_mountstate char Mount status
0 - Not mounted
1 - Mounted R/W
2 - Mounted readonly
fs_msglen char Length of status message
fs_msg char[128] Status message
fs_aggrname char[45] Aggregate name
fs_reserved1 char[3] Reserved
fs_reserved2 unsigned int[3] Reserved
fs_InodeTbl unsigned int Size of Inode table
fs_requests
high unsigned int High portion of number of file
system requests by applications
low unsigned int Low portion of number of file
system requests by applications
fs_reserved3 unsigned int Reserved
fs_reserved4 unsigned int Reserved
fs_reserved5 unsigned int Reserved
fs_diskFormatMajorVersion unsigned int Major version of disk format
fs_diskFormatMinorVersion unsigned int Minor version of disk format
fs_reserved char[80] Reserved
- OR
-FS_STATUS2
fs_eye char[4] "FSST"
fs_len short sizeof(FS_STATUS)
fs_ver char 2
fs_res1 char Reserved
fs_id
high unsigned int High file system identifier
low unsigned int Low file system identifier
fs_cloneTime timeval Time file system cloned
fs_createTime timeval Time file system created
fs_updateTime timeval Time of last update
fs_accessTime timeval Time of last access
fs_allocLimit unsigned int Number of blocks available
fs_allocUsage unsigned int Number of blocks in use
fs_visQuotaLimit unsigned int Quota for file system
fs_visQuotaUsage unsigned int Blocks used in file system
fs_accError unsigned int Error for invalid operation
fs_accStatus int Operations being performed
fs_states int File system state
fs_nodeMax int Maximum inode number
fs_minQuota int Minimum inode number
fs_type int Type of file system
fs_threshold char FSFULL threshold monitoring
fs_increment char FSFULL monitoring increment
fs_mountstate char Mount status
0 - Not mounted
1 - Mounted R/W
2 - Mounted readonly
fs_msglen char Length of status message
fs_msg char[128] Status message
fs_aggrname char[45] Aggregate name
fs_reserved1 char[3] Reserved
fs_reserved2 unsigned int[3] Reserved
fs_InodeTbl unsigned int Size of Inode table
fs_requests
high unsigned int High portion of number of file
system requests by applications
low unsigned int Low portion of number of file
system requests by applications
fs_reserved3 unsigned int Reserved
fs_reserved4 unsigned int Reserved
fs_reserved5 unsigned int Reserved
fs_diskFormatMajorVersion unsigned int Major version of disk format
fs_diskFormatMinorVersion unsigned int Minor version of disk format
fs_allocLimit_hyper hyper Allocation limit for file system
fs_allocUsage_hyper hyper Amount of allocation used
fs_visQuotaLimit_hyper hyper Quota for file system
fs_visQuotaUsage_hyper hyper Amount of quota used
fs_reserved char[44] Reserved
Return_value 0 if request is successful, -1 if it is not successful
Return_code
EBUSY Aggregate containing file system is quiesced
EINTR ZFS is shutting down
EINVAL Invalid parameter list
EMVSERR Internal error using an osi service
ENOENT Aggregate is not attached
Reason_code
0xEFnnxxxx See z/OS Distributed File Service Messages and Codes
Usage notes
Privilege required
None.
Related services
- List Attached Aggregate Names
- List Detailed File System Information
Restrictions
When FS_ID2 is used, if you specify the z/OS UNIX file system name (fsid_mtname), you cannot specify the zFS file system name (fsid_name) nor the aggregate name (fsid_aggrname).
- fs_accError
- fs_accStatus
- fs_type
The fs_states field contains flag 0x00010000, indicating a read/write file system, and flag 0x00030000, indicating a backup file system. All other flags in this field are internal use only and are not intended for application usage.
Examples
Example 1 uses an FS_ID; see Example 2 for an example that uses FS_ID2.
#pragma linkage(BPX1PCT, OS)
extern void BPX1PCT(char *, int, int, char *, int *, int *, int *);
#include <stdio.h>
#include <time.h> /* ctime */
#define ZFSCALL_FILESYS 0x40000004
#define FSOP_GETSTAT_PARMDATA 142
typedef struct syscall_parmlist_t {
int opcode; /* Operation code to perform */
int parms[7]; /* Specific to type of operation, */
/* provides access to the parms */
/* parms[4]-parms[6] are currently unused*/
} syscall_parmlist;
typedef struct hyper { /* This is a 64 bit integer to zFS */
unsigned int high;
unsigned int low;
} hyper;
#define ZFS_MAX_AGGRNAME 44
#define ZFS_MAX_FSYSNAME 44
typedef struct fs_id_t {
char fsid_eye[4]; /* Eye catcher */
#define FSID_EYE "FSID"
char fsid_len; /* Length of this structure */
char fsid_ver; /* Version */
char fsid_res1; /* Reserved. */
char fsid_res2; /* Reserved. */
hyper fsid_id; /* Internal identifier */
#define FSID_VER_INITIAL 1 /* Initial version */
char fsid_aggrname[ZFS_MAX_AGGRNAME+1]; /* Aggregate name,
can be NULL string */
char fsid_name[ZFS_MAX_FSYSNAME+1]; /* Name, null terminated */
char fsid_reserved[32]; /* Reserved for the future */
char fsid_reserved2[2]; /* Reserved for the future */
} FS_ID;
struct timeval {
int tv_sec; /* seconds */
int tv_usec; /* microseconds */
};
typedef struct fs_status_t {
char fs_eye[4]; /* Eye catcher */
#define FS_EYE "FSST"
short fs_len; /* Length of structure */
char fs_ver;
#define FS_VER_INITIAL 1 /* Initial version */
char fs_flags; /* Flags */
#define FS_PERFINFO 0x80 /*Performance information in output status*/
hyper fs_id; /*Internal identifier */
struct timeval fs_cloneTime; /*Time when this filesys made via
clone or when last recloned */
struct timeval fs_createTime; /*Time when this filesys was created */
struct timeval fs_updateTime; /*Time when this filesys was last updates*/
struct timeval fs_accessTime; /*Time when this filesys was last accessed*/
unsigned int fs_allocLimit; /*Allocation limit for filesys in kilobytes*/
unsigned int fs_allocUsage; /*Amount of allocation used in kilobytes*/
unsigned int fs_visQuotaLimit; /*Visible filesystem quota in kilobytes*/
unsigned int fs_visQuotaUsage; /*How much quota is used in kilobytes*/
unsigned int fs_accError; /*error to return for incompatible vnode ops */
int fs_accStatus; /*Operations currently being
performed on file system */
int fs_states; /*State bits*/
#define FS_TYPE_RW 0x10000 /* read/write (ordinary) */
#define FS_TYPE_BK 0x30000 /* ``.backup */
int fs_nodeMax; /* Maximum inode number used */
int fs_minQuota;
int fs_type;
char fs_threshold; /* Threshold for fsfull monitoring */
char fs_increment; /* Increment for fsfull monitoring */
char fs_mountstate; /* Aggregate flags */
#define FS_NOT_MOUNTED 0 /* Filesys not mounted */
#define FS_MOUNTED_RW 1 /* Filesys mounted RW */
#define FS_MOUNTED_RO 2 /* Filesys mounted RO */
char fs_msglen; /* Length of status message */
char fs_msg[128]; /* Status message for filesystem */
char fs_aggrname[ZFS_MAX_AGGRNAME+1]; /* Name of aggregate I reside on */
char fs_reserved1[3]; /* Reserved for future use/alignment */
unsigned int fs_reserved2[3]; /* reserved */
unsigned int fs_InodeTbl; /*Amount of k used for the Filesystem Inode table*/
/* fs_InodeTbl is zero for all releases prior */
/* to r7 and non zero in r7 and above */
hyper fs_requests; /* Number of filesystem requests
by users/applications */
unsigned int fs_reserved3;
unsigned int fs_reserved4;
unsigned int fs_reserved5;
int fs_pad1;
unsigned int fs_diskFormatMajorVersion; /* disk format major version */
unsigned int fs_diskFormatMinorVersion; /* disk format minor version */
char fs_reserved[80]; /* Reserved for future use */
} FS_STATUS;
struct parmstruct {
syscall_parmlist myparms;
FS_ID fs_id;
FS_STATUS fs_status;
};
int main(int argc, char **argv)
{
int bpxrv;
int bpxrc;
int bpxrs;
/* file system name to getstatus */
char filesystemname[45] = "PLEX.DCEIMGQX.FS";
struct parmstruct myparmstruct;
FS_ID *idp = &(myparmstruct.fs_id);
FS_STATUS *fsp = &(myparmstruct.fs_status);
myparmstruct.myparms.opcode = FSOP_GETSTAT_PARMDATA;
myparmstruct.myparms.parms[0] = sizeof(syscall_parmlist);
myparmstruct.myparms.parms[1] = sizeof(syscall_parmlist) + sizeof(FS_ID);
myparmstruct.myparms.parms[2] = 0;
myparmstruct.myparms.parms[3] = 0;
myparmstruct.myparms.parms[4] = 0;
myparmstruct.myparms.parms[5] = 0;
myparmstruct.myparms.parms[6] = 0;
memset(idp, 0, sizeof(FS_ID)); /* Ensure reserved fields are 0 */
memset(fsp, 0, sizeof(FS_STATUS)); /* Ensure reserved fields are 0 */
memcpy(&myparmstruct.fs_status.fs_eye[0], FS_EYE, 4);
myparmstruct.fs_status.fs_len = sizeof(FS_STATUS);
myparmstruct.fs_status.fs_ver = FS_VER_INITIAL;
memcpy(&myparmstruct.fs_id.fsid_eye, FSID_EYE, 4);
myparmstruct.fs_id.fsid_len = sizeof(FS_ID);
myparmstruct.fs_id.fsid_ver = FSID_VER_INITIAL;
strcpy(myparmstruct.fs_id.fsid_name, filesystemname);
BPX1PCT("ZFS ",
ZFSCALL_FILESYS, /* File system operation */
sizeof(myparmstruct), /* Length of Argument */
(char *)&myparmstruct, /* Pointer to Argument */
&bpxrv, /* Pointer to Return_value */
&bpxrc, /* Pointer to Return_code */
&bpxrs); /* Pointer to Reason_code */
if (bpxrv < 0)
{
printf("Error getstatus file system %s\n", filesystemname);
printf("BPXRV = %d BPXRC = %d BPXRS = %x\n", bpxrv, bpxrc, bpxrs);
return bpxrc;
}
else
{ /* Return from getstatus was successful */
printf("File system %s getstatus successful\n", filesystemname);
printf("getstatus: fs_id=%d,,%d, clone_time=%s, "
"create_time=%s, update_time=%s, access_time=%s\n",
myparmstruct.fs_status.fs_id.high,
myparmstruct.fs_status.fs_id.low,
ctime((const long*) &myparmstruct.fs_status.fs_cloneTime.tv_sec),
ctime((const long*) &myparmstruct.fs_status.fs_createTime.tv_sec),
ctime((const long*) &myparmstruct.fs_status.fs_updateTime.tv_sec),
ctime((const long*) &myparmstruct.fs_status.fs_accessTime.tv_sec));
printf("getstatus: alloc_limit=%u, alloc_usage=%u, quota_limit=%u\n",
myparmstruct.fs_status.fs_allocLimit,
myparmstruct.fs_status.fs_allocUsage,
myparmstruct.fs_status.fs_visQuotaLimit);
printf("getstatus: quota_usage=%u, accError=%u, accStatus=%x, states=%x\n",
myparmstruct.fs_status.fs_visQuotaUsage,
myparmstruct.fs_status.fs_accError,
myparmstruct.fs_status.fs_accStatus,
myparmstruct.fs_status.fs_states);
printf("getstatus: max_inode=%d, min_quota=%d, "
"type=%d, fsfull_threshold=%d\n",
myparmstruct.fs_status.fs_nodeMax,
myparmstruct.fs_status.fs_minQuota,
myparmstruct.fs_status.fs_type,
myparmstruct.fs_status.fs_threshold);
printf("getstatus: fsfull_increment=%d, mount_state=%d, "
"msg_len=%d, msg=%s\n",
myparmstruct.fs_status.fs_increment,
myparmstruct.fs_status.fs_mountstate,
myparmstruct.fs_status.fs_msglen,
myparmstruct.fs_status.fs_msg);
printf("getstatus: aggrname=%s\n", myparmstruct.fs_status.fs_aggrname);
printf("getstatus: inode_table_k=%d, fs_requests=%d,,%d\n",
myparmstruct.fs_status.fs_InodeTbl,
myparmstruct.fs_status.fs_requests.high,
myparmstruct.fs_status.fs_requests.low);
printf("getstatus: version=%d.%d\n",
myparmstruct.fs_status.fs_diskFormatMajorVersion,
myparmstruct.fs_status.fs_diskFormatMinorVersion);
}
return 0;
}
The following example uses FS_ID2; see Example 1 for an example that uses FS_ID.
#pragma linkage(BPX1PCT, OS)
#pragma LANGLVL(EXTENDED)
extern void BPX1PCT(char *, int, int, char *, int *, int *, int *);
#include <stdio.h>
#include <time.h> /* ctime */
#define ZFSCALL_FILESYS 0x40000004
#define FSOP_GETSTAT_PARMDATA 142
typedef struct syscall_parmlist_t {
int opcode; /* Operation code to perform */
int parms[7]; /* Specific to type of operation, */
/* provides access to the parms */
/* parms[4]-parms[6] are currently unused*/
} syscall_parmlist;
typedef struct hyper { /* This is a 64 bit integer to zFS */
unsigned int high;
unsigned int low;
} hyper;
#define ZFS_MAX_AGGRNAME 44
#define ZFS_MAX_FSYSNAME 44
typedef struct fs_id2_t {
char fsid_eye[4]; /* Eye catcher */
#define FSID_EYE "FSID"
char fsid_len; /* Length of this structure */
char fsid_ver; /* Version */
char fsid_res1; /* Reserved. */
char fsid_res2; /* Reserved. */
hyper fsid_id; /* Internal identifier */
#define FSID_VER_2 2 /* version for FS_ID2 */
char fsid_aggrname[ZFS_MAX_AGGRNAME+1]; /* Aggregate name, can
be NULL string */
char fsid_name[ZFS_MAX_FSYSNAME+1]; /* Name, null terminated */
char fsid_mtname[ZFS_MAX_FSYSNAME+1]; /* Mount name, null terminated */
char fsid_reserved[49]; /* Reserved for the future*/
} FS_ID2;
struct timeval {
int tv_sec; /* seconds */
int tv_usec; /* microseconds */
};
typedef struct fs_status_t {
char fs_eye[4]; /* Eye catcher */
#define FS_EYE "FSST"
short fs_len; /* Length of structure */
char fs_ver;
#define FS_VER_INITIAL 1 /* Initial version */
char fs_flags; /* Flags */
#define FS_PERFINFO 0x80 /* Performance information in
output status */
hyper fs_id; /* Internal identifier */
struct timeval fs_cloneTime; /* Time when this filesys made via
clone or when last recloned */
struct timeval fs_createTime; /* Time when this filesys
was created */
struct timeval fs_updateTime; /* Time when this filesys
was last updated */
struct timeval fs_accessTime; /* Time when this filesys
was last accessed */
unsigned int fs_allocLimit; /* Allocation limit for filesys
in kilobytes*/
unsigned int fs_allocUsage; /* Amount of allocation used
in kilobytes*/
unsigned int fs_visQuotaLimit; /* Visible filesystem quota
in kilobytes*/
unsigned int fs_visQuotaUsage; /* How much quota is used in kilobytes*/
unsigned int fs_accError; /* error to return for
incompatible vnode ops */
int fs_accStatus; /* Operations currently being
performed on file system */
int fs_states; /* State bits */
#define FS_TYPE_RW 0x10000 /* read/write (ordinary) */
#define FS_TYPE_BK 0x30000 /* ``.backup'' */
int fs_nodeMax; /* Maximum inode number used */
int fs_minQuota;
int fs_type;
char fs_threshold; /* Threshold for fsfull monitoring */
char fs_increment; /* Increment for fsfull monitoring */
char fs_mountstate; /* Aggregate flags */
#define FS_NOT_MOUNTED 0 /* Filesys not mounted */
#define FS_MOUNTED_RW 1 /* Filesys mounted RW */
#define FS_MOUNTED_RO 2 /* Filesys mounted RO */
char fs_msglen; /* Length of status message */
char fs_msg[128]; /* Status message for filesystem */
char fs_aggrname[ZFS_MAX_AGGRNAME+1]; /* Name of aggregate
I reside on */
char fs_reserved1[3]; /* Reserved for future use/alignment */
unsigned int fs_reserved2[3]; /* reserved */
unsigned int fs_InodeTbl; /* Amount of k used for the
Filesystem Inode table*/
/* fs_InodeTbl is zero for all
releases prior to */
/* r7 and non zero in r7 and above */
hyper fs_requests; /* Number of filesystem requests by
users/applications */
unsigned int fs_reserved3;
unsigned int fs_reserved4;
unsigned int fs_reserved5;
int fs_pad1;
unsigned int fs_diskFormatMajorVersion; /* disk format major version */
unsigned int fs_diskFormatMinorVersion; /* disk format minor version */
char fs_reserved[80]; /* Reserved for future use */
} FS_STATUS;
struct parmstruct {
syscall_parmlist myparms;
FS_ID2 fs_id2;
FS_STATUS fs_status;
};
int main(int argc, char **argv)
{
int bpxrv;
int bpxrc;
int bpxrs;
/* file system name to getstatus */
char filesystemname[45] = "PLEX.DCEIMGQX.FS";
struct parmstruct myparmstruct;
FS_ID2 *idp = &(myparmstruct.fs_id2);
FS_STATUS *fsp = &(myparmstruct.fs_status);
myparmstruct.myparms.opcode = FSOP_GETSTAT_PARMDATA;
myparmstruct.myparms.parms[0] = sizeof(syscall_parmlist);
myparmstruct.myparms.parms[1] = sizeof(syscall_parmlist) + sizeof(FS_ID2);
myparmstruct.myparms.parms[2] = 0;
myparmstruct.myparms.parms[3] = 0;
myparmstruct.myparms.parms[4] = 0;
myparmstruct.myparms.parms[5] = 0;
myparmstruct.myparms.parms[6] = 0;
memset(idp, 0, sizeof(FS_ID2)); /* Ensure reserved fields are 0 */
memset(fsp, 0, sizeof(FS_STATUS)); /* Ensure reserved fields are 0 */
memcpy(&myparmstruct.fs_status.fs_eye[0], FS_EYE, 4);
myparmstruct.fs_status.fs_len = sizeof(FS_STATUS);
myparmstruct.fs_status.fs_ver = FS_VER_INITIAL;
memcpy(&myparmstruct.fs_id2.fsid_eye, FSID_EYE, 4);
myparmstruct.fs_id2.fsid_len = sizeof(FS_ID2);
myparmstruct.fs_id2.fsid_ver = FSID_VER_2;
strcpy(myparmstruct.fs_id2.fsid_mtname, filesystemname);
BPX1PCT("ZFS ",
ZFSCALL_FILESYS, /* File system operation */
sizeof(myparmstruct), /* Length of Argument */
(char *)&myparmstruct, /* Pointer to Argument */
&bpxrv, /* Pointer to Return_value */
&bpxrc, /* Pointer to Return_code */
&bpxrs); /* Pointer to Reason_code */
if (bpxrv < 0)
{
printf("Error getstatus file system %s\n", filesystemname);
printf("BPXRV = %d BPXRC = %d BPXRS = %x\n", bpxrv, bpxrc, bpxrs);
return bpxrc;
}
else
{ /* Return from getstatus was successful */
printf("File system %s getstatus successful\n", filesystemname);
printf("getstatus: fs_id=%d,,%d, clone_time=%s, create_time=%s, "
"update_time=%s, access_time=%s\n",
myparmstruct.fs_status.fs_id.high,
myparmstruct.fs_status.fs_id.low,
ctime((const long*) &myparmstruct.fs_status.fs_cloneTime.tv_sec),
ctime((const long*) &myparmstruct.fs_status.fs_createTime.tv_sec),
ctime((const long*) &myparmstruct.fs_status.fs_updateTime.tv_sec),
ctime((const long*) &myparmstruct.fs_status.fs_accessTime.tv_sec));
printf("getstatus: alloc_limit=%u, alloc_usage=%u, quota_limit=%u\n",
myparmstruct.fs_status.fs_allocLimit,
myparmstruct.fs_status.fs_allocUsage,
myparmstruct.fs_status.fs_visQuotaLimit);
printf("getstatus: quota_usage=%u, accError=%u, accStatus=%x, states=%x\n",
myparmstruct.fs_status.fs_visQuotaUsage,
myparmstruct.fs_status.fs_accError,
myparmstruct.fs_status.fs_accStatus,
myparmstruct.fs_status.fs_states);
printf("getstatus: max_inode=%d, min_quota=%d, type=%d, "
"fsfull_threshold=%d\n",
myparmstruct.fs_status.fs_nodeMax,
myparmstruct.fs_status.fs_minQuota,
myparmstruct.fs_status.fs_type,
myparmstruct.fs_status.fs_threshold);
printf("getstatus: fsfull_increment=%d, mount_state=%d, "
"msg_len=%d, msg=%s\n",
myparmstruct.fs_status.fs_increment,
myparmstruct.fs_status.fs_mountstate,
myparmstruct.fs_status.fs_msglen,
myparmstruct.fs_status.fs_msg);
printf("getstatus: aggrname=%s\n", myparmstruct.fs_status.fs_aggrname);
printf("getstatus: inode_table_k=%d, fs_requests=%d,,%d\n",
myparmstruct.fs_status.fs_InodeTbl,
myparmstruct.fs_status.fs_requests.high,
myparmstruct.fs_status.fs_requests.low);
printf("getstatus: version=%d.%d\n",
myparmstruct.fs_status.fs_diskFormatMajorVersion,
myparmstruct.fs_status.fs_diskFormatMinorVersion);
}
return 0;
}