Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
e879a879
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e879a879
编写于
10月 11, 2011
作者:
N
NeilBrown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
md/raid10: typedef removal: conf_t -> struct r10conf
Signed-off-by:
N
NeilBrown
<
neilb@suse.de
>
上级
e373ab10
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
55 addition
and
57 deletion
+55
-57
drivers/md/raid10.c
drivers/md/raid10.c
+54
-54
drivers/md/raid10.h
drivers/md/raid10.h
+1
-3
未找到文件。
drivers/md/raid10.c
浏览文件 @
e879a879
...
@@ -58,12 +58,12 @@
...
@@ -58,12 +58,12 @@
*/
*/
#define NR_RAID10_BIOS 256
#define NR_RAID10_BIOS 256
static
void
allow_barrier
(
conf_t
*
conf
);
static
void
allow_barrier
(
struct
r10conf
*
conf
);
static
void
lower_barrier
(
conf_t
*
conf
);
static
void
lower_barrier
(
struct
r10conf
*
conf
);
static
void
*
r10bio_pool_alloc
(
gfp_t
gfp_flags
,
void
*
data
)
static
void
*
r10bio_pool_alloc
(
gfp_t
gfp_flags
,
void
*
data
)
{
{
conf_t
*
conf
=
data
;
struct
r10conf
*
conf
=
data
;
int
size
=
offsetof
(
struct
r10bio
,
devs
[
conf
->
copies
]);
int
size
=
offsetof
(
struct
r10bio
,
devs
[
conf
->
copies
]);
/* allocate a r10bio with room for raid_disks entries in the bios array */
/* allocate a r10bio with room for raid_disks entries in the bios array */
...
@@ -92,7 +92,7 @@ static void r10bio_pool_free(void *r10_bio, void *data)
...
@@ -92,7 +92,7 @@ static void r10bio_pool_free(void *r10_bio, void *data)
*/
*/
static
void
*
r10buf_pool_alloc
(
gfp_t
gfp_flags
,
void
*
data
)
static
void
*
r10buf_pool_alloc
(
gfp_t
gfp_flags
,
void
*
data
)
{
{
conf_t
*
conf
=
data
;
struct
r10conf
*
conf
=
data
;
struct
page
*
page
;
struct
page
*
page
;
struct
r10bio
*
r10_bio
;
struct
r10bio
*
r10_bio
;
struct
bio
*
bio
;
struct
bio
*
bio
;
...
@@ -158,7 +158,7 @@ static void * r10buf_pool_alloc(gfp_t gfp_flags, void *data)
...
@@ -158,7 +158,7 @@ static void * r10buf_pool_alloc(gfp_t gfp_flags, void *data)
static
void
r10buf_pool_free
(
void
*
__r10_bio
,
void
*
data
)
static
void
r10buf_pool_free
(
void
*
__r10_bio
,
void
*
data
)
{
{
int
i
;
int
i
;
conf_t
*
conf
=
data
;
struct
r10conf
*
conf
=
data
;
struct
r10bio
*
r10bio
=
__r10_bio
;
struct
r10bio
*
r10bio
=
__r10_bio
;
int
j
;
int
j
;
...
@@ -175,7 +175,7 @@ static void r10buf_pool_free(void *__r10_bio, void *data)
...
@@ -175,7 +175,7 @@ static void r10buf_pool_free(void *__r10_bio, void *data)
r10bio_pool_free
(
r10bio
,
conf
);
r10bio_pool_free
(
r10bio
,
conf
);
}
}
static
void
put_all_bios
(
conf_t
*
conf
,
struct
r10bio
*
r10_bio
)
static
void
put_all_bios
(
struct
r10conf
*
conf
,
struct
r10bio
*
r10_bio
)
{
{
int
i
;
int
i
;
...
@@ -189,7 +189,7 @@ static void put_all_bios(conf_t *conf, struct r10bio *r10_bio)
...
@@ -189,7 +189,7 @@ static void put_all_bios(conf_t *conf, struct r10bio *r10_bio)
static
void
free_r10bio
(
struct
r10bio
*
r10_bio
)
static
void
free_r10bio
(
struct
r10bio
*
r10_bio
)
{
{
conf_t
*
conf
=
r10_bio
->
mddev
->
private
;
struct
r10conf
*
conf
=
r10_bio
->
mddev
->
private
;
put_all_bios
(
conf
,
r10_bio
);
put_all_bios
(
conf
,
r10_bio
);
mempool_free
(
r10_bio
,
conf
->
r10bio_pool
);
mempool_free
(
r10_bio
,
conf
->
r10bio_pool
);
...
@@ -197,7 +197,7 @@ static void free_r10bio(struct r10bio *r10_bio)
...
@@ -197,7 +197,7 @@ static void free_r10bio(struct r10bio *r10_bio)
static
void
put_buf
(
struct
r10bio
*
r10_bio
)
static
void
put_buf
(
struct
r10bio
*
r10_bio
)
{
{
conf_t
*
conf
=
r10_bio
->
mddev
->
private
;
struct
r10conf
*
conf
=
r10_bio
->
mddev
->
private
;
mempool_free
(
r10_bio
,
conf
->
r10buf_pool
);
mempool_free
(
r10_bio
,
conf
->
r10buf_pool
);
...
@@ -208,7 +208,7 @@ static void reschedule_retry(struct r10bio *r10_bio)
...
@@ -208,7 +208,7 @@ static void reschedule_retry(struct r10bio *r10_bio)
{
{
unsigned
long
flags
;
unsigned
long
flags
;
struct
mddev
*
mddev
=
r10_bio
->
mddev
;
struct
mddev
*
mddev
=
r10_bio
->
mddev
;
conf_t
*
conf
=
mddev
->
private
;
struct
r10conf
*
conf
=
mddev
->
private
;
spin_lock_irqsave
(
&
conf
->
device_lock
,
flags
);
spin_lock_irqsave
(
&
conf
->
device_lock
,
flags
);
list_add
(
&
r10_bio
->
retry_list
,
&
conf
->
retry_list
);
list_add
(
&
r10_bio
->
retry_list
,
&
conf
->
retry_list
);
...
@@ -230,7 +230,7 @@ static void raid_end_bio_io(struct r10bio *r10_bio)
...
@@ -230,7 +230,7 @@ static void raid_end_bio_io(struct r10bio *r10_bio)
{
{
struct
bio
*
bio
=
r10_bio
->
master_bio
;
struct
bio
*
bio
=
r10_bio
->
master_bio
;
int
done
;
int
done
;
conf_t
*
conf
=
r10_bio
->
mddev
->
private
;
struct
r10conf
*
conf
=
r10_bio
->
mddev
->
private
;
if
(
bio
->
bi_phys_segments
)
{
if
(
bio
->
bi_phys_segments
)
{
unsigned
long
flags
;
unsigned
long
flags
;
...
@@ -258,7 +258,7 @@ static void raid_end_bio_io(struct r10bio *r10_bio)
...
@@ -258,7 +258,7 @@ static void raid_end_bio_io(struct r10bio *r10_bio)
*/
*/
static
inline
void
update_head_pos
(
int
slot
,
struct
r10bio
*
r10_bio
)
static
inline
void
update_head_pos
(
int
slot
,
struct
r10bio
*
r10_bio
)
{
{
conf_t
*
conf
=
r10_bio
->
mddev
->
private
;
struct
r10conf
*
conf
=
r10_bio
->
mddev
->
private
;
conf
->
mirrors
[
r10_bio
->
devs
[
slot
].
devnum
].
head_position
=
conf
->
mirrors
[
r10_bio
->
devs
[
slot
].
devnum
].
head_position
=
r10_bio
->
devs
[
slot
].
addr
+
(
r10_bio
->
sectors
);
r10_bio
->
devs
[
slot
].
addr
+
(
r10_bio
->
sectors
);
...
@@ -267,7 +267,7 @@ static inline void update_head_pos(int slot, struct r10bio *r10_bio)
...
@@ -267,7 +267,7 @@ static inline void update_head_pos(int slot, struct r10bio *r10_bio)
/*
/*
* Find the disk number which triggered given bio
* Find the disk number which triggered given bio
*/
*/
static
int
find_bio_disk
(
conf_t
*
conf
,
struct
r10bio
*
r10_bio
,
static
int
find_bio_disk
(
struct
r10conf
*
conf
,
struct
r10bio
*
r10_bio
,
struct
bio
*
bio
,
int
*
slotp
)
struct
bio
*
bio
,
int
*
slotp
)
{
{
int
slot
;
int
slot
;
...
@@ -289,7 +289,7 @@ static void raid10_end_read_request(struct bio *bio, int error)
...
@@ -289,7 +289,7 @@ static void raid10_end_read_request(struct bio *bio, int error)
int
uptodate
=
test_bit
(
BIO_UPTODATE
,
&
bio
->
bi_flags
);
int
uptodate
=
test_bit
(
BIO_UPTODATE
,
&
bio
->
bi_flags
);
struct
r10bio
*
r10_bio
=
bio
->
bi_private
;
struct
r10bio
*
r10_bio
=
bio
->
bi_private
;
int
slot
,
dev
;
int
slot
,
dev
;
conf_t
*
conf
=
r10_bio
->
mddev
->
private
;
struct
r10conf
*
conf
=
r10_bio
->
mddev
->
private
;
slot
=
r10_bio
->
read_slot
;
slot
=
r10_bio
->
read_slot
;
...
@@ -358,7 +358,7 @@ static void raid10_end_write_request(struct bio *bio, int error)
...
@@ -358,7 +358,7 @@ static void raid10_end_write_request(struct bio *bio, int error)
struct
r10bio
*
r10_bio
=
bio
->
bi_private
;
struct
r10bio
*
r10_bio
=
bio
->
bi_private
;
int
dev
;
int
dev
;
int
dec_rdev
=
1
;
int
dec_rdev
=
1
;
conf_t
*
conf
=
r10_bio
->
mddev
->
private
;
struct
r10conf
*
conf
=
r10_bio
->
mddev
->
private
;
int
slot
;
int
slot
;
dev
=
find_bio_disk
(
conf
,
r10_bio
,
bio
,
&
slot
);
dev
=
find_bio_disk
(
conf
,
r10_bio
,
bio
,
&
slot
);
...
@@ -433,7 +433,7 @@ static void raid10_end_write_request(struct bio *bio, int error)
...
@@ -433,7 +433,7 @@ static void raid10_end_write_request(struct bio *bio, int error)
* sector offset to a virtual address
* sector offset to a virtual address
*/
*/
static
void
raid10_find_phys
(
conf_t
*
conf
,
struct
r10bio
*
r10bio
)
static
void
raid10_find_phys
(
struct
r10conf
*
conf
,
struct
r10bio
*
r10bio
)
{
{
int
n
,
f
;
int
n
,
f
;
sector_t
sector
;
sector_t
sector
;
...
@@ -481,7 +481,7 @@ static void raid10_find_phys(conf_t *conf, struct r10bio *r10bio)
...
@@ -481,7 +481,7 @@ static void raid10_find_phys(conf_t *conf, struct r10bio *r10bio)
BUG_ON
(
slot
!=
conf
->
copies
);
BUG_ON
(
slot
!=
conf
->
copies
);
}
}
static
sector_t
raid10_find_virt
(
conf_t
*
conf
,
sector_t
sector
,
int
dev
)
static
sector_t
raid10_find_virt
(
struct
r10conf
*
conf
,
sector_t
sector
,
int
dev
)
{
{
sector_t
offset
,
chunk
,
vchunk
;
sector_t
offset
,
chunk
,
vchunk
;
...
@@ -555,7 +555,7 @@ static int raid10_mergeable_bvec(struct request_queue *q,
...
@@ -555,7 +555,7 @@ static int raid10_mergeable_bvec(struct request_queue *q,
* FIXME: possibly should rethink readbalancing and do it differently
* FIXME: possibly should rethink readbalancing and do it differently
* depending on near_copies / far_copies geometry.
* depending on near_copies / far_copies geometry.
*/
*/
static
int
read_balance
(
conf_t
*
conf
,
struct
r10bio
*
r10_bio
,
int
*
max_sectors
)
static
int
read_balance
(
struct
r10conf
*
conf
,
struct
r10bio
*
r10_bio
,
int
*
max_sectors
)
{
{
const
sector_t
this_sector
=
r10_bio
->
sector
;
const
sector_t
this_sector
=
r10_bio
->
sector
;
int
disk
,
slot
;
int
disk
,
slot
;
...
@@ -678,7 +678,7 @@ static int read_balance(conf_t *conf, struct r10bio *r10_bio, int *max_sectors)
...
@@ -678,7 +678,7 @@ static int read_balance(conf_t *conf, struct r10bio *r10_bio, int *max_sectors)
static
int
raid10_congested
(
void
*
data
,
int
bits
)
static
int
raid10_congested
(
void
*
data
,
int
bits
)
{
{
struct
mddev
*
mddev
=
data
;
struct
mddev
*
mddev
=
data
;
conf_t
*
conf
=
mddev
->
private
;
struct
r10conf
*
conf
=
mddev
->
private
;
int
i
,
ret
=
0
;
int
i
,
ret
=
0
;
if
(
mddev_congested
(
mddev
,
bits
))
if
(
mddev_congested
(
mddev
,
bits
))
...
@@ -696,7 +696,7 @@ static int raid10_congested(void *data, int bits)
...
@@ -696,7 +696,7 @@ static int raid10_congested(void *data, int bits)
return
ret
;
return
ret
;
}
}
static
void
flush_pending_writes
(
conf_t
*
conf
)
static
void
flush_pending_writes
(
struct
r10conf
*
conf
)
{
{
/* Any writes that have been queued but are awaiting
/* Any writes that have been queued but are awaiting
* bitmap updates get flushed here.
* bitmap updates get flushed here.
...
@@ -743,7 +743,7 @@ static void flush_pending_writes(conf_t *conf)
...
@@ -743,7 +743,7 @@ static void flush_pending_writes(conf_t *conf)
* lower_barrier when the particular background IO completes.
* lower_barrier when the particular background IO completes.
*/
*/
static
void
raise_barrier
(
conf_t
*
conf
,
int
force
)
static
void
raise_barrier
(
struct
r10conf
*
conf
,
int
force
)
{
{
BUG_ON
(
force
&&
!
conf
->
barrier
);
BUG_ON
(
force
&&
!
conf
->
barrier
);
spin_lock_irq
(
&
conf
->
resync_lock
);
spin_lock_irq
(
&
conf
->
resync_lock
);
...
@@ -763,7 +763,7 @@ static void raise_barrier(conf_t *conf, int force)
...
@@ -763,7 +763,7 @@ static void raise_barrier(conf_t *conf, int force)
spin_unlock_irq
(
&
conf
->
resync_lock
);
spin_unlock_irq
(
&
conf
->
resync_lock
);
}
}
static
void
lower_barrier
(
conf_t
*
conf
)
static
void
lower_barrier
(
struct
r10conf
*
conf
)
{
{
unsigned
long
flags
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
conf
->
resync_lock
,
flags
);
spin_lock_irqsave
(
&
conf
->
resync_lock
,
flags
);
...
@@ -772,7 +772,7 @@ static void lower_barrier(conf_t *conf)
...
@@ -772,7 +772,7 @@ static void lower_barrier(conf_t *conf)
wake_up
(
&
conf
->
wait_barrier
);
wake_up
(
&
conf
->
wait_barrier
);
}
}
static
void
wait_barrier
(
conf_t
*
conf
)
static
void
wait_barrier
(
struct
r10conf
*
conf
)
{
{
spin_lock_irq
(
&
conf
->
resync_lock
);
spin_lock_irq
(
&
conf
->
resync_lock
);
if
(
conf
->
barrier
)
{
if
(
conf
->
barrier
)
{
...
@@ -786,7 +786,7 @@ static void wait_barrier(conf_t *conf)
...
@@ -786,7 +786,7 @@ static void wait_barrier(conf_t *conf)
spin_unlock_irq
(
&
conf
->
resync_lock
);
spin_unlock_irq
(
&
conf
->
resync_lock
);
}
}
static
void
allow_barrier
(
conf_t
*
conf
)
static
void
allow_barrier
(
struct
r10conf
*
conf
)
{
{
unsigned
long
flags
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
conf
->
resync_lock
,
flags
);
spin_lock_irqsave
(
&
conf
->
resync_lock
,
flags
);
...
@@ -795,7 +795,7 @@ static void allow_barrier(conf_t *conf)
...
@@ -795,7 +795,7 @@ static void allow_barrier(conf_t *conf)
wake_up
(
&
conf
->
wait_barrier
);
wake_up
(
&
conf
->
wait_barrier
);
}
}
static
void
freeze_array
(
conf_t
*
conf
)
static
void
freeze_array
(
struct
r10conf
*
conf
)
{
{
/* stop syncio and normal IO and wait for everything to
/* stop syncio and normal IO and wait for everything to
* go quiet.
* go quiet.
...
@@ -820,7 +820,7 @@ static void freeze_array(conf_t *conf)
...
@@ -820,7 +820,7 @@ static void freeze_array(conf_t *conf)
spin_unlock_irq
(
&
conf
->
resync_lock
);
spin_unlock_irq
(
&
conf
->
resync_lock
);
}
}
static
void
unfreeze_array
(
conf_t
*
conf
)
static
void
unfreeze_array
(
struct
r10conf
*
conf
)
{
{
/* reverse the effect of the freeze */
/* reverse the effect of the freeze */
spin_lock_irq
(
&
conf
->
resync_lock
);
spin_lock_irq
(
&
conf
->
resync_lock
);
...
@@ -832,7 +832,7 @@ static void unfreeze_array(conf_t *conf)
...
@@ -832,7 +832,7 @@ static void unfreeze_array(conf_t *conf)
static
int
make_request
(
struct
mddev
*
mddev
,
struct
bio
*
bio
)
static
int
make_request
(
struct
mddev
*
mddev
,
struct
bio
*
bio
)
{
{
conf_t
*
conf
=
mddev
->
private
;
struct
r10conf
*
conf
=
mddev
->
private
;
struct
mirror_info
*
mirror
;
struct
mirror_info
*
mirror
;
struct
r10bio
*
r10_bio
;
struct
r10bio
*
r10_bio
;
struct
bio
*
read_bio
;
struct
bio
*
read_bio
;
...
@@ -1163,7 +1163,7 @@ static int make_request(struct mddev *mddev, struct bio * bio)
...
@@ -1163,7 +1163,7 @@ static int make_request(struct mddev *mddev, struct bio * bio)
static
void
status
(
struct
seq_file
*
seq
,
struct
mddev
*
mddev
)
static
void
status
(
struct
seq_file
*
seq
,
struct
mddev
*
mddev
)
{
{
conf_t
*
conf
=
mddev
->
private
;
struct
r10conf
*
conf
=
mddev
->
private
;
int
i
;
int
i
;
if
(
conf
->
near_copies
<
conf
->
raid_disks
)
if
(
conf
->
near_copies
<
conf
->
raid_disks
)
...
@@ -1190,7 +1190,7 @@ static void status(struct seq_file *seq, struct mddev *mddev)
...
@@ -1190,7 +1190,7 @@ static void status(struct seq_file *seq, struct mddev *mddev)
* Don't consider the device numbered 'ignore'
* Don't consider the device numbered 'ignore'
* as we might be about to remove it.
* as we might be about to remove it.
*/
*/
static
int
enough
(
conf_t
*
conf
,
int
ignore
)
static
int
enough
(
struct
r10conf
*
conf
,
int
ignore
)
{
{
int
first
=
0
;
int
first
=
0
;
...
@@ -1212,7 +1212,7 @@ static int enough(conf_t *conf, int ignore)
...
@@ -1212,7 +1212,7 @@ static int enough(conf_t *conf, int ignore)
static
void
error
(
struct
mddev
*
mddev
,
struct
md_rdev
*
rdev
)
static
void
error
(
struct
mddev
*
mddev
,
struct
md_rdev
*
rdev
)
{
{
char
b
[
BDEVNAME_SIZE
];
char
b
[
BDEVNAME_SIZE
];
conf_t
*
conf
=
mddev
->
private
;
struct
r10conf
*
conf
=
mddev
->
private
;
/*
/*
* If it is not operational, then we have already marked it as dead
* If it is not operational, then we have already marked it as dead
...
@@ -1246,7 +1246,7 @@ static void error(struct mddev *mddev, struct md_rdev *rdev)
...
@@ -1246,7 +1246,7 @@ static void error(struct mddev *mddev, struct md_rdev *rdev)
mdname
(
mddev
),
conf
->
raid_disks
-
mddev
->
degraded
);
mdname
(
mddev
),
conf
->
raid_disks
-
mddev
->
degraded
);
}
}
static
void
print_conf
(
conf_t
*
conf
)
static
void
print_conf
(
struct
r10conf
*
conf
)
{
{
int
i
;
int
i
;
struct
mirror_info
*
tmp
;
struct
mirror_info
*
tmp
;
...
@@ -1270,7 +1270,7 @@ static void print_conf(conf_t *conf)
...
@@ -1270,7 +1270,7 @@ static void print_conf(conf_t *conf)
}
}
}
}
static
void
close_sync
(
conf_t
*
conf
)
static
void
close_sync
(
struct
r10conf
*
conf
)
{
{
wait_barrier
(
conf
);
wait_barrier
(
conf
);
allow_barrier
(
conf
);
allow_barrier
(
conf
);
...
@@ -1282,7 +1282,7 @@ static void close_sync(conf_t *conf)
...
@@ -1282,7 +1282,7 @@ static void close_sync(conf_t *conf)
static
int
raid10_spare_active
(
struct
mddev
*
mddev
)
static
int
raid10_spare_active
(
struct
mddev
*
mddev
)
{
{
int
i
;
int
i
;
conf_t
*
conf
=
mddev
->
private
;
struct
r10conf
*
conf
=
mddev
->
private
;
struct
mirror_info
*
tmp
;
struct
mirror_info
*
tmp
;
int
count
=
0
;
int
count
=
0
;
unsigned
long
flags
;
unsigned
long
flags
;
...
@@ -1311,7 +1311,7 @@ static int raid10_spare_active(struct mddev *mddev)
...
@@ -1311,7 +1311,7 @@ static int raid10_spare_active(struct mddev *mddev)
static
int
raid10_add_disk
(
struct
mddev
*
mddev
,
struct
md_rdev
*
rdev
)
static
int
raid10_add_disk
(
struct
mddev
*
mddev
,
struct
md_rdev
*
rdev
)
{
{
conf_t
*
conf
=
mddev
->
private
;
struct
r10conf
*
conf
=
mddev
->
private
;
int
err
=
-
EEXIST
;
int
err
=
-
EEXIST
;
int
mirror
;
int
mirror
;
int
first
=
0
;
int
first
=
0
;
...
@@ -1370,7 +1370,7 @@ static int raid10_add_disk(struct mddev *mddev, struct md_rdev *rdev)
...
@@ -1370,7 +1370,7 @@ static int raid10_add_disk(struct mddev *mddev, struct md_rdev *rdev)
static
int
raid10_remove_disk
(
struct
mddev
*
mddev
,
int
number
)
static
int
raid10_remove_disk
(
struct
mddev
*
mddev
,
int
number
)
{
{
conf_t
*
conf
=
mddev
->
private
;
struct
r10conf
*
conf
=
mddev
->
private
;
int
err
=
0
;
int
err
=
0
;
struct
md_rdev
*
rdev
;
struct
md_rdev
*
rdev
;
struct
mirror_info
*
p
=
conf
->
mirrors
+
number
;
struct
mirror_info
*
p
=
conf
->
mirrors
+
number
;
...
@@ -1412,7 +1412,7 @@ static int raid10_remove_disk(struct mddev *mddev, int number)
...
@@ -1412,7 +1412,7 @@ static int raid10_remove_disk(struct mddev *mddev, int number)
static
void
end_sync_read
(
struct
bio
*
bio
,
int
error
)
static
void
end_sync_read
(
struct
bio
*
bio
,
int
error
)
{
{
struct
r10bio
*
r10_bio
=
bio
->
bi_private
;
struct
r10bio
*
r10_bio
=
bio
->
bi_private
;
conf_t
*
conf
=
r10_bio
->
mddev
->
private
;
struct
r10conf
*
conf
=
r10_bio
->
mddev
->
private
;
int
d
;
int
d
;
d
=
find_bio_disk
(
conf
,
r10_bio
,
bio
,
NULL
);
d
=
find_bio_disk
(
conf
,
r10_bio
,
bio
,
NULL
);
...
@@ -1471,7 +1471,7 @@ static void end_sync_write(struct bio *bio, int error)
...
@@ -1471,7 +1471,7 @@ static void end_sync_write(struct bio *bio, int error)
int
uptodate
=
test_bit
(
BIO_UPTODATE
,
&
bio
->
bi_flags
);
int
uptodate
=
test_bit
(
BIO_UPTODATE
,
&
bio
->
bi_flags
);
struct
r10bio
*
r10_bio
=
bio
->
bi_private
;
struct
r10bio
*
r10_bio
=
bio
->
bi_private
;
struct
mddev
*
mddev
=
r10_bio
->
mddev
;
struct
mddev
*
mddev
=
r10_bio
->
mddev
;
conf_t
*
conf
=
mddev
->
private
;
struct
r10conf
*
conf
=
mddev
->
private
;
int
d
;
int
d
;
sector_t
first_bad
;
sector_t
first_bad
;
int
bad_sectors
;
int
bad_sectors
;
...
@@ -1511,7 +1511,7 @@ static void end_sync_write(struct bio *bio, int error)
...
@@ -1511,7 +1511,7 @@ static void end_sync_write(struct bio *bio, int error)
*/
*/
static
void
sync_request_write
(
struct
mddev
*
mddev
,
struct
r10bio
*
r10_bio
)
static
void
sync_request_write
(
struct
mddev
*
mddev
,
struct
r10bio
*
r10_bio
)
{
{
conf_t
*
conf
=
mddev
->
private
;
struct
r10conf
*
conf
=
mddev
->
private
;
int
i
,
first
;
int
i
,
first
;
struct
bio
*
tbio
,
*
fbio
;
struct
bio
*
tbio
,
*
fbio
;
...
@@ -1619,7 +1619,7 @@ static void fix_recovery_read_error(struct r10bio *r10_bio)
...
@@ -1619,7 +1619,7 @@ static void fix_recovery_read_error(struct r10bio *r10_bio)
* new devices.
* new devices.
*/
*/
struct
mddev
*
mddev
=
r10_bio
->
mddev
;
struct
mddev
*
mddev
=
r10_bio
->
mddev
;
conf_t
*
conf
=
mddev
->
private
;
struct
r10conf
*
conf
=
mddev
->
private
;
struct
bio
*
bio
=
r10_bio
->
devs
[
0
].
bio
;
struct
bio
*
bio
=
r10_bio
->
devs
[
0
].
bio
;
sector_t
sect
=
0
;
sector_t
sect
=
0
;
int
sectors
=
r10_bio
->
sectors
;
int
sectors
=
r10_bio
->
sectors
;
...
@@ -1690,7 +1690,7 @@ static void fix_recovery_read_error(struct r10bio *r10_bio)
...
@@ -1690,7 +1690,7 @@ static void fix_recovery_read_error(struct r10bio *r10_bio)
static
void
recovery_request_write
(
struct
mddev
*
mddev
,
struct
r10bio
*
r10_bio
)
static
void
recovery_request_write
(
struct
mddev
*
mddev
,
struct
r10bio
*
r10_bio
)
{
{
conf_t
*
conf
=
mddev
->
private
;
struct
r10conf
*
conf
=
mddev
->
private
;
int
d
;
int
d
;
struct
bio
*
wbio
;
struct
bio
*
wbio
;
...
@@ -1778,7 +1778,7 @@ static int r10_sync_page_io(struct md_rdev *rdev, sector_t sector,
...
@@ -1778,7 +1778,7 @@ static int r10_sync_page_io(struct md_rdev *rdev, sector_t sector,
* 3. Performs writes following reads for array synchronising.
* 3. Performs writes following reads for array synchronising.
*/
*/
static
void
fix_read_error
(
conf_t
*
conf
,
struct
mddev
*
mddev
,
struct
r10bio
*
r10_bio
)
static
void
fix_read_error
(
struct
r10conf
*
conf
,
struct
mddev
*
mddev
,
struct
r10bio
*
r10_bio
)
{
{
int
sect
=
0
;
/* Offset from r10_bio->sector */
int
sect
=
0
;
/* Offset from r10_bio->sector */
int
sectors
=
r10_bio
->
sectors
;
int
sectors
=
r10_bio
->
sectors
;
...
@@ -1987,7 +1987,7 @@ static int narrow_write_error(struct r10bio *r10_bio, int i)
...
@@ -1987,7 +1987,7 @@ static int narrow_write_error(struct r10bio *r10_bio, int i)
{
{
struct
bio
*
bio
=
r10_bio
->
master_bio
;
struct
bio
*
bio
=
r10_bio
->
master_bio
;
struct
mddev
*
mddev
=
r10_bio
->
mddev
;
struct
mddev
*
mddev
=
r10_bio
->
mddev
;
conf_t
*
conf
=
mddev
->
private
;
struct
r10conf
*
conf
=
mddev
->
private
;
struct
md_rdev
*
rdev
=
conf
->
mirrors
[
r10_bio
->
devs
[
i
].
devnum
].
rdev
;
struct
md_rdev
*
rdev
=
conf
->
mirrors
[
r10_bio
->
devs
[
i
].
devnum
].
rdev
;
/* bio has the data to be written to slot 'i' where
/* bio has the data to be written to slot 'i' where
* we just recently had a write error.
* we just recently had a write error.
...
@@ -2045,7 +2045,7 @@ static void handle_read_error(struct mddev *mddev, struct r10bio *r10_bio)
...
@@ -2045,7 +2045,7 @@ static void handle_read_error(struct mddev *mddev, struct r10bio *r10_bio)
int
slot
=
r10_bio
->
read_slot
;
int
slot
=
r10_bio
->
read_slot
;
int
mirror
=
r10_bio
->
devs
[
slot
].
devnum
;
int
mirror
=
r10_bio
->
devs
[
slot
].
devnum
;
struct
bio
*
bio
;
struct
bio
*
bio
;
conf_t
*
conf
=
mddev
->
private
;
struct
r10conf
*
conf
=
mddev
->
private
;
struct
md_rdev
*
rdev
;
struct
md_rdev
*
rdev
;
char
b
[
BDEVNAME_SIZE
];
char
b
[
BDEVNAME_SIZE
];
unsigned
long
do_sync
;
unsigned
long
do_sync
;
...
@@ -2139,7 +2139,7 @@ static void handle_read_error(struct mddev *mddev, struct r10bio *r10_bio)
...
@@ -2139,7 +2139,7 @@ static void handle_read_error(struct mddev *mddev, struct r10bio *r10_bio)
generic_make_request
(
bio
);
generic_make_request
(
bio
);
}
}
static
void
handle_write_completed
(
conf_t
*
conf
,
struct
r10bio
*
r10_bio
)
static
void
handle_write_completed
(
struct
r10conf
*
conf
,
struct
r10bio
*
r10_bio
)
{
{
/* Some sort of write request has finished and it
/* Some sort of write request has finished and it
* succeeded in writing where we thought there was a
* succeeded in writing where we thought there was a
...
@@ -2204,7 +2204,7 @@ static void raid10d(struct mddev *mddev)
...
@@ -2204,7 +2204,7 @@ static void raid10d(struct mddev *mddev)
{
{
struct
r10bio
*
r10_bio
;
struct
r10bio
*
r10_bio
;
unsigned
long
flags
;
unsigned
long
flags
;
conf_t
*
conf
=
mddev
->
private
;
struct
r10conf
*
conf
=
mddev
->
private
;
struct
list_head
*
head
=
&
conf
->
retry_list
;
struct
list_head
*
head
=
&
conf
->
retry_list
;
struct
blk_plug
plug
;
struct
blk_plug
plug
;
...
@@ -2252,7 +2252,7 @@ static void raid10d(struct mddev *mddev)
...
@@ -2252,7 +2252,7 @@ static void raid10d(struct mddev *mddev)
}
}
static
int
init_resync
(
conf_t
*
conf
)
static
int
init_resync
(
struct
r10conf
*
conf
)
{
{
int
buffs
;
int
buffs
;
...
@@ -2300,7 +2300,7 @@ static int init_resync(conf_t *conf)
...
@@ -2300,7 +2300,7 @@ static int init_resync(conf_t *conf)
static
sector_t
sync_request
(
struct
mddev
*
mddev
,
sector_t
sector_nr
,
static
sector_t
sync_request
(
struct
mddev
*
mddev
,
sector_t
sector_nr
,
int
*
skipped
,
int
go_faster
)
int
*
skipped
,
int
go_faster
)
{
{
conf_t
*
conf
=
mddev
->
private
;
struct
r10conf
*
conf
=
mddev
->
private
;
struct
r10bio
*
r10_bio
;
struct
r10bio
*
r10_bio
;
struct
bio
*
biolist
=
NULL
,
*
bio
;
struct
bio
*
biolist
=
NULL
,
*
bio
;
sector_t
max_sector
,
nr_sectors
;
sector_t
max_sector
,
nr_sectors
;
...
@@ -2717,7 +2717,7 @@ static sector_t
...
@@ -2717,7 +2717,7 @@ static sector_t
raid10_size
(
struct
mddev
*
mddev
,
sector_t
sectors
,
int
raid_disks
)
raid10_size
(
struct
mddev
*
mddev
,
sector_t
sectors
,
int
raid_disks
)
{
{
sector_t
size
;
sector_t
size
;
conf_t
*
conf
=
mddev
->
private
;
struct
r10conf
*
conf
=
mddev
->
private
;
if
(
!
raid_disks
)
if
(
!
raid_disks
)
raid_disks
=
conf
->
raid_disks
;
raid_disks
=
conf
->
raid_disks
;
...
@@ -2733,9 +2733,9 @@ raid10_size(struct mddev *mddev, sector_t sectors, int raid_disks)
...
@@ -2733,9 +2733,9 @@ raid10_size(struct mddev *mddev, sector_t sectors, int raid_disks)
}
}
static
conf_t
*
setup_conf
(
struct
mddev
*
mddev
)
static
struct
r10conf
*
setup_conf
(
struct
mddev
*
mddev
)
{
{
conf_t
*
conf
=
NULL
;
struct
r10conf
*
conf
=
NULL
;
int
nc
,
fc
,
fo
;
int
nc
,
fc
,
fo
;
sector_t
stride
,
size
;
sector_t
stride
,
size
;
int
err
=
-
EINVAL
;
int
err
=
-
EINVAL
;
...
@@ -2760,7 +2760,7 @@ static conf_t *setup_conf(struct mddev *mddev)
...
@@ -2760,7 +2760,7 @@ static conf_t *setup_conf(struct mddev *mddev)
}
}
err
=
-
ENOMEM
;
err
=
-
ENOMEM
;
conf
=
kzalloc
(
sizeof
(
conf_t
),
GFP_KERNEL
);
conf
=
kzalloc
(
sizeof
(
struct
r10conf
),
GFP_KERNEL
);
if
(
!
conf
)
if
(
!
conf
)
goto
out
;
goto
out
;
...
@@ -2838,7 +2838,7 @@ static conf_t *setup_conf(struct mddev *mddev)
...
@@ -2838,7 +2838,7 @@ static conf_t *setup_conf(struct mddev *mddev)
static
int
run
(
struct
mddev
*
mddev
)
static
int
run
(
struct
mddev
*
mddev
)
{
{
conf_t
*
conf
;
struct
r10conf
*
conf
;
int
i
,
disk_idx
,
chunk_size
;
int
i
,
disk_idx
,
chunk_size
;
struct
mirror_info
*
disk
;
struct
mirror_info
*
disk
;
struct
md_rdev
*
rdev
;
struct
md_rdev
*
rdev
;
...
@@ -2968,7 +2968,7 @@ static int run(struct mddev *mddev)
...
@@ -2968,7 +2968,7 @@ static int run(struct mddev *mddev)
static
int
stop
(
struct
mddev
*
mddev
)
static
int
stop
(
struct
mddev
*
mddev
)
{
{
conf_t
*
conf
=
mddev
->
private
;
struct
r10conf
*
conf
=
mddev
->
private
;
raise_barrier
(
conf
,
0
);
raise_barrier
(
conf
,
0
);
lower_barrier
(
conf
);
lower_barrier
(
conf
);
...
@@ -2985,7 +2985,7 @@ static int stop(struct mddev *mddev)
...
@@ -2985,7 +2985,7 @@ static int stop(struct mddev *mddev)
static
void
raid10_quiesce
(
struct
mddev
*
mddev
,
int
state
)
static
void
raid10_quiesce
(
struct
mddev
*
mddev
,
int
state
)
{
{
conf_t
*
conf
=
mddev
->
private
;
struct
r10conf
*
conf
=
mddev
->
private
;
switch
(
state
)
{
switch
(
state
)
{
case
1
:
case
1
:
...
@@ -3000,7 +3000,7 @@ static void raid10_quiesce(struct mddev *mddev, int state)
...
@@ -3000,7 +3000,7 @@ static void raid10_quiesce(struct mddev *mddev, int state)
static
void
*
raid10_takeover_raid0
(
struct
mddev
*
mddev
)
static
void
*
raid10_takeover_raid0
(
struct
mddev
*
mddev
)
{
{
struct
md_rdev
*
rdev
;
struct
md_rdev
*
rdev
;
conf_t
*
conf
;
struct
r10conf
*
conf
;
if
(
mddev
->
degraded
>
0
)
{
if
(
mddev
->
degraded
>
0
)
{
printk
(
KERN_ERR
"md/raid10:%s: Error: degraded raid0!
\n
"
,
printk
(
KERN_ERR
"md/raid10:%s: Error: degraded raid0!
\n
"
,
...
...
drivers/md/raid10.h
浏览文件 @
e879a879
...
@@ -11,7 +11,7 @@ struct mirror_info {
...
@@ -11,7 +11,7 @@ struct mirror_info {
*/
*/
};
};
struct
r10
_private_data_s
{
struct
r10
conf
{
struct
mddev
*
mddev
;
struct
mddev
*
mddev
;
struct
mirror_info
*
mirrors
;
struct
mirror_info
*
mirrors
;
int
raid_disks
;
int
raid_disks
;
...
@@ -67,8 +67,6 @@ struct r10_private_data_s {
...
@@ -67,8 +67,6 @@ struct r10_private_data_s {
struct
md_thread
*
thread
;
struct
md_thread
*
thread
;
};
};
typedef
struct
r10_private_data_s
conf_t
;
/*
/*
* this is our 'private' RAID10 bio.
* this is our 'private' RAID10 bio.
*
*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录