Linux Kernel
3.7.1
|
#include <linux/types.h>
#include <linux/list.h>
#include <linux/genhd.h>
#include <linux/fs.h>
#include <asm/unaligned.h>
#include <asm/byteorder.h>
Go to the source code of this file.
Data Structures | |
struct | frag |
struct | privhead |
struct | tocblock |
struct | vmdb |
struct | vblk_comp |
struct | vblk_dgrp |
struct | vblk_disk |
struct | vblk_part |
struct | vblk_volu |
struct | vblk_head |
struct | vblk |
struct | ldmdb |
Macros | |
#define | MAGIC_VMDB 0x564D4442 /* VMDB */ |
#define | MAGIC_VBLK 0x56424C4B /* VBLK */ |
#define | MAGIC_PRIVHEAD 0x5052495648454144ULL /* PRIVHEAD */ |
#define | MAGIC_TOCBLOCK 0x544F43424C4F434BULL /* TOCBLOCK */ |
#define | VBLK_VOL5 0x51 /* Volume, version 5 */ |
#define | VBLK_CMP3 0x32 /* Component, version 3 */ |
#define | VBLK_PRT3 0x33 /* Partition, version 3 */ |
#define | VBLK_DSK3 0x34 /* Disk, version 3 */ |
#define | VBLK_DSK4 0x44 /* Disk, version 4 */ |
#define | VBLK_DGR3 0x35 /* Disk Group, version 3 */ |
#define | VBLK_DGR4 0x45 /* Disk Group, version 4 */ |
#define | VBLK_FLAG_COMP_STRIPE 0x10 |
#define | VBLK_FLAG_PART_INDEX 0x08 |
#define | VBLK_FLAG_DGR3_IDS 0x08 |
#define | VBLK_FLAG_DGR4_IDS 0x08 |
#define | VBLK_FLAG_VOLU_ID1 0x08 |
#define | VBLK_FLAG_VOLU_ID2 0x20 |
#define | VBLK_FLAG_VOLU_SIZE 0x80 |
#define | VBLK_FLAG_VOLU_DRIVE 0x02 |
#define | VBLK_SIZE_HEAD 16 |
#define | VBLK_SIZE_CMP3 22 /* Name and version */ |
#define | VBLK_SIZE_DGR3 12 |
#define | VBLK_SIZE_DGR4 44 |
#define | VBLK_SIZE_DSK3 12 |
#define | VBLK_SIZE_DSK4 45 |
#define | VBLK_SIZE_PRT3 28 |
#define | VBLK_SIZE_VOL5 58 |
#define | COMP_STRIPE 0x01 /* Stripe-set */ |
#define | COMP_BASIC 0x02 /* Basic disk */ |
#define | COMP_RAID 0x03 /* Raid-set */ |
#define | LDM_DB_SIZE 2048 /* Size in sectors (= 1MiB). */ |
#define | OFF_PRIV1 |
#define | OFF_PRIV2 1856 /* Backup private headers. */ |
#define | OFF_PRIV3 2047 |
#define | OFF_TOCB1 1 /* Tables of contents. */ |
#define | OFF_TOCB2 2 |
#define | OFF_TOCB3 2045 |
#define | OFF_TOCB4 2046 |
#define | OFF_VMDB 17 /* List of partitions. */ |
#define | LDM_PARTITION 0x42 /* Formerly SFS (Landis). */ |
#define | TOC_BITMAP1 "config" /* Names of the two defined */ |
#define | TOC_BITMAP2 "log" /* bitmaps in the TOCBLOCK. */ |
#define | SYS_IND(p) (get_unaligned(&(p)->sys_ind)) |
#define | GUID_SIZE 16 |
Functions | |
int | ldm_partition (struct parsed_partitions *state) |
#define OFF_PRIV1 |
#define SYS_IND | ( | p | ) | (get_unaligned(&(p)->sys_ind)) |
int ldm_partition | ( | struct parsed_partitions * | state | ) |
ldm_partition - Find out whether a device is a dynamic disk and handle it : Partition check state including device holding the LDM Database
This determines whether the device is a dynamic disk and if so creates the partitions necessary in the gendisk structure pointed to by .
We create a dummy device 1, which contains the LDM database, and then create each partition described by the LDM database in sequence as devices 2+. For example, if the device is hda, we would have: hda1: LDM database, hda2, hda3, and so on: the actual data containing partitions.
Return: 1 Success, ->bdev is a dynamic disk and we handled it 0 Success, ->bdev is not a dynamic disk -1 An error occurred before enough information had been read Or ->bdev is a dynamic disk, but it may be corrupted