vxfs_ap_enumerate2 - return information about all allocation policies
cc -I /opt/VRTS/include -L /opt/VRTS/lib
-l vxfsutil -ldl
cc -I /opt/VRTS/include -L /opt/VRTS/lib/sparcv9
-l vxfsutil -ldl
int vxfs_ap_enumerate2(int fd, uint32_t *countp, struct fsap_info2 **infolistpp);
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().
char apc_vols[1][FSVOL_NAMEZ];
#define ap_vols ap_comp.apc_vols
#define ap_subp ap_comp.apc_subp
To use this function, specify -l vxfsutil while linking. Specify the /opt/VRTSvxfs/lib directory for 32-bit executables, or the /opt/VRTSvxfs/lib/sparcv9 directory for 64-bit executables.
This API supports file system versions 6.0 and above.
vxfs_ap_enumerate2() returns zero on success, non-zero on failure.
One or more of the specified pointer arguments points to an illegal address.
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:
* List policies of a file system.
struct fsap_info2 *fsap = NULL;
if ((fd = open("My_mountpoint", O_RDONLY)) < 0) {
if (err = vxfs_ap_enumerate2(fd, &count, &fsap)) {
for (i = 0, infop = fsap; i < count;
i++, infop = VXFS_AP_NEXTINFO(infop)) {
* Do something with the policy.
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)