Purpose
This subcommand call is an aggregate
operation that returns information about a specified attached aggregate
on this system.
Format
syscall_parmlist
opcode 137 AGOP_GETSTATUS_PARMDATA
parms[0] offset to AGGR_ID
parms[1] offset to AGGR_STATUS
parms[2] 0
parms[3] 0
parms[4] 0
parms[5] 0
parms[6] 0
AGGR_ID
aid_eye char[4] "AGID"
aid_len char sizeof(AGGR_ID)
aid_ver char 1
aid_name char[45] "OMVS.PRV.AGGR001.LDS0001"
aid_reserved char[33] 0
AGGR_STATUS
as_eye char[4] "AGST"
as_len short sizeof(AGGR_STATUS)
as_ver char 1
as_res1 char 0
as_aggrId long Aggregate ID
as_nFileSystems long Number of File Systems
as_threshold char Aggrfull threshold
as_increment char Aggrfull increment
as_flags char
AS_MONITOR 0x80
AS_RO 0x40
AS_NBS 0x20
AS_COMPAT 0x10
AS_GROW 0x08
as_res2 char 0
as_blocks unsigned long
as_fragSize long
as_blockSize long
as_totalUsable unsigned long
as_realFree unsigned long
as_minFree unsigned long
as_reserved char[128]
Return_value 0 if request is successful, -1 if it is not successful
Return_code
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
- To grow an aggregate, you need to specify a number larger than
the sum of as_totalUsable and as_minFree.
- Reserved fields and undefined flags must be set to binary zeros.
Related services
- List Attached Aggregate Names
Examples
#pragma linkage(BPX1PCT, OS)
extern void BPX1PCT(char *, int, int, char *, int *, int *, int *);
#include <stdio.h>
#define ZFSCALL_AGGR 0x40000005
#define AGOP_GETSTATUS_PARMDATA 137
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;
#define ZFS_MAX_AGGRNAME 44
typedef struct aggr_id_t {
char aid_eye[4]; /* Eye Catcher */
#define AID_EYE "AGID"
char aid_len; /* Length of this structure */
char aid_ver; /* Version */
#define AID_VER_INITIAL 1 /* Initial version */
char aid_name[ZFS_MAX_AGGRNAME+1]; /* aggr name, null terminated */
char aid_reserved[33]; /* Reserved for the future */
} AGGR_ID;
typedef unsigned long u_long;
typedef struct aggr_status_t {
char as_eye[4]; /* Eye catcher */
#define AS_EYE "AGST"
short as_len; /* Length of structure */
char as_ver;
#define AS_VER_INITIAL 1 /* Initial version */
char as_res1; /* Reserved. */
long as_aggrId; /* Internal identifier */
long as_nFileSystems; /* Number of filesystems in aggregate */
char as_threshold; /* Threshold for aggrfull monitoring */
char as_increment; /* Increment for aggrfull monitoring */
char as_flags; /* Aggregate flags */
#define AS_MONITOR 0x80 /* Aggr monitored for aggr full */
#define AS_RO 0x40 /* Aggr attached Read-only */
#define AS_NBS 0x20 /* Aggr should guarantee NBS */
#define AS_COMPAT 0x10 /* Aggr is HFS compatible */
#define AS_GROW 0x08 /* Aggr can be dynamically grown */
char as_res2; /* Reserved */
u_long as_blocks; /* Number of fragments in aggregate */
long as_fragSize; /* Size of fragment in aggregate (normally 1K) */
long as_blockSize; /* Size of blocks on aggregate (normally 8K) */
u_long as_totalUsable; /* Total available blocks on aggregate (normally 8K) */
u_long as_realFree; /* Total kilobytes free */
u_long as_minFree; /* Minimum kilobytes free */
char as_reserved[128]; /* Reserved for future */
} AGGR_STATUS;
struct parmstruct
{
syscall_parmlist myparms;
AGGR_ID aggr_id;
AGGR_STATUS aggr_status;
} ;
int main(int argc, char **argv)
{
int bpxrv;
int bpxrc;
int bpxrs;
char aggrname[45] = "OMVS.PRV.AGGR001.LDS0001"; /* aggregate name to getstatus */
struct parmstruct myparmstruct;
AGGR_ID *idp = &(myparmstruct.aggr_id);
AGGR_STATUS *asp = &(myparmstruct.aggr_status);
myparmstruct.myparms.opcode = AGOP_GETSTATUS_PARMDATA;
myparmstruct.myparms.parms[0] = sizeof(syscall_parmlist);
myparmstruct.myparms.parms[1] = sizeof(syscall_parmlist) + sizeof(AGGR_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(AGGR_ID)); /* Ensure reserved fields are 0 */
memset(asp,0,sizeof(AGGR_STATUS)); /* Ensure reserved fields are 0 */
memcpy(&myparmstruct.aggr_status.as_eye[0], AS_EYE, 4);
myparmstruct.aggr_status.as_len = sizeof(AGGR_STATUS);
myparmstruct.aggr_status.as_ver = AS_VER_INITIAL;
memcpy(&myparmstruct.aggr_id,AID_EYE,4);
myparmstruct.aggr_id.aid_len = sizeof(AGGR_ID);
myparmstruct.aggr_id.aid_ver = AID_VER_INITIAL;
strcpy(myparmstruct.aggr_id.aid_name,aggrname);
BPX1PCT("ZFS ",
ZFSCALL_AGGR, /* Aggregate 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 aggregate %s\n", aggrname);
printf("BPXRV = %d BPXRC = %d BPXRS = %x\n",bpxrv,bpxrc,bpxrs);
return bpxrc;
}
else /* Return from getstatus was successful */
{
printf("Aggregate %s getstatus successful\n",aggrname);
printf("getstatus: aggr_id=%d, no_of_filesystems=%d, aggr_flags=%x\n",
myparmstruct.aggr_status.as_aggrId,
myparmstruct.aggr_status.as_nFileSystems,
myparmstruct.aggr_status.as_flags);
printf("getstatus: threshold=%d, increment=%d\n",
myparmstruct.aggr_status.as_threshold,
myparmstruct.aggr_status.as_increment);
printf("getstatus: blocks=%d, frag_size=%d, block_size=%d\n",
myparmstruct.aggr_status.as_blocks,
myparmstruct.aggr_status.as_fragSize,
myparmstruct.aggr_status.as_blockSize);
printf("getstatus: total_usable=%d, real_free=%d, min_free=%d\n",
myparmstruct.aggr_status.as_totalUsable,
myparmstruct.aggr_status.as_realFree,
myparmstruct.aggr_status.as_minFree);
}
return 0;
}