Restrictions
The aggregate
cannot be quiesced or attached as read-only. You cannot delete a file
system that is mounted.
When
using an FS_ID2 as input, you cannot specify the file system with
the z/OS UNIX file system name (fsid_mtname) since the
file system cannot be mounted. You must use the zFS file system name
(fsid_name).
When FS_ID2 is used, you cannot specify the z/OS UNIX file
system name (fsid_mtname).
Examples
Example 1: The
following example uses an FS_ID; see Example
2 for an example that uses an FS_ID2.
#pragma linkage(BX1PCT, OS)
extern void BPX1PCT(char *, int, int, char *, int *, int *, int *);
#include <stdio.h>
#define ZFSCALL_AGGR 0x40000005
#define AGOP_DELETEFILESYS_PARMDATA 136
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 { /* unsigned 64 bit integers */
unsigned long high;
unsigned long 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 */
#define FSID_VER_INITIAL 1 /* Initial version */
char fsid_res1; /* Reserved. */
char fsid_res2; /* Reserved. */
hyper fsid_id; /* Internal identifier */
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 parmstruct
{
syscall_parmlist myparms;
FS_ID fsid;
} ;
int main(int argc, char **argv)
{
int bpxrv;
int bpxrc;
int bpxrs;
char filesystemname[45] = "OMVS.PRV.FS3";
struct parmstruct myparmstruct;
FS_ID *idp = &(myparmstruct.fsid);
myparmstruct.myparms.opcode = AGOP_DELETEFILESYS_PARMDATA;
myparmstruct.myparms.parms[0] = sizeof(syscall_parmlist);
myparmstruct.myparms.parms[1] = 0;
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 */
memcpy(&myparmstruct.fsid.fsid_eye, FSID_EYE, 4);
myparmstruct.fsid.fsid_len = sizeof(FS_ID);
myparmstruct.fsid.fsid_ver = FSID_VER_INITIAL;
strcpy(myparmstruct.fsid.fsid_name,filesystemname);
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 deleting file system %s\n",filesystemname);
printf("BPXRV = %d BPXRC = %d BPXRS = %x\n",bpxrv,bpxrc,bpxrs);
return bpxrc;
}
else /* Return from delete file system was successful */
{
printf("File system %s deleted successfully\n",filesystemname);
}
return 0;
}
Example 2: The following example
uses an FS_ID2; see Example 2 for
an example that uses an FS_ID.
#pragma linkage(BPX1PCT, OS)
extern void BPX1PCT(char *, int, int, char *, int *, int *, int *);
#include <stdio.h>
#define ZFSCALL_AGGR 0x40000005
#define AGOP_DELETEFILESYS_PARMDATA 136
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 { /* unsigned 64 bit integers */
unsigned long high;
unsigned long 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 */
#define FSID_VER_INITIAL 1 /* Initial version */
char fsid_res1; /* Reserved. */
char fsid_res2; /* Reserved. */
hyper fsid_id; /* Internal identifier */
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;
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 /* Second 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_mtname[ZFS_MAX_FSYSNAME+1]; /* Mount name, null terminated */
char fsid_reserved[49]; /* Reserved for the future */
} FS_ID2;
struct parmstruct
{
syscall_parmlist myparms;
FS_ID2 fsid;
} ;
int main(int argc, char **argv)
{
int bpxrv;
int bpxrc;
int bpxrs;
char filesystemname[45] = "OMVS.PRV.FS3";
struct parmstruct myparmstruct;
FS_ID2 *idp = &(myparmstruct.fsid);
myparmstruct.myparms.opcode = AGOP_DELETEFILESYS_PARMDATA;
myparmstruct.myparms.parms[0] = sizeof(syscall_parmlist);
myparmstruct.myparms.parms[1] = 0;
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 */
memcpy(&myparmstruct.fsid.fsid_eye, FSID_EYE, 4);
myparmstruct.fsid.fsid_len = sizeof(FS_ID2);
myparmstruct.fsid.fsid_ver = FSID_VER_2;
strcpy(myparmstruct.fsid.fsid_name,filesystemname);
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 deleting file system %s\n",filesystemname);
printf("BPXRV = %d BPXRC = %d BPXRS = %x\n",bpxrv,bpxrc,bpxrs);
return bpxrc;
}
else /* Return from delete file system was successful */
{
printf("File system %s deleted successfully\n",filesystemname);
}
return 0;
}