Allows you to request and change the virtual shared disk fence map.
#include <vsd_ioctl.h>
int ioctl(FileDescriptor, Command, Argument)
int FileDescriptor, Command;
void *Argument;
struct vsd_FenceMap /* This is the argument to the VSD fence ioctl. */
{
ulong flags;
vsd_minorBitmap_t minornoBitmap; /* Bitmap of minor numbers to fence
(supports 10000 vsds) */
vsd_Fence_Bitmap_t nodesBitmap; /* Nodes to (un)fence these vsds from
(supports node numbers 1-2048) */
}vsd_FenceMap_t
The flags VSD_FENCE and VSD_UNFENCE are mutually exclusive — an ioctl can either fence a set of virtual shared disks or unfence a set of virtual shared disks, but not both. The minornoBitmap denotes which virtual shared disks are to be fenced/unfenced from the nodes specified in the nodesBitmap.
The following example fences a virtual shared disk with a minor number of 7 from node 4 and 5, and unfences a virtual shared disk with a minor number of 5 from node 1:
int fd;
vsd_FenceMap_t FenceMap;
/* Clear the FenceMap */
bzero(FenceMap, sizeof(vsd_FenceMap_t));
/* fence nodes 4,5 from minor 7 */
FenceMap.flags = VSD_FENCE;
MAP_SET(7, FenceMap.minornoBitmap);
MAP_SET(4, FenceMap.nodesBitmap);
MAP_SET(5, FenceMap.nodesBitmap);
/* Issue the fence request */
ioctl(fd,GIOCFENCE,&FenceMap);
/* Unfence node 1 from minor 5*/
bzero(FenceMap, sizeof(vsd_FenceMap_t));
FenceMap.flags = VSD_UNFENCE | VSD_FENCE_FORCE;
MAP_SET(5, FenceMap.minornoBitmap);
MAP_SET(1, FenceMap.nodesBitmap);
/* Issue the fence request */
ioctl(fd,GIOCFENCE,&FenceMap);
If the request succeeds, the ioctl returns 0. In the case of an error, a value of -1 is returned with the global variable errno set to identify the error.