Home > Veritas Storage Foundation™ File System Manual Pages
VXFS_AP_ENUMERATE2 (3) |
|
Library Functions |
Table of contents
vxfs_ap_enumerate2 - return information about all allocation policies
cc -I /opt/VRTS/include -L /opt/VRTS/lib
-l vxfsutil -ldl
#include <sys/types.h>
#include <vxfsutil.h>
int vxfs_ap_enumerate2(int fd, uint32_t \(**countp, struct fsap_info2 \(**\(**infolistpp);
VRTSvxfs
vxfs_ap_enumerate2()
allocates and fills the array of
fsap_info2
structures with information on the allocation policies belonging to the
file system specified by
fd.
The file descriptor
fd
can be any file on the file system.
On return,
\(**countp
contains the number of records that were filled in.
The
fsap_info2
entries in the list are traversed using the
VXFS_AP_NEXTINFO(infop)
macro.
The caller is responsible for freeing the
fsap_info2
list by calling
vxfs_ap_free2().
struct fsap_info2 {
char ap_name[FSAP_NAMESZ];
uint32_t ap_flags;
uint32_t ap_order;
uint64_t ap_chunk;
uint32_t ap_ncomp;
uint32_t ap_pad;
union {
char apc_vols[1][FSVOL_NAMEZ];
char apc_subp[1][FSAP_NAMEZ];
} ap_comp;
};
#define ap_vols ap_comp.apc_vols
#define ap_subp ap_comp.apc_subp
To use this function,
specify
-l vxfsutil
while linking.
This API supports file
system versions 6.0 and above.
vxfs_ap_enumerate2()
returns zero on success,
non-zero on failure.
-
EFAULT
-
One or more of the specified pointer arguments points to an illegal address.
-
ENOTSUP
-
This operation is not supported by the disk layout version of the
specified file system.
Use
vxupgrade(1M)
to enable this operation.
The following pseudo-code lists the policies of a file system:
#include <vxfsutil.h>
/*
* List policies of a file system.
*/
int
list_policy()
{
struct fsap_info2 \(**fsap = NULL;
struct fsap_info2 \(**infop;
uint32_t count;
int err = 0;
int fd;
int i;
if ((fd = open("My_mountpoint", O_RDONLY)) < 0) {
return errno;
}
if (err = vxfs_ap_enumerate2(fd, &count, &fsap)) {
goto out;
}
for (i = 0, infop = fsap; i < count;
i++, infop = VXFS_AP_NEXTINFO(infop)) {
/*
* Do something with the policy.
*/
do_something(infop);
}
out:
close(fd);
if (fsap) {
vxfs_ap_free2(fsap);
}
return err;
}
vxfs_ap_alloc2(3),
vxfs_ap_assign_ckpt(3),
vxfs_ap_assign_file(3),
vxfs_ap_assign_fs(3),
vxfs_ap_define(3),
vxfs_ap_define2(3),
vxfs_ap_remove(3),
vxfs_ap_enforce_file(3),
vxfs_ap_enumerate(3),
vxfs_ap_free2(3),
vxfs_ap_query(3),
vxfs_ap_query2(3),
vxfs_ap_query_ckpt(3),
vxfs_ap_query_file(3),
vxfs_ap_query_fs(3),
vxfs_vol_add(3),
vxfs_vol_deencapsulate(3),
vxfs_vol_encapsulate(3),
vxfs_vol_remove(3),
vxfs_vol_resize(3),
vxfs_vol_stat(3)
Last updated: 7 May 2007
Copyright ©2009 Symantec Corporation
All rights reserved.