-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 54664 b: refs/heads/master c: 19d0e8c h: refs/heads/master v: v3
- Loading branch information
Philippe De Muyter
authored and
Linus Torvalds
committed
May 8, 2007
1 parent
cd9d2b9
commit b3bf2a0
Showing
6 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: e729aa16b168fb202d1a20f936028cb7c2a0278d | ||
refs/heads/master: 19d0e8ce856a7628a630710aed82931ce1c7eb97 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
* fs/partitions/sysv68.c | ||
* | ||
* Copyright (C) 2007 Philippe De Muyter <phdm@macqel.be> | ||
*/ | ||
|
||
#include "check.h" | ||
#include "sysv68.h" | ||
|
||
/* | ||
* Volume ID structure: on first 256-bytes sector of disk | ||
*/ | ||
|
||
struct volumeid { | ||
u8 vid_unused[248]; | ||
u8 vid_mac[8]; /* ASCII string "MOTOROLA" */ | ||
}; | ||
|
||
/* | ||
* config block: second 256-bytes sector on disk | ||
*/ | ||
|
||
struct dkconfig { | ||
u8 ios_unused0[128]; | ||
__be32 ios_slcblk; /* Slice table block number */ | ||
__be16 ios_slccnt; /* Number of entries in slice table */ | ||
u8 ios_unused1[122]; | ||
}; | ||
|
||
/* | ||
* combined volumeid and dkconfig block | ||
*/ | ||
|
||
struct dkblk0 { | ||
struct volumeid dk_vid; | ||
struct dkconfig dk_ios; | ||
}; | ||
|
||
/* | ||
* Slice Table Structure | ||
*/ | ||
|
||
struct slice { | ||
__be32 nblocks; /* slice size (in blocks) */ | ||
__be32 blkoff; /* block offset of slice */ | ||
}; | ||
|
||
|
||
int sysv68_partition(struct parsed_partitions *state, struct block_device *bdev) | ||
{ | ||
int i, slices; | ||
int slot = 1; | ||
Sector sect; | ||
unsigned char *data; | ||
struct dkblk0 *b; | ||
struct slice *slice; | ||
|
||
data = read_dev_sector(bdev, 0, §); | ||
if (!data) | ||
return -1; | ||
|
||
b = (struct dkblk0 *)data; | ||
if (memcmp(b->dk_vid.vid_mac, "MOTOROLA", sizeof(b->dk_vid.vid_mac))) { | ||
put_dev_sector(sect); | ||
return 0; | ||
} | ||
slices = be16_to_cpu(b->dk_ios.ios_slccnt); | ||
i = be32_to_cpu(b->dk_ios.ios_slcblk); | ||
put_dev_sector(sect); | ||
|
||
data = read_dev_sector(bdev, i, §); | ||
if (!data) | ||
return -1; | ||
|
||
slices -= 1; /* last slice is the whole disk */ | ||
printk("sysV68: %s(s%u)", state->name, slices); | ||
slice = (struct slice *)data; | ||
for (i = 0; i < slices; i++, slice++) { | ||
if (slot == state->limit) | ||
break; | ||
if (be32_to_cpu(slice->nblocks)) { | ||
put_partition(state, slot, | ||
be32_to_cpu(slice->blkoff), | ||
be32_to_cpu(slice->nblocks)); | ||
printk("(s%u)", i); | ||
} | ||
slot++; | ||
} | ||
printk("\n"); | ||
put_dev_sector(sect); | ||
return 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
extern int sysv68_partition(struct parsed_partitions *state, struct block_device *bdev); |