aboutsummaryrefslogtreecommitdiffstats
path: root/fs/partitions/ultrix.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /fs/partitions/ultrix.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'fs/partitions/ultrix.c')
-rw-r--r--fs/partitions/ultrix.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/fs/partitions/ultrix.c b/fs/partitions/ultrix.c
new file mode 100644
index 000000000000..8a8d4d9db314
--- /dev/null
+++ b/fs/partitions/ultrix.c
@@ -0,0 +1,47 @@
1/*
2 * fs/partitions/ultrix.c
3 *
4 * Code extracted from drivers/block/genhd.c
5 *
6 * Re-organised Jul 1999 Russell King
7 */
8
9#include "check.h"
10
11int ultrix_partition(struct parsed_partitions *state, struct block_device *bdev)
12{
13 int i;
14 Sector sect;
15 unsigned char *data;
16 struct ultrix_disklabel {
17 s32 pt_magic; /* magic no. indicating part. info exits */
18 s32 pt_valid; /* set by driver if pt is current */
19 struct pt_info {
20 s32 pi_nblocks; /* no. of sectors */
21 u32 pi_blkoff; /* block offset for start */
22 } pt_part[8];
23 } *label;
24
25#define PT_MAGIC 0x032957 /* Partition magic number */
26#define PT_VALID 1 /* Indicates if struct is valid */
27
28 data = read_dev_sector(bdev, (16384 - sizeof(*label))/512, &sect);
29 if (!data)
30 return -1;
31
32 label = (struct ultrix_disklabel *)(data + 512 - sizeof(*label));
33
34 if (label->pt_magic == PT_MAGIC && label->pt_valid == PT_VALID) {
35 for (i=0; i<8; i++)
36 if (label->pt_part[i].pi_nblocks)
37 put_partition(state, i+1,
38 label->pt_part[i].pi_blkoff,
39 label->pt_part[i].pi_nblocks);
40 put_dev_sector(sect);
41 printk ("\n");
42 return 1;
43 } else {
44 put_dev_sector(sect);
45 return 0;
46 }
47}