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
e373ab10
Commit
e373ab10
authored
Oct 11, 2011
by
NeilBrown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
md/raid0: typedef removal: raid0_conf_t -> struct r0conf
Signed-off-by:
NeilBrown
<
neilb@suse.de
>
parent
69724e28
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
24 deletions
+20
-24
drivers/md/raid0.c
drivers/md/raid0.c
+11
-11
drivers/md/raid0.h
drivers/md/raid0.h
+2
-6
drivers/md/raid10.c
drivers/md/raid10.c
+3
-3
drivers/md/raid5.c
drivers/md/raid5.c
+4
-4
No files found.
drivers/md/raid0.c
View file @
e373ab10
...
...
@@ -28,7 +28,7 @@
static
int
raid0_congested
(
void
*
data
,
int
bits
)
{
struct
mddev
*
mddev
=
data
;
raid0_conf_t
*
conf
=
mddev
->
private
;
struct
r0conf
*
conf
=
mddev
->
private
;
struct
md_rdev
**
devlist
=
conf
->
devlist
;
int
raid_disks
=
conf
->
strip_zone
[
0
].
nb_dev
;
int
i
,
ret
=
0
;
...
...
@@ -53,7 +53,7 @@ static void dump_zones(struct mddev *mddev)
sector_t
zone_size
=
0
;
sector_t
zone_start
=
0
;
char
b
[
BDEVNAME_SIZE
];
raid0_conf_t
*
conf
=
mddev
->
private
;
struct
r0conf
*
conf
=
mddev
->
private
;
int
raid_disks
=
conf
->
strip_zone
[
0
].
nb_dev
;
printk
(
KERN_INFO
"md: RAID0 configuration for %s - %d zone%s
\n
"
,
mdname
(
mddev
),
...
...
@@ -77,7 +77,7 @@ static void dump_zones(struct mddev *mddev)
printk
(
KERN_INFO
"
\n
"
);
}
static
int
create_strip_zones
(
struct
mddev
*
mddev
,
raid0_conf_t
**
private_conf
)
static
int
create_strip_zones
(
struct
mddev
*
mddev
,
struct
r0conf
**
private_conf
)
{
int
i
,
c
,
err
;
sector_t
curr_zone_end
,
sectors
;
...
...
@@ -86,7 +86,7 @@ static int create_strip_zones(struct mddev *mddev, raid0_conf_t **private_conf)
int
cnt
;
char
b
[
BDEVNAME_SIZE
];
char
b2
[
BDEVNAME_SIZE
];
raid0_conf_t
*
conf
=
kzalloc
(
sizeof
(
*
conf
),
GFP_KERNEL
);
struct
r0conf
*
conf
=
kzalloc
(
sizeof
(
*
conf
),
GFP_KERNEL
);
if
(
!
conf
)
return
-
ENOMEM
;
...
...
@@ -336,7 +336,7 @@ static sector_t raid0_size(struct mddev *mddev, sector_t sectors, int raid_disks
static
int
raid0_run
(
struct
mddev
*
mddev
)
{
raid0_conf_t
*
conf
;
struct
r0conf
*
conf
;
int
ret
;
if
(
mddev
->
chunk_sectors
==
0
)
{
...
...
@@ -386,7 +386,7 @@ static int raid0_run(struct mddev *mddev)
static
int
raid0_stop
(
struct
mddev
*
mddev
)
{
raid0_conf_t
*
conf
=
mddev
->
private
;
struct
r0conf
*
conf
=
mddev
->
private
;
blk_sync_queue
(
mddev
->
queue
);
/* the unplug fn references 'conf'*/
kfree
(
conf
->
strip_zone
);
...
...
@@ -399,7 +399,7 @@ static int raid0_stop(struct mddev *mddev)
/* Find the zone which holds a particular offset
* Update *sectorp to be an offset in that zone
*/
static
struct
strip_zone
*
find_zone
(
struct
r
aid0_private_data
*
conf
,
static
struct
strip_zone
*
find_zone
(
struct
r
0conf
*
conf
,
sector_t
*
sectorp
)
{
int
i
;
...
...
@@ -424,7 +424,7 @@ static struct md_rdev *map_sector(struct mddev *mddev, struct strip_zone *zone,
{
unsigned
int
sect_in_chunk
;
sector_t
chunk
;
raid0_conf_t
*
conf
=
mddev
->
private
;
struct
r0conf
*
conf
=
mddev
->
private
;
int
raid_disks
=
conf
->
strip_zone
[
0
].
nb_dev
;
unsigned
int
chunk_sects
=
mddev
->
chunk_sectors
;
...
...
@@ -537,7 +537,7 @@ static void raid0_status(struct seq_file *seq, struct mddev *mddev)
static
void
*
raid0_takeover_raid45
(
struct
mddev
*
mddev
)
{
struct
md_rdev
*
rdev
;
raid0_conf_t
*
priv_conf
;
struct
r0conf
*
priv_conf
;
if
(
mddev
->
degraded
!=
1
)
{
printk
(
KERN_ERR
"md/raid0:%s: raid5 must be degraded! Degraded disks: %d
\n
"
,
...
...
@@ -570,7 +570,7 @@ static void *raid0_takeover_raid45(struct mddev *mddev)
static
void
*
raid0_takeover_raid10
(
struct
mddev
*
mddev
)
{
raid0_conf_t
*
priv_conf
;
struct
r0conf
*
priv_conf
;
/* Check layout:
* - far_copies must be 1
...
...
@@ -611,7 +611,7 @@ static void *raid0_takeover_raid10(struct mddev *mddev)
static
void
*
raid0_takeover_raid1
(
struct
mddev
*
mddev
)
{
raid0_conf_t
*
priv_conf
;
struct
r0conf
*
priv_conf
;
/* Check layout:
* - (N - 1) mirror drives must be already faulty
...
...
drivers/md/raid0.h
View file @
e373ab10
#ifndef _RAID0_H
#define _RAID0_H
struct
strip_zone
{
struct
strip_zone
{
sector_t
zone_end
;
/* Start of the next zone (in sectors) */
sector_t
dev_start
;
/* Zone offset in real dev (in sectors) */
int
nb_dev
;
/* # of devices attached to the zone */
};
struct
raid0_private_data
{
struct
r0conf
{
struct
strip_zone
*
strip_zone
;
struct
md_rdev
**
devlist
;
/* lists of rdevs, pointed to by strip_zone->dev */
int
nr_strip_zones
;
};
typedef
struct
raid0_private_data
raid0_conf_t
;
#endif
drivers/md/raid10.c
View file @
e373ab10
...
...
@@ -3031,15 +3031,15 @@ static void *raid10_takeover_raid0(struct mddev *mddev)
static
void
*
raid10_takeover
(
struct
mddev
*
mddev
)
{
struct
r
aid0_private_data
*
raid0_priv
;
struct
r
0conf
*
raid0_conf
;
/* raid10 can take over:
* raid0 - providing it has only two drives
*/
if
(
mddev
->
level
==
0
)
{
/* for raid0 takeover only one zone is supported */
raid0_
priv
=
mddev
->
private
;
if
(
raid0_
priv
->
nr_strip_zones
>
1
)
{
raid0_
conf
=
mddev
->
private
;
if
(
raid0_
conf
->
nr_strip_zones
>
1
)
{
printk
(
KERN_ERR
"md/raid10:%s: cannot takeover raid 0"
" with more than one zone.
\n
"
,
mdname
(
mddev
));
...
...
drivers/md/raid5.c
View file @
e373ab10
...
...
@@ -5405,18 +5405,18 @@ static void raid5_quiesce(struct mddev *mddev, int state)
static
void
*
raid45_takeover_raid0
(
struct
mddev
*
mddev
,
int
level
)
{
struct
r
aid0_private_data
*
raid0_priv
=
mddev
->
private
;
struct
r
0conf
*
raid0_conf
=
mddev
->
private
;
sector_t
sectors
;
/* for raid0 takeover only one zone is supported */
if
(
raid0_
priv
->
nr_strip_zones
>
1
)
{
if
(
raid0_
conf
->
nr_strip_zones
>
1
)
{
printk
(
KERN_ERR
"md/raid:%s: cannot takeover raid0 with more than one zone.
\n
"
,
mdname
(
mddev
));
return
ERR_PTR
(
-
EINVAL
);
}
sectors
=
raid0_
priv
->
strip_zone
[
0
].
zone_end
;
sector_div
(
sectors
,
raid0_
priv
->
strip_zone
[
0
].
nb_dev
);
sectors
=
raid0_
conf
->
strip_zone
[
0
].
zone_end
;
sector_div
(
sectors
,
raid0_
conf
->
strip_zone
[
0
].
nb_dev
);
mddev
->
dev_sectors
=
sectors
;
mddev
->
new_level
=
level
;
mddev
->
new_layout
=
ALGORITHM_PARITY_N
;
...
...
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