Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
25757a5a
Commit
25757a5a
authored
Sep 25, 2002
by
Alex Williamson
Committed by
David S. Miller
Sep 25, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/partitions/sun.c: raid autodetect for sun disk labels
parent
d982d0b4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
fs/partitions/sun.c
fs/partitions/sun.c
+17
-5
No files found.
fs/partitions/sun.c
View file @
25757a5a
...
@@ -18,7 +18,14 @@ int sun_partition(struct parsed_partitions *state, struct block_device *bdev)
...
@@ -18,7 +18,14 @@ int sun_partition(struct parsed_partitions *state, struct block_device *bdev)
Sector
sect
;
Sector
sect
;
struct
sun_disklabel
{
struct
sun_disklabel
{
unsigned
char
info
[
128
];
/* Informative text string */
unsigned
char
info
[
128
];
/* Informative text string */
unsigned
char
spare
[
292
];
/* Boot information etc. */
unsigned
char
spare0
[
14
];
struct
sun_info
{
unsigned
char
spare1
;
unsigned
char
id
;
unsigned
char
spare2
;
unsigned
char
flags
;
}
infos
[
8
];
unsigned
char
spare
[
246
];
/* Boot information etc. */
unsigned
short
rspeed
;
/* Disk rotational speed */
unsigned
short
rspeed
;
/* Disk rotational speed */
unsigned
short
pcylcount
;
/* Physical cylinder count */
unsigned
short
pcylcount
;
/* Physical cylinder count */
unsigned
short
sparecyl
;
/* extra sects per cylinder */
unsigned
short
sparecyl
;
/* extra sects per cylinder */
...
@@ -54,22 +61,27 @@ int sun_partition(struct parsed_partitions *state, struct block_device *bdev)
...
@@ -54,22 +61,27 @@ int sun_partition(struct parsed_partitions *state, struct block_device *bdev)
ush
=
((
unsigned
short
*
)
(
label
+
1
))
-
1
;
ush
=
((
unsigned
short
*
)
(
label
+
1
))
-
1
;
for
(
csum
=
0
;
ush
>=
((
unsigned
short
*
)
label
);)
for
(
csum
=
0
;
ush
>=
((
unsigned
short
*
)
label
);)
csum
^=
*
ush
--
;
csum
^=
*
ush
--
;
if
(
csum
)
{
if
(
csum
)
{
printk
(
"Dev %s Sun disklabel: Csum bad, label corrupted
\n
"
,
printk
(
"Dev %s Sun disklabel: Csum bad, label corrupted
\n
"
,
bdevname
(
bdev
));
bdevname
(
bdev
));
put_dev_sector
(
sect
);
put_dev_sector
(
sect
);
return
0
;
return
0
;
}
}
/* All Sun disks have 8 partition entries */
/* All Sun disks have 8 partition entries */
spc
=
be16_to_cpu
(
label
->
ntrks
)
*
be16_to_cpu
(
label
->
nsect
);
spc
=
be16_to_cpu
(
label
->
ntrks
)
*
be16_to_cpu
(
label
->
nsect
);
for
(
i
=
0
;
i
<
8
;
i
++
,
p
++
)
{
for
(
i
=
0
;
i
<
8
;
i
++
,
p
++
)
{
unsigned
long
st_sector
;
unsigned
long
st_sector
;
int
num_sectors
;
int
num_sectors
;
st_sector
=
be32_to_cpu
(
p
->
start_cylinder
)
*
spc
;
st_sector
=
be32_to_cpu
(
p
->
start_cylinder
)
*
spc
;
num_sectors
=
be32_to_cpu
(
p
->
num_sectors
);
num_sectors
=
be32_to_cpu
(
p
->
num_sectors
);
if
(
num_sectors
)
if
(
num_sectors
)
{
put_partition
(
state
,
slot
++
,
st_sector
,
num_sectors
);
put_partition
(
state
,
slot
,
st_sector
,
num_sectors
);
if
(
label
->
infos
[
i
].
id
==
LINUX_RAID_PARTITION
)
state
->
parts
[
slot
].
flags
=
1
;
slot
++
;
}
}
}
printk
(
"
\n
"
);
printk
(
"
\n
"
);
put_dev_sector
(
sect
);
put_dev_sector
(
sect
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment