📄 dpartcbio.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/dpartCbio.html - generated by refgen from dpartCbio.c --> <title> dpartCbio </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.htm"><i>VxWorks API Reference : OS Libraries</i></a></p></blockquote><h1>dpartCbio</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>dpartCbio</strong> - generic disk partition manager </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./dpartCbio.html#dpartDevCreate">dpartDevCreate</a>( )</b> - Initialize a partitioned disk<br><b><a href="./dpartCbio.html#dpartPartGet">dpartPartGet</a>( )</b> - retrieve handle for a partition<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p><p>This module implements a generic partition manager using the CBIOAPI (see <b><a href="./cbioLib.html#top">cbioLib</a></b>) It supports creating a separate file system device for each of its partitions.<p>This partition manager depends upon an external library to decode aparticular disk partition table format, and report the resultingpartition layout information back to this module. This module isresponsible for maintaining the partition logic during operation.<p>When using this module with the dcacheCbio module, it is recommenedthis module be the master CBIO device. This module should be above the cache CBIO module layer. This is because the cache layer is optimized to fuction efficently atop a single physical disk drive.One should call dcacheDevCreate before dpartDevCreate.<p>An implementation of the de-facto standard partition table formatwhich is created by the MSDOS FDISK program is provided with the<b><a href="./usrFdiskPartLib.html#top">usrFdiskPartLib</a></b> module, which should be used to handle PC-stylepartitioned hard or removable drives.<p></blockquote><h4>EXAMPLE</h4><blockquote><p>The following code will initialize a disk which is expected to have upto 4 partitions:<pre> usrPartDiskFsInit( BLK_DEV * blkDevId ) { const char * devNames[] = { "/sd0a", "/sd0b", "/sd0c", "/sd0d" }; CBIO_DEV_ID cbioCache; CBIO_DEV_ID cbioParts; /* create a disk cache atop the entire BLK_DEV */ cbioCache = dcacheDevCreate ( blkDevId, NULL, 0, "/sd0" ); if (NULL == cbioCache) { return (ERROR); } /* create a partition manager with a FDISK style decoder */ cbioParts = dpartDevCreate( cbioCache, 4, usrFdiskPartRead ); if (NULL == cbioParts) { return (ERROR); } /* create file systems atop each partition */ dosFsDevCreate( devNames[0], dpartPartGet(cbioParts,0), 0x10, NONE); dosFsDevCreate( devNames[1], dpartPartGet(cbioParts,1), 0x10, NONE); dosFsDevCreate( devNames[2], dpartPartGet(cbioParts,2), 0x10, NONE); dosFsDevCreate( devNames[3], dpartPartGet(cbioParts,3), 0x10, NONE); }</pre>Because this module complies with the CBIO programming interface on both its upper and lower layers, it is both an optional and a stackable module.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><p><b>dcacheLib</b>, <b><a href="./dosFsLib.html#top">dosFsLib</a></b>, <b><a href="./usrFdiskPartLib.html#top">usrFdiskPartLib</a></b><p><hr><a name="dpartDevCreate"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>dpartDevCreate( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>dpartDevCreate( )</strong> - Initialize a partitioned disk</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>CBIO_DEV_ID dpartDevCreate ( CBIO_DEV_ID subDev, /* lower level CBIO device */ int nPart, /* # of partitions */ FUNCPTR pPartDecodeFunc /* function to decode partition table */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>To handle a partitioned disk, this function should be called,with <i>subDev</i> as the handle returned from <b><a href="./dcacheCbio.html#dcacheDevCreate">dcacheDevCreate</a>( )</b>,It is recommended that for efficient operation a single disk cachebe allocated for the entire disk and shared by its partitions.<p><i>nPart</i> is the maximum number of partitions which are expectedfor the particular disk drive. Up to 24 (C-Z) partitions per disk are supported.<p></blockquote><h4>PARTITION DECODE FUNCTION</h4><blockquote><p>An external partition table decode function is provided via the<i>pPartDecodeFunc</i> argument, which implements a particular style andformat of partition tables, and fill in the results into a tabledefined as Pn array of <b>PART_TABLE_ENTRY</b> types. See <b>dpartCbio.h</b>for definition of <b>PART_TABLE_ENTRY</b>.The prototype for this function is as follows:<p><pre> STATUS parDecodeFunc ( CBIO_DEV_ID dev, /* device from which to read blocks */ PART_TABLE_ENTRY *pPartTab, /* table where to fill results */ int nPart /* # of entries in <pPartTable> */ )</pre></blockquote><h4>RETURNS</h4><blockquote><p><b>CBIO_DEV_ID</b> or NULL if error creating CBIO device.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dpartCbio.html#top">dpartCbio</a></b>, <b><a href="./dosFsLib.html#dosFsDevCreate">dosFsDevCreate</a>( )</b>.<b>INTERNAL</b>during create, readyChanged bit is TRUE, so no accesses are alloweduntil after a <b>CBIO_RESET</b>, at which time the actual partition tablewill be brought in and applied.<hr><a name="dpartPartGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>dpartPartGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>dpartPartGet( )</strong> - retrieve handle for a partition</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>CBIO_DEV_ID dpartPartGet ( CBIO_DEV_ID masterHandle, /* CBIO handle of the master partition */ int partNum /* partition number from 0 to nPart */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function retrieves a CBIO handle into a particular partitionof a partitioned device. This handle is intended to be used with<b><a href="./dosFsLib.html#dosFsDevCreate">dosFsDevCreate</a>( )</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p><b>CBIO_DEV_ID</b> or NULL if partition is out of range, or<i>masterHandle</i> is invalid.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dpartCbio.html#top">dpartCbio</a></b>, <b><a href="./dosFsLib.html#dosFsDevCreate">dosFsDevCreate</a>( )</b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -