sdrec(F)
sdrec(F)
sdrec - structure defining a subdisk record 
 Synopsis
#include <sys/types.h>
#include <volintf.h>
#define Name_LEN       14
#define COMMENT_LEN    40
#define SD_PATH_LEN    32
#define UTIL_NUM       3
#define UTIL_LEN       14
#define Name_SZ        (Name_LEN + 1)
#define COMMENT_SZ     (COMMENT_LEN + 1)
#define SD_PATH_SZ     (SD_PATH_LEN + 1)
#define UTIL_SZ        (UTIL_LEN + 1)
struct volseqno { ulong_t seqno_lo, seqno_hi; };
typedef struct volseqno volseqno_t;
typedef struct volseqno volrid_t;
struct sdrec {
        struct sd_tmp  sd_tmp;       /* non-persistent fields */
        struct sd_perm sd_perm;      /* persistent fields */
};
Fields for the sd_perm structure:
	char        sd_name[Name_SZ];          /* subdisk record name */
	char        sd_path[SD_PATH_SZ];       /* subdisk block device path */
	char        sd_pl_name[Name_SZ];       /* associated plex name */
	char        sd_comment[COMMENT_SZ];    /* comment field /* 
	char        sd_putil[UTIL_NUM][UTIL_SZ]; /* persistent util fields */
	ulong_t     sd_pflag;                  /* persistent flags */
	volseqno_t  sd_update_tid;             /* trans id of last update*/
	voff_t      sd_dev_offset;             /* offset within bdev */
	voff_t      sd_pl_offset;              /* offset of subdisk in plex */
	voff_t      sd_dm_offset;              /* offset relative to disk */
	voff_t      sd_len;                    /* byte length of subdisk */
	volrid_t    sd_rid;                    /* unique identifier */
	volrid_t    sd_plex_rid;               /* record ID of plex */
	volrid_t    sd_dm_rid;                 /* disk media record ID */
