z/OS Distributed File Service zFS Administration
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Delete File System

z/OS Distributed File Service zFS Administration
SC23-6887-00

Purpose

This subcommand call can be used to delete an existing backup file system. (Beginning in z/OS® V2R1, backup file systems are no longer supported.) The aggregate that contains the file system to be deleted must be attached. You can use an FS_ID or an FS_ID2 as input.

Format

syscall_parmlist
   opcode                           136       AGOP_DELETEFILESYS_PARMDATA
   parms[0]                         offset to FS_ID or FS_ID2
   parms[1]                         0
   parms[2]                         0
   parms[3]                         0
   parms[4]                         0
   parms[5]                         0
   parms[6]                         0
FS_ID or FS_ID2
   fsid_eye                         char[4]    "FSID"
   fsid_len                         char       sizeof(FS_ID)
   fsid_ver                         char       1
   fsid_res1                        char       0
   fsid_res2                        char       0
   fsid_id                          hyper
      high                            long     0
      low                             long     0
   fsid_aggrname                    char[45]   0
   fsid_name                        char[45]   "OMVS.PRV.FS3"
   fsid_reserved                    char[32]   0
   fsid_reserved2                   char[2]    0
FS_ID2 or FS_ID
   fsid_eye                         char[4]    "FSID"
   fsid_len                         char       sizeof(FS_ID2)
   fsid_ver                         char       2
   fsid_res1                        char       0
   fsid_res2                        char       0
   fsid_id
     high                           unsigned long  0
     low                            unsigned long  0
   fsid_aggrname                    char[45]   0
   fsid_name                        char[45]   "OMVS.PRV.FS3"
   fsid_mtname                      char[45]   0
   fsid_reserved                    char[49]   0

Return_value    0 if request is successful, -1 if it is not successful

Return_code
  EBUSY         Aggregate containing file system is quiesced
  EXIST         File system does not exist
  EINTR         ZFS is shutting down
  EMVSERR       Internal error using an osi service
  EPERM         Permission denied to perform request
  EROFS         Aggregate is attached as read only
Reason_code
  0xEFnnxxxx    See z/OS Distributed File Service Messages and Codes

Usage notes

  • Removing a backup file system does not remove the associated read/write file system.
  • Reserved fields and undefined flags must be set to binary zeros.

Privilege required

The issuer must be logged in as root or must have READ authority to the SUPERUSER.FILESYS.PFSCTL resource in the z/OS UNIXPRIV class.

Related services

  • Attach Aggregate

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;
}

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014