perfstat_cluster_disk Subroutine

Purpose

Retrieves the disk details of the cluster nodes.

Library

perfstat library (libperfstat.a)

Syntax

#include <libperfstat.h>

int perfstat_cluster_disk( name, userbuff, sizeof_userbuff, desired_number)

perfstat_id_node_t *name;
perfstat_disk_data_t *userbuff;
int sizeof_userbuff;
int desired_number;

Description

The perfstat_cluster_disk subroutine returns the list of disks in a perfstat_disk_data_t structure.

The perfstat_cluster_disk subroutine must be called only after you enable the cluster statistics collection by using the following perfstat API call:
perfstat_config(PERFSTAT_ENABLE | PERFSTAT_CLUSTER_STATS, NULL)
The cluster statistics collection must be disabled after you get the list of disks by using the following perfstat API call:
perfstat_config(PERFSTAT_DISABLE | PERFSTAT_CLUSTER_STATS, NULL)

To identify the total number of cluster disks in a specific node (in which the current node is participating), the following criteria must be specified:

  • The node name must be specified in the name parameter.
  • The userbuff parameter must be set to NULL.
  • The desired_number parameter must be set to 0.

To obtain the list of cluster disks in a specific node, the userbuff parameter and the desired_number parameter must be used.

Parameters

name.nodename or name.spec
Specifies the node name or the node ID for which the data must be returned.
userbuff
Specifies the memory area that must be filled with the perfstat_disk_data_t structure.
sizeof_userbuff
Specifies the size of the perfstat_disk_data_t structure.
desired_number
Specifies the number of structures to be returned.

Return values

The number of filled structures is returned upon successful completion. If unsuccessful, a value of -1 is returned and the errno global variable is set.

Error codes

The perfstat_cluster_disk subroutine fails because of one of the following errors:

EINVAL
One of the parameters is not valid.
ENOENT
The cluster statistics collection is not enabled by using the perfstat_config subroutine, the cluster statistics collection is not supported, or the specified node cannot be found.

Files

The libperfstat.h file defines standard macros, data types, and subroutines.