Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
79df9b40
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
79df9b40
编写于
8月 16, 2012
作者:
J
Jens Axboe
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-jens' of
git://git.drbd.org/linux-drbd
into for-linus
上级
4004e90c
d1aa4d04
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
61 addition
and
23 deletion
+61
-23
drivers/block/drbd/drbd_bitmap.c
drivers/block/drbd/drbd_bitmap.c
+14
-1
drivers/block/drbd/drbd_int.h
drivers/block/drbd/drbd_int.h
+1
-0
drivers/block/drbd/drbd_main.c
drivers/block/drbd/drbd_main.c
+12
-16
drivers/block/drbd/drbd_nl.c
drivers/block/drbd/drbd_nl.c
+2
-2
drivers/block/drbd/drbd_req.c
drivers/block/drbd/drbd_req.c
+32
-4
未找到文件。
drivers/block/drbd/drbd_bitmap.c
浏览文件 @
79df9b40
...
@@ -889,6 +889,7 @@ struct bm_aio_ctx {
...
@@ -889,6 +889,7 @@ struct bm_aio_ctx {
unsigned
int
done
;
unsigned
int
done
;
unsigned
flags
;
unsigned
flags
;
#define BM_AIO_COPY_PAGES 1
#define BM_AIO_COPY_PAGES 1
#define BM_WRITE_ALL_PAGES 2
int
error
;
int
error
;
struct
kref
kref
;
struct
kref
kref
;
};
};
...
@@ -1059,7 +1060,8 @@ static int bm_rw(struct drbd_conf *mdev, int rw, unsigned flags, unsigned lazy_w
...
@@ -1059,7 +1060,8 @@ static int bm_rw(struct drbd_conf *mdev, int rw, unsigned flags, unsigned lazy_w
if
(
lazy_writeout_upper_idx
&&
i
==
lazy_writeout_upper_idx
)
if
(
lazy_writeout_upper_idx
&&
i
==
lazy_writeout_upper_idx
)
break
;
break
;
if
(
rw
&
WRITE
)
{
if
(
rw
&
WRITE
)
{
if
(
bm_test_page_unchanged
(
b
->
bm_pages
[
i
]))
{
if
(
!
(
flags
&
BM_WRITE_ALL_PAGES
)
&&
bm_test_page_unchanged
(
b
->
bm_pages
[
i
]))
{
dynamic_dev_dbg
(
DEV
,
"skipped bm write for idx %u
\n
"
,
i
);
dynamic_dev_dbg
(
DEV
,
"skipped bm write for idx %u
\n
"
,
i
);
continue
;
continue
;
}
}
...
@@ -1140,6 +1142,17 @@ int drbd_bm_write(struct drbd_conf *mdev) __must_hold(local)
...
@@ -1140,6 +1142,17 @@ int drbd_bm_write(struct drbd_conf *mdev) __must_hold(local)
return
bm_rw
(
mdev
,
WRITE
,
0
,
0
);
return
bm_rw
(
mdev
,
WRITE
,
0
,
0
);
}
}
/**
* drbd_bm_write_all() - Write the whole bitmap to its on disk location.
* @mdev: DRBD device.
*
* Will write all pages.
*/
int
drbd_bm_write_all
(
struct
drbd_conf
*
mdev
)
__must_hold
(
local
)
{
return
bm_rw
(
mdev
,
WRITE
,
BM_WRITE_ALL_PAGES
,
0
);
}
/**
/**
* drbd_bm_lazy_write_out() - Write bitmap pages 0 to @upper_idx-1, if they have changed.
* drbd_bm_lazy_write_out() - Write bitmap pages 0 to @upper_idx-1, if they have changed.
* @mdev: DRBD device.
* @mdev: DRBD device.
...
...
drivers/block/drbd/drbd_int.h
浏览文件 @
79df9b40
...
@@ -1469,6 +1469,7 @@ extern int drbd_bm_e_weight(struct drbd_conf *mdev, unsigned long enr);
...
@@ -1469,6 +1469,7 @@ extern int drbd_bm_e_weight(struct drbd_conf *mdev, unsigned long enr);
extern
int
drbd_bm_write_page
(
struct
drbd_conf
*
mdev
,
unsigned
int
idx
)
__must_hold
(
local
);
extern
int
drbd_bm_write_page
(
struct
drbd_conf
*
mdev
,
unsigned
int
idx
)
__must_hold
(
local
);
extern
int
drbd_bm_read
(
struct
drbd_conf
*
mdev
)
__must_hold
(
local
);
extern
int
drbd_bm_read
(
struct
drbd_conf
*
mdev
)
__must_hold
(
local
);
extern
int
drbd_bm_write
(
struct
drbd_conf
*
mdev
)
__must_hold
(
local
);
extern
int
drbd_bm_write
(
struct
drbd_conf
*
mdev
)
__must_hold
(
local
);
extern
int
drbd_bm_write_all
(
struct
drbd_conf
*
mdev
)
__must_hold
(
local
);
extern
int
drbd_bm_write_copy_pages
(
struct
drbd_conf
*
mdev
)
__must_hold
(
local
);
extern
int
drbd_bm_write_copy_pages
(
struct
drbd_conf
*
mdev
)
__must_hold
(
local
);
extern
unsigned
long
drbd_bm_ALe_set_all
(
struct
drbd_conf
*
mdev
,
extern
unsigned
long
drbd_bm_ALe_set_all
(
struct
drbd_conf
*
mdev
,
unsigned
long
al_enr
);
unsigned
long
al_enr
);
...
...
drivers/block/drbd/drbd_main.c
浏览文件 @
79df9b40
...
@@ -79,6 +79,7 @@ static int w_md_sync(struct drbd_conf *mdev, struct drbd_work *w, int unused);
...
@@ -79,6 +79,7 @@ static int w_md_sync(struct drbd_conf *mdev, struct drbd_work *w, int unused);
static
void
md_sync_timer_fn
(
unsigned
long
data
);
static
void
md_sync_timer_fn
(
unsigned
long
data
);
static
int
w_bitmap_io
(
struct
drbd_conf
*
mdev
,
struct
drbd_work
*
w
,
int
unused
);
static
int
w_bitmap_io
(
struct
drbd_conf
*
mdev
,
struct
drbd_work
*
w
,
int
unused
);
static
int
w_go_diskless
(
struct
drbd_conf
*
mdev
,
struct
drbd_work
*
w
,
int
unused
);
static
int
w_go_diskless
(
struct
drbd_conf
*
mdev
,
struct
drbd_work
*
w
,
int
unused
);
static
void
_tl_clear
(
struct
drbd_conf
*
mdev
);
MODULE_AUTHOR
(
"Philipp Reisner <phil@linbit.com>, "
MODULE_AUTHOR
(
"Philipp Reisner <phil@linbit.com>, "
"Lars Ellenberg <lars@linbit.com>"
);
"Lars Ellenberg <lars@linbit.com>"
);
...
@@ -432,20 +433,11 @@ static void _tl_restart(struct drbd_conf *mdev, enum drbd_req_event what)
...
@@ -432,20 +433,11 @@ static void _tl_restart(struct drbd_conf *mdev, enum drbd_req_event what)
/* Actions operating on the disk state, also want to work on
/* Actions operating on the disk state, also want to work on
requests that got barrier acked. */
requests that got barrier acked. */
switch
(
what
)
{
case
fail_frozen_disk_io
:
case
restart_frozen_disk_io
:
list_for_each_safe
(
le
,
tle
,
&
mdev
->
barrier_acked_requests
)
{
list_for_each_safe
(
le
,
tle
,
&
mdev
->
barrier_acked_requests
)
{
req
=
list_entry
(
le
,
struct
drbd_request
,
tl_requests
);
req
=
list_entry
(
le
,
struct
drbd_request
,
tl_requests
);
_req_mod
(
req
,
what
);
_req_mod
(
req
,
what
);
}
}
case
connection_lost_while_pending
:
case
resend
:
break
;
default:
dev_err
(
DEV
,
"what = %d in _tl_restart()
\n
"
,
what
);
}
}
}
...
@@ -458,12 +450,17 @@ static void _tl_restart(struct drbd_conf *mdev, enum drbd_req_event what)
...
@@ -458,12 +450,17 @@ static void _tl_restart(struct drbd_conf *mdev, enum drbd_req_event what)
* receiver thread and the worker thread.
* receiver thread and the worker thread.
*/
*/
void
tl_clear
(
struct
drbd_conf
*
mdev
)
void
tl_clear
(
struct
drbd_conf
*
mdev
)
{
spin_lock_irq
(
&
mdev
->
req_lock
);
_tl_clear
(
mdev
);
spin_unlock_irq
(
&
mdev
->
req_lock
);
}
static
void
_tl_clear
(
struct
drbd_conf
*
mdev
)
{
{
struct
list_head
*
le
,
*
tle
;
struct
list_head
*
le
,
*
tle
;
struct
drbd_request
*
r
;
struct
drbd_request
*
r
;
spin_lock_irq
(
&
mdev
->
req_lock
);
_tl_restart
(
mdev
,
connection_lost_while_pending
);
_tl_restart
(
mdev
,
connection_lost_while_pending
);
/* we expect this list to be empty. */
/* we expect this list to be empty. */
...
@@ -482,7 +479,6 @@ void tl_clear(struct drbd_conf *mdev)
...
@@ -482,7 +479,6 @@ void tl_clear(struct drbd_conf *mdev)
memset
(
mdev
->
app_reads_hash
,
0
,
APP_R_HSIZE
*
sizeof
(
void
*
));
memset
(
mdev
->
app_reads_hash
,
0
,
APP_R_HSIZE
*
sizeof
(
void
*
));
spin_unlock_irq
(
&
mdev
->
req_lock
);
}
}
void
tl_restart
(
struct
drbd_conf
*
mdev
,
enum
drbd_req_event
what
)
void
tl_restart
(
struct
drbd_conf
*
mdev
,
enum
drbd_req_event
what
)
...
@@ -1476,12 +1472,12 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
...
@@ -1476,12 +1472,12 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
if
(
ns
.
susp_fen
)
{
if
(
ns
.
susp_fen
)
{
/* case1: The outdate peer handler is successful: */
/* case1: The outdate peer handler is successful: */
if
(
os
.
pdsk
>
D_OUTDATED
&&
ns
.
pdsk
<=
D_OUTDATED
)
{
if
(
os
.
pdsk
>
D_OUTDATED
&&
ns
.
pdsk
<=
D_OUTDATED
)
{
tl_clear
(
mdev
);
if
(
test_bit
(
NEW_CUR_UUID
,
&
mdev
->
flags
))
{
if
(
test_bit
(
NEW_CUR_UUID
,
&
mdev
->
flags
))
{
drbd_uuid_new_current
(
mdev
);
drbd_uuid_new_current
(
mdev
);
clear_bit
(
NEW_CUR_UUID
,
&
mdev
->
flags
);
clear_bit
(
NEW_CUR_UUID
,
&
mdev
->
flags
);
}
}
spin_lock_irq
(
&
mdev
->
req_lock
);
spin_lock_irq
(
&
mdev
->
req_lock
);
_tl_clear
(
mdev
);
_drbd_set_state
(
_NS
(
mdev
,
susp_fen
,
0
),
CS_VERBOSE
,
NULL
);
_drbd_set_state
(
_NS
(
mdev
,
susp_fen
,
0
),
CS_VERBOSE
,
NULL
);
spin_unlock_irq
(
&
mdev
->
req_lock
);
spin_unlock_irq
(
&
mdev
->
req_lock
);
}
}
...
...
drivers/block/drbd/drbd_nl.c
浏览文件 @
79df9b40
...
@@ -674,7 +674,7 @@ enum determine_dev_size drbd_determine_dev_size(struct drbd_conf *mdev, enum dds
...
@@ -674,7 +674,7 @@ enum determine_dev_size drbd_determine_dev_size(struct drbd_conf *mdev, enum dds
la_size_changed
&&
md_moved
?
"size changed and md moved"
:
la_size_changed
&&
md_moved
?
"size changed and md moved"
:
la_size_changed
?
"size changed"
:
"md moved"
);
la_size_changed
?
"size changed"
:
"md moved"
);
/* next line implicitly does drbd_suspend_io()+drbd_resume_io() */
/* next line implicitly does drbd_suspend_io()+drbd_resume_io() */
err
=
drbd_bitmap_io
(
mdev
,
&
drbd_bm_write
,
err
=
drbd_bitmap_io
(
mdev
,
md_moved
?
&
drbd_bm_write_all
:
&
drbd_bm_write
,
"size changed"
,
BM_LOCKED_MASK
);
"size changed"
,
BM_LOCKED_MASK
);
if
(
err
)
{
if
(
err
)
{
rv
=
dev_size_error
;
rv
=
dev_size_error
;
...
...
drivers/block/drbd/drbd_req.c
浏览文件 @
79df9b40
...
@@ -695,6 +695,12 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
...
@@ -695,6 +695,12 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
break
;
break
;
case
resend
:
case
resend
:
/* Simply complete (local only) READs. */
if
(
!
(
req
->
rq_state
&
RQ_WRITE
)
&&
!
req
->
w
.
cb
)
{
_req_may_be_done
(
req
,
m
);
break
;
}
/* If RQ_NET_OK is already set, we got a P_WRITE_ACK or P_RECV_ACK
/* If RQ_NET_OK is already set, we got a P_WRITE_ACK or P_RECV_ACK
before the connection loss (B&C only); only P_BARRIER_ACK was missing.
before the connection loss (B&C only); only P_BARRIER_ACK was missing.
Trowing them out of the TL here by pretending we got a BARRIER_ACK
Trowing them out of the TL here by pretending we got a BARRIER_ACK
...
@@ -834,6 +840,14 @@ static int drbd_make_request_common(struct drbd_conf *mdev, struct bio *bio, uns
...
@@ -834,6 +840,14 @@ static int drbd_make_request_common(struct drbd_conf *mdev, struct bio *bio, uns
req
->
private_bio
=
NULL
;
req
->
private_bio
=
NULL
;
}
}
if
(
rw
==
WRITE
)
{
if
(
rw
==
WRITE
)
{
/* Need to replicate writes. Unless it is an empty flush,
* which is better mapped to a DRBD P_BARRIER packet,
* also for drbd wire protocol compatibility reasons. */
if
(
unlikely
(
size
==
0
))
{
/* The only size==0 bios we expect are empty flushes. */
D_ASSERT
(
bio
->
bi_rw
&
REQ_FLUSH
);
remote
=
0
;
}
else
remote
=
1
;
remote
=
1
;
}
else
{
}
else
{
/* READ || READA */
/* READ || READA */
...
@@ -870,8 +884,11 @@ static int drbd_make_request_common(struct drbd_conf *mdev, struct bio *bio, uns
...
@@ -870,8 +884,11 @@ static int drbd_make_request_common(struct drbd_conf *mdev, struct bio *bio, uns
* extent. This waits for any resync activity in the corresponding
* extent. This waits for any resync activity in the corresponding
* resync extent to finish, and, if necessary, pulls in the target
* resync extent to finish, and, if necessary, pulls in the target
* extent into the activity log, which involves further disk io because
* extent into the activity log, which involves further disk io because
* of transactional on-disk meta data updates. */
* of transactional on-disk meta data updates.
if
(
rw
==
WRITE
&&
local
&&
!
test_bit
(
AL_SUSPENDED
,
&
mdev
->
flags
))
{
* Empty flushes don't need to go into the activity log, they can only
* flush data for pending writes which are already in there. */
if
(
rw
==
WRITE
&&
local
&&
size
&&
!
test_bit
(
AL_SUSPENDED
,
&
mdev
->
flags
))
{
req
->
rq_state
|=
RQ_IN_ACT_LOG
;
req
->
rq_state
|=
RQ_IN_ACT_LOG
;
drbd_al_begin_io
(
mdev
,
sector
);
drbd_al_begin_io
(
mdev
,
sector
);
}
}
...
@@ -994,6 +1011,9 @@ static int drbd_make_request_common(struct drbd_conf *mdev, struct bio *bio, uns
...
@@ -994,6 +1011,9 @@ static int drbd_make_request_common(struct drbd_conf *mdev, struct bio *bio, uns
if
(
rw
==
WRITE
&&
_req_conflicts
(
req
))
if
(
rw
==
WRITE
&&
_req_conflicts
(
req
))
goto
fail_conflicting
;
goto
fail_conflicting
;
/* no point in adding empty flushes to the transfer log,
* they are mapped to drbd barriers already. */
if
(
likely
(
size
!=
0
))
list_add_tail
(
&
req
->
tl_requests
,
&
mdev
->
newest_tle
->
requests
);
list_add_tail
(
&
req
->
tl_requests
,
&
mdev
->
newest_tle
->
requests
);
/* NOTE remote first: to get the concurrent write detection right,
/* NOTE remote first: to get the concurrent write detection right,
...
@@ -1014,6 +1034,14 @@ static int drbd_make_request_common(struct drbd_conf *mdev, struct bio *bio, uns
...
@@ -1014,6 +1034,14 @@ static int drbd_make_request_common(struct drbd_conf *mdev, struct bio *bio, uns
mdev
->
net_conf
->
on_congestion
!=
OC_BLOCK
&&
mdev
->
agreed_pro_version
>=
96
)
mdev
->
net_conf
->
on_congestion
!=
OC_BLOCK
&&
mdev
->
agreed_pro_version
>=
96
)
maybe_pull_ahead
(
mdev
);
maybe_pull_ahead
(
mdev
);
/* If this was a flush, queue a drbd barrier/start a new epoch.
* Unless the current epoch was empty anyways, or we are not currently
* replicating, in which case there is no point. */
if
(
unlikely
(
bio
->
bi_rw
&
REQ_FLUSH
)
&&
mdev
->
newest_tle
->
n_writes
&&
drbd_should_do_remote
(
mdev
->
state
))
queue_barrier
(
mdev
);
spin_unlock_irq
(
&
mdev
->
req_lock
);
spin_unlock_irq
(
&
mdev
->
req_lock
);
kfree
(
b
);
/* if someone else has beaten us to it... */
kfree
(
b
);
/* if someone else has beaten us to it... */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录