Lines Matching +full:partition +full:-
45 #include "partition.h"
97 * we just get the active solaris partition.
112 if (get_parts(desc->p.disk, iparts, pname, sizeof (pname)) != 0) {
127 if (len > 1 && *(pname + (len - 2)) == 'p') {
129 *(pname + (len - 1)) = 0;
134 * If this is a slice desc. we need the first active solaris partition
135 * and if there isn't one then we need the first solaris partition.
137 if (desc->type == DM_SLICE) {
159 /* we found a solaris partition to use */
173 desc->p.disk, part_name, desc->secondary_name,
196 * format so that it refers to the fdisk partition
199 * physical disk partition.
212 desc->p.disk, part_name, desc->name, errp);
238 if ((*errp = get_parts(dp->p.disk, iparts, NULL, 0)) != 0) {
256 * Look for the partition by the partition number (which is not too useful).
263 descriptor_t *partition = NULL;
271 if (libdiskmgt_str_eq(name, partitions[i]->name)) {
272 partition = partitions[i];
280 if (partition == NULL) {
284 return (partition);
297 return (desc->name);
316 if (dp->drv_type == DM_DT_FIXED) {
337 * A partition descriptor points to a disk, the name is the partition number
342 * specific partition.
371 if (len > 1 && *(pname + (len - 2)) == 'p') {
373 *(pname + (len - 1)) = 0;
382 * format so that it refers to the fdisk partition
385 * physical disk partition.
393 * convert partition name
413 dp = dp->next;
430 p = strrchr(dp->name, 'p');
432 p = dp->name;
438 iparts[part_num - 1].systid == UNUSED) {
443 * A partition has been found. Determine what type of
444 * partition it is: logical, extended, or primary.
445 * Collect the information for the partition.
453 } else if (fdisk_is_dos_extended(iparts[part_num - 1].systid)) {
476 (unsigned int)iparts[part_num - 1].bootid) != 0) {
481 (unsigned int)iparts[part_num - 1].systid) != 0) {
486 (unsigned int)iparts[part_num - 1].beghead) != 0) {
491 (unsigned int)((iparts[part_num - 1].begsect) & 0x3f)) != 0) {
496 ((iparts[part_num - 1].begcyl & 0xff) |
497 ((iparts[part_num - 1].begsect & 0xc0) << 2))) != 0) {
502 (unsigned int)iparts[part_num - 1].endhead) != 0) {
507 (unsigned int)((iparts[part_num - 1].endsect) & 0x3f)) != 0) {
512 ((iparts[part_num - 1].endcyl & 0xff) |
513 ((iparts[part_num - 1].endsect & 0xc0) << 2))) != 0) {
518 (unsigned int)iparts[part_num - 1].relsect) != 0) {
523 (unsigned int)iparts[part_num - 1].numsect) != 0) {
534 * collects the information on each partition and stores it in a
535 * partition table.
538 * disk -The disk device to be evaluated for partitions
539 * iparts -The structure that holds information about
541 * opath -The device path
542 * opath_len -Buffer size used with opath
559 ext_part_t *epp; /* extended partition structure */
566 /* Can't use drive_open_disk since we need the partition dev name. */
582 if (lseek(fd, 0, 0) == -1) {
611 * Check to see if a valid partition exists. If a valid partition
612 * exists, check to see if it is an extended partition.
613 * If an extended partition exists, collect the logical partition
627 len = strlen(disk->aliases->alias) + 1;
634 (void) snprintf(device, len, "%s", disk->aliases->alias);
642 * there is no Solaris logical partition,
671 log_drv = log_drv->next, j++) {
672 iparts[j].bootid = log_drv->parts[0].bootid;
673 iparts[j].beghead = log_drv->parts[0].beghead;
674 iparts[j].begsect = log_drv->parts[0].begsect;
675 iparts[j].begcyl = log_drv->parts[0].begcyl;
676 iparts[j].systid = log_drv->parts[0].systid;
677 iparts[j].endhead = log_drv->parts[0].endhead;
678 iparts[j].endsect = log_drv->parts[0].endsect;
679 iparts[j].endcyl = log_drv->parts[0].endcyl;
681 lel(log_drv->parts[0].relsect) + epp->ext_beg_sec);
682 iparts[j].numsect = lel(log_drv->parts[0].numsect);
683 tmpsect = lel(log_drv->parts[1].relsect);
695 /* return 1 if the partition descriptor is still valid, 0 if not. */
700 if (dp->p.disk->removable) {
703 if (!media_read_name(dp->p.disk, mname, sizeof (mname))) {
708 return (libdiskmgt_str_eq(dp->secondary_name, NULL));
710 return (libdiskmgt_str_eq(dp->secondary_name, mname));
715 * We could verify the partition is still there but this is kind of
724 * Return 1 if partition has slices, 0 if not.
734 if (get_parts(desc->p.disk, iparts, NULL, 0) != 0) {
739 p = strrchr(desc->name, 'p');
741 p = desc->name;
748 * Slices are associated with the active solaris partition or if there
749 * is no active solaris partition, then the first solaris partition.
771 /* Check if this is the first solaris partition. */
794 if (diskp->aliases != NULL && diskp->aliases->devpaths != NULL) {
797 (void) strlcpy(opath, diskp->aliases->devpaths->devpath, len);
799 return (open(diskp->aliases->devpaths->devpath, O_RDONLY|O_NDELAY));
801 /* On intel we need to open partition device (e.g. c0d0p1). */
805 (void) strlcpy(part_dev, diskp->aliases->devpaths->devpath,
831 return (-1);