Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
ldm.h File Reference
#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)
 

Macro Definition Documentation

#define COMP_BASIC   0x02 /* Basic disk */

Definition at line 75 of file ldm.h.

#define COMP_RAID   0x03 /* Raid-set */

Definition at line 76 of file ldm.h.

#define COMP_STRIPE   0x01 /* Stripe-set */

Definition at line 74 of file ldm.h.

#define GUID_SIZE   16

Definition at line 113 of file ldm.h.

#define LDM_DB_SIZE   2048 /* Size in sectors (= 1MiB). */

Definition at line 79 of file ldm.h.

#define LDM_PARTITION   0x42 /* Formerly SFS (Landis). */

Definition at line 94 of file ldm.h.

#define MAGIC_PRIVHEAD   0x5052495648454144ULL /* PRIVHEAD */

Definition at line 41 of file ldm.h.

#define MAGIC_TOCBLOCK   0x544F43424C4F434BULL /* TOCBLOCK */

Definition at line 42 of file ldm.h.

#define MAGIC_VBLK   0x56424C4B /* VBLK */

Definition at line 40 of file ldm.h.

#define MAGIC_VMDB   0x564D4442 /* VMDB */

Definition at line 39 of file ldm.h.

#define OFF_PRIV1
Value:
6 /* Offset of the first privhead
relative to the start of the
device in sectors */

Definition at line 81 of file ldm.h.

#define OFF_PRIV2   1856 /* Backup private headers. */

Definition at line 84 of file ldm.h.

#define OFF_PRIV3   2047

Definition at line 85 of file ldm.h.

#define OFF_TOCB1   1 /* Tables of contents. */

Definition at line 87 of file ldm.h.

#define OFF_TOCB2   2

Definition at line 88 of file ldm.h.

#define OFF_TOCB3   2045

Definition at line 89 of file ldm.h.

#define OFF_TOCB4   2046

Definition at line 90 of file ldm.h.

#define OFF_VMDB   17 /* List of partitions. */

Definition at line 92 of file ldm.h.

#define SYS_IND (   p)    (get_unaligned(&(p)->sys_ind))

Definition at line 100 of file ldm.h.

#define TOC_BITMAP1   "config" /* Names of the two defined */

Definition at line 96 of file ldm.h.

#define TOC_BITMAP2   "log" /* bitmaps in the TOCBLOCK. */

Definition at line 97 of file ldm.h.

#define VBLK_CMP3   0x32 /* Component, version 3 */

Definition at line 46 of file ldm.h.

#define VBLK_DGR3   0x35 /* Disk Group, version 3 */

Definition at line 50 of file ldm.h.

#define VBLK_DGR4   0x45 /* Disk Group, version 4 */

Definition at line 51 of file ldm.h.

#define VBLK_DSK3   0x34 /* Disk, version 3 */

Definition at line 48 of file ldm.h.

#define VBLK_DSK4   0x44 /* Disk, version 4 */

Definition at line 49 of file ldm.h.

#define VBLK_FLAG_COMP_STRIPE   0x10

Definition at line 54 of file ldm.h.

#define VBLK_FLAG_DGR3_IDS   0x08

Definition at line 56 of file ldm.h.

#define VBLK_FLAG_DGR4_IDS   0x08

Definition at line 57 of file ldm.h.

#define VBLK_FLAG_PART_INDEX   0x08

Definition at line 55 of file ldm.h.

#define VBLK_FLAG_VOLU_DRIVE   0x02

Definition at line 61 of file ldm.h.

#define VBLK_FLAG_VOLU_ID1   0x08

Definition at line 58 of file ldm.h.

#define VBLK_FLAG_VOLU_ID2   0x20

Definition at line 59 of file ldm.h.

#define VBLK_FLAG_VOLU_SIZE   0x80

Definition at line 60 of file ldm.h.

#define VBLK_PRT3   0x33 /* Partition, version 3 */

Definition at line 47 of file ldm.h.

#define VBLK_SIZE_CMP3   22 /* Name and version */

Definition at line 65 of file ldm.h.

#define VBLK_SIZE_DGR3   12

Definition at line 66 of file ldm.h.

#define VBLK_SIZE_DGR4   44

Definition at line 67 of file ldm.h.

#define VBLK_SIZE_DSK3   12

Definition at line 68 of file ldm.h.

#define VBLK_SIZE_DSK4   45

Definition at line 69 of file ldm.h.

#define VBLK_SIZE_HEAD   16

Definition at line 64 of file ldm.h.

#define VBLK_SIZE_PRT3   28

Definition at line 70 of file ldm.h.

#define VBLK_SIZE_VOL5   58

Definition at line 71 of file ldm.h.

#define VBLK_VOL5   0x51 /* Volume, version 5 */

Definition at line 45 of file ldm.h.

Function Documentation

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

Definition at line 1509 of file ldm.c.