probe-volume.c (b96e88d7) | probe-volume.c (422ee277) |
---|---|
1/*************************************************************************** 2 * 3 * probe-volume.c : probe volumes 4 * 5 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 6 * Use is subject to license terms. 7 * 8 * Licensed under the Academic Free License version 2.1 --- 427 unchanged lines hidden (view full) --- 436 char *partition_scheme = NULL; 437 dbus_uint64_t partition_start = 0; 438 int partition_number = 0; 439 struct vtoc vtoc; 440 dk_gpt_t *gpt; 441 struct dk_minfo mi; 442 int i, dos_cnt; 443 fstyp_handle_t fstyp_handle; | 1/*************************************************************************** 2 * 3 * probe-volume.c : probe volumes 4 * 5 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 6 * Use is subject to license terms. 7 * 8 * Licensed under the Academic Free License version 2.1 --- 427 unchanged lines hidden (view full) --- 436 char *partition_scheme = NULL; 437 dbus_uint64_t partition_start = 0; 438 int partition_number = 0; 439 struct vtoc vtoc; 440 dk_gpt_t *gpt; 441 struct dk_minfo mi; 442 int i, dos_cnt; 443 fstyp_handle_t fstyp_handle; |
444 int systid, relsect, numsect; | |
445 off_t probe_offset = 0; 446 int num_volumes; 447 char **volumes; 448 dbus_uint64_t v_start; 449 const char *fstype; 450 nvlist_t *fsattr; 451 452 fd = rfd = -1; --- 4 unchanged lines hidden (view full) --- 457 goto out; 458 } 459 if ((device_file = getenv ("HAL_PROP_BLOCK_DEVICE")) == NULL) { 460 goto out; 461 } 462 if ((raw_device_file = getenv ("HAL_PROP_BLOCK_SOLARIS_RAW_DEVICE")) == NULL) { 463 goto out; 464 } | 444 off_t probe_offset = 0; 445 int num_volumes; 446 char **volumes; 447 dbus_uint64_t v_start; 448 const char *fstype; 449 nvlist_t *fsattr; 450 451 fd = rfd = -1; --- 4 unchanged lines hidden (view full) --- 456 goto out; 457 } 458 if ((device_file = getenv ("HAL_PROP_BLOCK_DEVICE")) == NULL) { 459 goto out; 460 } 461 if ((raw_device_file = getenv ("HAL_PROP_BLOCK_SOLARIS_RAW_DEVICE")) == NULL) { 462 goto out; 463 } |
465 if (!dos_to_dev(device_file, &rdevpath, &dos_num)) { | 464 if (!dos_to_dev(raw_device_file, &rdevpath, &dos_num)) { |
466 rdevpath = raw_device_file; 467 } 468 if (!(is_dos = dos_to_dev(device_file, &devpath, &dos_num))) { 469 devpath = device_file; 470 } 471 if ((parent_udi = getenv ("HAL_PROP_INFO_PARENT")) == NULL) { 472 goto out; 473 } --- 72 unchanged lines hidden (view full) --- 546 goto skip_part; 547 } 548 549 /* 550 * first get partitioning info 551 */ 552 if (is_dos) { 553 /* for a dos drive find partition offset */ | 465 rdevpath = raw_device_file; 466 } 467 if (!(is_dos = dos_to_dev(device_file, &devpath, &dos_num))) { 468 devpath = device_file; 469 } 470 if ((parent_udi = getenv ("HAL_PROP_INFO_PARENT")) == NULL) { 471 goto out; 472 } --- 72 unchanged lines hidden (view full) --- 545 goto skip_part; 546 } 547 548 /* 549 * first get partitioning info 550 */ 551 if (is_dos) { 552 /* for a dos drive find partition offset */ |
554 if (!find_dos_drive(fd, dos_num, &relsect, &numsect, &systid)) { | 553 if (!find_dos_drive(fd, dos_num, block_size, &probe_offset)) { |
555 goto out; 556 } 557 partition_scheme = "mbr"; | 554 goto out; 555 } 556 partition_scheme = "mbr"; |
558 partition_start = (dbus_uint64_t)relsect * 512; | 557 partition_start = (dbus_uint64_t)probe_offset; |
559 partition_number = dos_num; | 558 partition_number = dos_num; |
560 probe_offset = (off_t)relsect * 512; | |
561 } else { 562 if ((partition_number = read_vtoc(rfd, &vtoc)) >= 0) { 563 if (!vtoc_one_slice_entire_disk(&vtoc)) { 564 partition_scheme = "smi"; 565 if (partition_number < vtoc.v_nparts) { 566 if (vtoc.v_part[partition_number].p_size == 0) { 567 HAL_DEBUG (("zero size partition")); 568 } --- 103 unchanged lines hidden --- | 559 } else { 560 if ((partition_number = read_vtoc(rfd, &vtoc)) >= 0) { 561 if (!vtoc_one_slice_entire_disk(&vtoc)) { 562 partition_scheme = "smi"; 563 if (partition_number < vtoc.v_nparts) { 564 if (vtoc.v_part[partition_number].p_size == 0) { 565 HAL_DEBUG (("zero size partition")); 566 } --- 103 unchanged lines hidden --- |