Extended Partition Support » Slice Modification Design Notes
en

Slice Modification Design Notes

This is a comparision of the functionality we have for slices vs partitions:

- om_get_disk_partition_info(handle, diskname) - returns the partition information of the specified disk.
- om_get_slice_info(handle, *diskname) -  will return the disk slices (VTOC) information of the specified disk.

- om_free_disk_partition_info(handle, *dpinfo) - This function will free up the disk information data allocated during om_get_disk_partition_info().
- om_free_disk_slice_info(handle, *disk_slices_t) - will free up the disk information data allocated during om_get_slice_info()

- om_duplicate_disk_partition_info(handle, *disk_parts_t) -  This function will allocate space and copy the disk_parts_t structure
- om_duplicate_slice_info(handle, *disk_slices_t) - allocates space and copy the disk_slices_t structure passed as a parameter.

- om_set_disk_partition_info(handle, *disk_parts_t ) - This function will save the disk partition information passed by the caller and use it for creating disk partitions during install.  This function should be used in conjunction with om_perform_install. If om_perform_install is not called, no changes in the disk will be made.
- om_set_slice_info(handle, *disk_slices_t) - will save the slice information passed by the caller and use it for creating slices during install. This function should be used in conjunction with om_perform_install

- om_create_partition(partition_type, partition_offset_sec, partition_size_sec, use_entire_disk) -  create a new partition
- om_create_slice(slice_id, slice_size, is_root) = create slice given unique slice ID

- om_delete_partition(partition_id, partition_offset_sec, partition_size_sec) - delete an existing partition
- om_delete_slice(slice_id) - delete slice by unique slice ID

- om_finalize_fdisk_info_for_TI() - write out partition table containing edits.
- om_finalize_vtoc_for_TI(slice_id) -  when slice editing is finished, finalize

- om_init_disk_partition_info(*disk_info_t) - set disk partition info initially for no partitions
- om_init_slice_info(disk_name) - set slice info initially for no slices

- om_set_fdisk_target_attrs(*nvlist, diskname) -  sets the appropriate fdisk attributes for target instantiation.
- om_set_vtoc_target_attrs(*nvlist_t, diskname) - create attribute list for new vtoc target_attrs.

partitions only:
om_validate_and_resize_disk_partitions(handle, *disk_parts_t, partition_allocation_scheme) -  This function will check whether the the partition information of the specified disk is valid.
om_create_target_partition_info_if_absent() - initialize a target disk partition struct if not yet initialized

slices only:
om_preserve_slice(slice_id) -  protect slice given unique slice ID
om_get_device_target_info(slice_id, disk_name) -  return device target info
om_invalidate_slice_info() - ignore slice info from TD

What we need for slices:
Something to validate and resize similar to what the partitioning code has.

What does validation for slices look like?

 Total of all slices > disk size

 Has anything changed? resized, deleted?

 See format/modify/_partition.c check/_map()
        - starting cylinder out of range
        - specified # of blocks is out of range
        - overlapping slice in table
        - non-contiguous slice
        - total blocks used is greater than blocks in slice.

 From om_finalize_vtoc_for_TI()
        - check for preserved slices, remove all others if there are.
        - create a swap slice if necessary

We will want to create a function:

disk_slices_t om_validate_and_resize_disk_slices(handle, disk_slices_t dslice)
{

       Check for disk discovery done

        Check for system_disks existence

        check for disk_name != NULL

        Find the disk_target_t via from disk name

        Create duplicate disk_slice_t structure

        Validation from above.

}

om_finalize_vtoc_for_TI should be modified to call om_validate_and_resize_disk_slices instead of doing validation itself. The validation that is currently there, should be moved into the validate function if applicable.
Consider doing something like is done for partition code where there is code specific to GUI and some specific to TI.

Tags:
Created by admin on 2009/10/26 12:12
Last modified by admin on 2009/10/26 12:12

Collectives

Project caiman Pages


XWiki Enterprise 2.7.1.34853 - Documentation