Fields for the sd_tmp structure: 
	char        sd_tutil[UTIL_NUM][UTIL_S  /* non-persistent util fields */
	dev_t       sd_dev;                    /* block device of subdisk */
	long        sd_lock;                   /* 1 if record is locked */
	ulong_t     sd_tflag;                  /* non-persistent flags */
	char        sd_da_name[Name_SZ];       /* disk access name */
	char        sd_dm_name[Name_SZ];       /* disk media name */
	char        sd_device_tag[Name_SZ];    /* device tag */
 Description
A sdrec structure is the structure used to communicate subdisk record information between the volume configuration daemon, vold, and programs using the Volume Manager library to query for configurations and to make configuration changes. 
The two structures contained in the sdrec structure differentiate elements of the subdisk record that are persistent and that are non-persistent.  The division of fields between sd_tmp and sd_perm structures is somewhat historical, however the sd_perm structure contains information that is stored persistently (i.e., fields that are recovered unchanged after a system reboot), or is directly derivable from persistent subdisk record information.  The sd_tmp field, on the other hand, contains fields that can be modified without the changes being stored persistently. 
The uses of the various subdisk fields are defined as follows: 
- sd_name 
 - The subdisk name.  This field cannot be changed directly, although it can be changed by calling 
vxvm_rename. 
 - v_rid 
 - This is a 64-bit record ID assigned to the plex record, which is unique within the disk group for the 
duration of existence for the disk group.  This does not change as a result of a 
vxvm_rename, even though the record name changes. 
 - sd_path 
 - The path to the underlying block device.  For backward compatibility, this can be set for subdisk 
creation if a disk is not specified with sd_dm_rid, sd_dm_name, or 
sd_da_name.  After creation (or if any of the disk identifier fields is set for creation), this 
field is derived from the block device path for the public region of the disk that the subdisk 
is defined on.  This field can be empty if the disk media record is currently in the 
REMOVED or NODAREC state. 
 - sd_pl_name 
 - The name of the asssociated plex.  This field is empty if the subdisk is not associated.  This is a read-
only field. 
 - sd_comment 
 - A null-terminated comment string associated with the record.  The contents are arbitrary except that 
they cannot contain a new line. 
 - sd_putil 
 - An array of three null-terminated strings that can be used as scratch pads by utilities.  These fields 
are preserved across reboots.  By convention, the first field is reserved for usage types; the 
second field for higher-level applications, such as the VERITAS Visual Administrator; and 
the third field for local site administrators. 
 - sd_pflag 
 - Flags associated with the subdisk that are preserved across reboots. The persistent flag that can be 
set is: 
- SD_PFLAG_VOLATILE 
 - The contents of the underlying block device may not be retained across a reboot.  This flag 
can be set for devices such as RAM disks that are cleared or left in indeterminate 
states as a result of a power failure or a reboot.  This flag is in the pflag field for 
historical reasons.  This field is now derived from the VOLATILE flag from the 
underlying disk. 
 - SD_PFLAG_STALE 
 - If set, a disk replacement or a temporary disk failure caused the subdisk contents to become 
out-of-date, requiring recovery of the subdisk from any other available source.  
This flag remains set until cleared by sd_change. 
 - SD_PFLAG_KDETACH 
 - If set, then the kernel detached the subdisk as a result of an I/O failure.  This flag remains 
set until cleared by sd_change. 
 
 - v_update_tid 
 - The transaction ID of the last update to this record.  This field is assigned when changes to a disk 
group are committed. 
 - sd_dm_offset 
 - The offset into the underlying disk device from the start of the public region to the start of the 
subdisk.  This is set on creation of the subdisk and cannot be changed afterwards.  This 
value is in sectors. 
 - sd_dev_offset 
 - The offset into the underlying disk device from the start of the partition containing the public region 
to the start of the subdisk. This can differ from the value in sd_dm_offset if the public 
region does not start at the beginning of its partition. 
 - sd_pl_offset 
 - The association offset of the subdisk within its associated plex. This is a read-only field that is set 
automatically when a subdisk is associated.  This value is in sectors. 
 - sd_len 
 - The length of the subdisk.  The subdisk length cannot be changed while the subdisk is associated.  
This value is in sectors. 
 - sd_plex_rid 
 - The record ID of the associated plex, or zero if the subdisk is not associated with a plex. 
 - sd_dm_rid 
 - The record ID of the disk media record that the disk is defined on. 
 - sd_tutil 
 - An array of three null-terminated strings that can be used as scratch pads by utilities.  These fields 
are cleared on reboot.  By convention, the first field is reserved for usage types; the second 
field for higher-level applications, such as OA&M scripts and the VERITAS Visual 
Administrator; and the third field for local site administrators. 
 - sd_dev 
 - The device node for the block device on which the subdisk resides. This is the value that would be 
returned in the st_rdev field from a stat() of the block device containing the subdisk.  This 
is set to NODEV if the disk media record is in the REMOVED or NODAREC state.  This 
is a read-only field. 
 - sd_lock 
 - A boolean value that is 1 if the subdisk is locked in the caller's current transaction, and 0 otherwise.  
This is a read-only field. 
 - sd_tflag 
 - A bitmask of flags that is cleared after a reboot.  Flags defined in this field are: 
- VK_OPEN 
 - The subdisk is associated with a plex or volume whose corresponding device node has been 
opened or mounted.  This flag is maintained by the kernel. 
 - V_TFLAG_IS_LOG 
 - This flag is set by the kernel or by vxconfigd to indicate that the subdisk is associated with 
a plex as a log subdisk.  This is a read-only flag. 
 - V_TFLAG_WRITEONLY 
 - If set, only the write operations can be directed to the plex. 
 - V_TFLAG_DETACH 
 - If set, the subdisk is detached from plex or RAID. 
 - V_TFLAG_DIRTY 
 - If set, the subdisk has been written. 
 - V_TFLAG_ENABLED 
 - If set, the subdisk is enabled. 
 - V_TFLAG_DEVOPEN 
 - If set, there is a device node open on the subdisk. 
 - V_TFLAG_REMOVED 
 - If set, the disk that the subdisk is defined on is in the removed state. 
 - V_TFLAG_NODAREC 
 - If set, the disk that the subdisk is defined on is in the NODAREC state. 
 
 - sd_da_name 
 - The disk access record name used to access the physical disk media underlying the subdisk.  This is 
empty if the disk media record is in the REMOVED or NODAREC state. 
 - sd_dm_name 
 - The name of the underlying disk media record. 
 - sd_device_tag 
 - The the da_device_tag field from the underlying disk access record, or empty of the disk media 
record is in the REMOVED or NODAREC state. 
 
 References
vxintro(ADM),
plexrec(F),
volmake(F)
 
Copyright © 2005 The SCO Group, Inc. All rights reserved.