Changes by: flatcap
Update of /cvsroot/linux-ntfs/dynamic-disk/linux/fs/partitions
In directory usw-pr-cvs1:/tmp/cvs-serv23747/linux/fs/partitions
Modified Files:
ldm.c ldm.h
Log Message:
more trivial stuff
Index: ldm.c
===================================================================
RCS file: /cvsroot/linux-ntfs/dynamic-disk/linux/fs/partitions/ldm.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -U2 -r1.77 -r1.78
--- ldm.c 17 Jun 2002 01:28:57 -0000 1.77
+++ ldm.c 20 Jun 2002 18:04:51 -0000 1.78
@@ -27,5 +27,5 @@
#include <linux/slab.h>
#include <linux/pagemap.h>
-//#include <linux/stringify.h>
+#include <linux/stringify.h>
#include "ldm.h"
#include "check.h"
@@ -37,9 +37,9 @@
#ifdef CONFIG_BLK_DEV_MD
-extern void md_autodetect_dev(kdev_t dev);
+extern void md_autodetect_dev (kdev_t dev);
#endif
#ifdef CONFIG_LDM_MD
-extern void ldm_md_addpart(const u8 *dg_guid, u32 objid, u8 comptype,
+extern void ldm_md_addpart (const u8 *dg_guid, u32 objid, u8 comptype,
u8 n, u8 parts, u8 chunk_s, kdev_t dev);
#endif
@@ -87,12 +87,12 @@
__stringify (KBUILD_BASENAME);
#else
- "ldm.c"; // FIXME: __FILE__ is to verbose.
+ "ldm.c"; // FIXME: __FILE__ is too verbose.
#endif
- va_start(args, fmt);
- vsnprintf(buf, sizeof(buf), fmt, args);
- va_end(args);
+ va_start (args, fmt);
+ vsnprintf (buf, sizeof (buf), fmt, args);
+ va_end (args);
- printk("%s (%s, %d) %s(): %s\n", prefix[level], file, line, function,
+ printk ("%s (%s, %d) %s(): %s\n", prefix[level], file, line, function,
buf);
}
@@ -147,5 +147,5 @@
for (j = 0; j < 5; j++, src++)
for (i = 0; i < size[j]; i++, src+=2, *dest++ = v)
- if ((v = ldm_parse_hexbyte(src)) < 0)
+ if ((v = ldm_parse_hexbyte (src)) < 0)
return FALSE;
@@ -314,5 +314,5 @@
(ph1->config_start == ph2->config_start) &&
(ph1->config_size == ph2->config_size) &&
- !memcmp(ph1->disk_id, ph2->disk_id, GUID_SIZE));
+ !memcmp (ph1->disk_id, ph2->disk_id, GUID_SIZE));
}
@@ -336,8 +336,8 @@
(toc1->bitmap2_start == toc2->bitmap2_start) &&
(toc1->bitmap2_size == toc2->bitmap2_size) &&
- !strncmp(toc1->bitmap1_name, toc2->bitmap1_name,
- sizeof(toc1->bitmap1_name)) &&
- !strncmp(toc1->bitmap2_name, toc2->bitmap2_name,
- sizeof(toc1->bitmap2_name)));
+ !strncmp (toc1->bitmap1_name, toc2->bitmap1_name,
+ sizeof (toc1->bitmap1_name)) &&
+ !strncmp (toc1->bitmap2_name, toc2->bitmap2_name,
+ sizeof (toc1->bitmap2_name)));
}
@@ -391,5 +391,5 @@
goto out;
}
- result = ldm_parse_privhead(data, ph[i]);
+ result = ldm_parse_privhead (data, ph[i]);
put_dev_sector (sect);
if (!result) {
@@ -539,5 +539,5 @@
}
- if (!ldm_parse_vmdb(data, vm))
+ if (!ldm_parse_vmdb (data, vm))
goto out; /* Already logged */
@@ -601,5 +601,5 @@
p = (struct partition*)(data + 0x01BE);
for (i = 0; i < 4; i++, p++)
- if (SYS_IND(p) == WIN2K_DYNAMIC_PARTITION) {
+ if (SYS_IND (p) == WIN2K_DYNAMIC_PARTITION) {
result = TRUE;
break;
@@ -611,5 +611,5 @@
ldm_debug ("Found an MS-DOS partition table, not a dynamic disk.");
out:
- put_dev_sector(sect);
+ put_dev_sector (sect);
return result;
}
@@ -636,5 +636,5 @@
}
- ldm_debug("Search for vblk #%llu failed!", (unsigned long long) id);
+ ldm_debug ("Search for vblk #%llu failed!", (unsigned long long) id);
return NULL;
}
@@ -660,5 +660,5 @@
list_for_each (item, &ldb->v_disk) {
struct vblk *v = list_entry (item, struct vblk, list);
- if (!memcmp(v->vblk.disk.disk_id, ldb->ph.disk_id, GUID_SIZE))
+ if (!memcmp (v->vblk.disk.disk_id, ldb->ph.disk_id, GUID_SIZE))
return v;
}
@@ -747,5 +747,5 @@
#ifdef CONFIG_BLK_DEV_MD /* CONFIG_LDM_MD implies CONFIG_BLK_DEV_MD */
struct vblk *v, *c;
- const kdev_t dev = mk_kdev(hd->major, minor);
+ const kdev_t dev = mk_kdev (hd->major, minor);
#endif
vb = list_entry (item, struct vblk, list);
@@ -755,5 +755,5 @@
continue;
- if (!ldm_create_partition(hd, minor,
+ if (!ldm_create_partition (hd, minor,
part->start + ldb->ph.logical_disk_start, part->size))
continue; /* Already logged */
@@ -761,5 +761,5 @@
#ifdef CONFIG_BLK_DEV_MD
/* Try to get parent component */
- c = ldm_find_vblk(&ldb->v_comp, part->parent_id);
+ c = ldm_find_vblk (&ldb->v_comp, part->parent_id);
if (!c) {
ldm_error ("Can't find VBLK's parent (component).");
@@ -768,5 +768,5 @@
/* Try to get parent volume */
- v = ldm_find_vblk(&ldb->v_volu, c->vblk.comp.parent_id);
+ v = ldm_find_vblk (&ldb->v_volu, c->vblk.comp.parent_id);
if (v == NULL) {
ldm_error ("Can't find VBLK's parent (volume).");
@@ -776,10 +776,10 @@
/* Notify md of RAID autodetect part types */
if (v->vblk.volu.partition_type == LINUX_RAID_PARTITION) {
- md_autodetect_dev(dev);
+ md_autodetect_dev (dev);
continue;
}
/* Register to LDM_MD */
#ifdef CONFIG_LDM_MD
- ldm_md_addpart(v->vblk.volu.guid, c->obj_id,
+ ldm_md_addpart (v->vblk.volu.guid, c->obj_id,
c->vblk.comp.type, part->partnum, c->vblk.comp.children,
c->vblk.comp.chunksize / (4096 / 512), dev);
@@ -1292,5 +1292,5 @@
DEBUG_ON (!data || !ldb);
- vb = kmalloc (sizeof(*vb), GFP_KERNEL);
+ vb = kmalloc (sizeof (*vb), GFP_KERNEL);
if (!vb) {
ldm_crit ("Out of memory.");
@@ -1306,27 +1306,27 @@
case VBLK_DGR3:
case VBLK_DGR4:
- list_add(&vb->list, &ldb->v_dgrp);
+ list_add (&vb->list, &ldb->v_dgrp);
break;
case VBLK_DSK3:
case VBLK_DSK4:
- list_add(&vb->list, &ldb->v_disk);
+ list_add (&vb->list, &ldb->v_disk);
break;
case VBLK_VOL5:
- list_add(&vb->list, &ldb->v_volu);
+ list_add (&vb->list, &ldb->v_volu);
break;
case VBLK_CMP3:
- list_add(&vb->list, &ldb->v_comp);
+ list_add (&vb->list, &ldb->v_comp);
break;
case VBLK_PRT3:
/* Sort by the partition's start sector. */
- list_for_each(item, &ldb->v_part) {
- struct vblk *v = list_entry(item, struct vblk, list);
+ list_for_each (item, &ldb->v_part) {
+ struct vblk *v = list_entry (item, struct vblk, list);
if ((v->vblk.part.disk_id == vb->vblk.part.disk_id) &&
(v->vblk.part.start > vb->vblk.part.start)) {
- list_add_tail(&vb->list, &v->list);
+ list_add_tail (&vb->list, &v->list);
return TRUE;
}
}
- list_add_tail(&vb->list, &ldb->v_part);
+ list_add_tail (&vb->list, &ldb->v_part);
break;
}
@@ -1362,6 +1362,6 @@
}
- list_for_each(item, frags) {
- f = list_entry(item, struct frag, list);
+ list_for_each (item, frags) {
+ f = list_entry (item, struct frag, list);
if (f->group == group)
goto found;
@@ -1379,5 +1379,5 @@
f->map = 0xFF << num;
- list_add_tail(&f->list, frags);
+ list_add_tail (&f->list, frags);
found:
if (f->map & (1 << rec)) {
@@ -1412,6 +1412,6 @@
DEBUG_ON (!list);
- list_for_each_safe(item, tmp, list)
- kfree (list_entry(item, struct frag, list));
+ list_for_each_safe (item, tmp, list)
+ kfree (list_entry (item, struct frag, list));
}
@@ -1435,6 +1435,6 @@
DEBUG_ON (!frags || !ldb);
- list_for_each(item, frags) {
- f = list_entry(item, struct frag, list);
+ list_for_each (item, frags) {
+ f = list_entry (item, struct frag, list);
if (f->map != 0xFF) {
@@ -1464,5 +1464,5 @@
* FALSE An error occurred
*/
-static BOOL ldm_get_vblks(struct block_device *bdev, unsigned long base, struct ldmdb *ldb)
+static BOOL ldm_get_vblks (struct block_device *bdev, unsigned long base, struct ldmdb *ldb)
{
int size, perbuf, skip, finish, s, v, recs;
@@ -1470,5 +1470,5 @@
Sector sect;
BOOL result = FALSE;
- LIST_HEAD(frags);
+ LIST_HEAD (frags);
DEBUG_ON (!bdev || !ldb);
@@ -1502,5 +1502,5 @@
/* else Record is not in use, ignore it. */
}
- put_dev_sector(sect);
+ put_dev_sector (sect);
data = NULL;
}
@@ -1509,5 +1509,5 @@
out:
if (data)
- put_dev_sector(sect);
+ put_dev_sector (sect);
ldm_frag_free (&frags);
@@ -1586,9 +1586,9 @@
/* Initialize vblk lists in ldmdb struct */
- INIT_LIST_HEAD(&ldb->v_dgrp);
- INIT_LIST_HEAD(&ldb->v_disk);
- INIT_LIST_HEAD(&ldb->v_volu);
- INIT_LIST_HEAD(&ldb->v_comp);
- INIT_LIST_HEAD(&ldb->v_part);
+ INIT_LIST_HEAD (&ldb->v_dgrp);
+ INIT_LIST_HEAD (&ldb->v_disk);
+ INIT_LIST_HEAD (&ldb->v_volu);
+ INIT_LIST_HEAD (&ldb->v_comp);
+ INIT_LIST_HEAD (&ldb->v_part);
if (!ldm_get_vblks (bdev, base, ldb)) {
@@ -1605,9 +1605,9 @@
cleanup:
- ldm_free_vblks(&ldb->v_dgrp);
- ldm_free_vblks(&ldb->v_disk);
- ldm_free_vblks(&ldb->v_volu);
- ldm_free_vblks(&ldb->v_comp);
- ldm_free_vblks(&ldb->v_part);
+ ldm_free_vblks (&ldb->v_dgrp);
+ ldm_free_vblks (&ldb->v_disk);
+ ldm_free_vblks (&ldb->v_volu);
+ ldm_free_vblks (&ldb->v_comp);
+ ldm_free_vblks (&ldb->v_part);
out:
kfree (ldb);
Index: ldm.h
===================================================================
RCS file: /cvsroot/linux-ntfs/dynamic-disk/linux/fs/partitions/ldm.h,v
retrieving revision 1.47
retrieving revision 1.48
diff -U2 -r1.47 -r1.48
--- ldm.h 17 Jun 2002 01:28:57 -0000 1.47
+++ ldm.h 20 Jun 2002 18:04:52 -0000 1.48
@@ -28,5 +28,7 @@
#include <linux/types.h>
+#include <linux/list.h>
#include <linux/genhd.h>
+#include <linux/fs.h>
#include <asm/unaligned.h>
#include <asm/byteorder.h>
@@ -97,5 +99,5 @@
#define OFF_VMDB 17 /* List of partitions. */
-#define WIN2K_DYNAMIC_PARTITION 0x42 /* Formerly SFS (Landis). */
+#define WIN2K_DYNAMIC_PARTITION 0x42 /* Formerly SFS (Landis). */
#define TOC_BITMAP1 "config" /* Names of the two defined */
@@ -107,14 +109,13 @@
#define BE64(x) ((u64)be64_to_cpu(get_unaligned((u64*)(x))))
-/* Borrowed from msdos.c. */
-#define SYS_IND(p) (get_unaligned(&p->sys_ind))
+/* Borrowed from msdos.c */
+#define SYS_IND(p) (get_unaligned(&(p)->sys_ind))
-/* VBLK Fragment handling */
-struct frag {
+struct frag { /* VBLK Fragment handling */
struct list_head list;
u32 group;
- u8 num; /* Total number of records */
- u8 rec; /* This is record number n */
- u8 map; /* Which portions are in use */
+ u8 num; /* Total number of records */
+ u8 rec; /* This is record number n */
+ u8 map; /* Which portions are in use */
u8 data[0];
};
@@ -143,5 +144,5 @@
};
-struct vmdb {
+struct vmdb { /* VMDB: The database header */
u16 ver_major;
u16 ver_minor;
@@ -151,5 +152,5 @@
};
-struct vblk_comp {
+struct vblk_comp { /* VBLK Component */
u8 state[16];
u64 parent_id;
@@ -159,16 +160,16 @@
};
-struct vblk_dgrp {
+struct vblk_dgrp { /* VBLK Disk Group */
u8 disk_id[64];
};
-struct vblk_disk {
+struct vblk_disk { /* VBLK Disk */
u8 disk_id[GUID_SIZE];
u8 alt_name[128];
};
-struct vblk_part { /* start, size and vol_off in sectors */
+struct vblk_part { /* VBLK Partition */
u64 start;
- u64 size;
+ u64 size; /* start, size and vol_off in sectors */
u64 volume_offset;
u64 parent_id;
@@ -177,5 +178,5 @@
};
-struct vblk_volu {
+struct vblk_volu { /* VBLK Volume */
u8 volume_type[16];
u8 volume_state[16];
@@ -186,5 +187,5 @@
};
-struct vblk_head {
+struct vblk_head { /* VBLK standard header */
u32 group;
u16 rec;
@@ -192,5 +193,5 @@
};
-struct vblk {
+struct vblk { /* Generalised VBLK */
u8 name[64];
u64 obj_id;
@@ -208,5 +209,5 @@
};
-struct ldmdb {
+struct ldmdb { /* Cache of the database */
struct privhead ph;
struct tocblock toc;
|