Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
251b6ecc
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
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看板
提交
251b6ecc
编写于
1月 10, 2006
作者:
M
Mark Fasheh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[OCFS2] Make ip_io_sem a mutex
ip_io_sem is now ip_io_mutex. Signed-off-by:
N
Mark Fasheh
<
mark.fasheh@oracle.com
>
上级
aee93ac4
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
18 addition
and
18 deletion
+18
-18
fs/ocfs2/buffer_head_io.c
fs/ocfs2/buffer_head_io.c
+5
-5
fs/ocfs2/inode.c
fs/ocfs2/inode.c
+3
-3
fs/ocfs2/inode.h
fs/ocfs2/inode.h
+2
-2
fs/ocfs2/journal.c
fs/ocfs2/journal.c
+2
-2
fs/ocfs2/super.c
fs/ocfs2/super.c
+1
-1
fs/ocfs2/uptodate.c
fs/ocfs2/uptodate.c
+5
-5
未找到文件。
fs/ocfs2/buffer_head_io.c
浏览文件 @
251b6ecc
...
...
@@ -58,7 +58,7 @@ int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh,
goto
out
;
}
down
(
&
OCFS2_I
(
inode
)
->
ip_io_sem
);
mutex_lock
(
&
OCFS2_I
(
inode
)
->
ip_io_mutex
);
lock_buffer
(
bh
);
set_buffer_uptodate
(
bh
);
...
...
@@ -82,7 +82,7 @@ int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh,
brelse
(
bh
);
}
up
(
&
OCFS2_I
(
inode
)
->
ip_io_sem
);
mutex_unlock
(
&
OCFS2_I
(
inode
)
->
ip_io_mutex
);
out:
mlog_exit
(
ret
);
return
ret
;
...
...
@@ -125,13 +125,13 @@ int ocfs2_read_blocks(struct ocfs2_super *osb, u64 block, int nr,
flags
&=
~
OCFS2_BH_CACHED
;
if
(
inode
)
down
(
&
OCFS2_I
(
inode
)
->
ip_io_sem
);
mutex_lock
(
&
OCFS2_I
(
inode
)
->
ip_io_mutex
);
for
(
i
=
0
;
i
<
nr
;
i
++
)
{
if
(
bhs
[
i
]
==
NULL
)
{
bhs
[
i
]
=
sb_getblk
(
sb
,
block
++
);
if
(
bhs
[
i
]
==
NULL
)
{
if
(
inode
)
up
(
&
OCFS2_I
(
inode
)
->
ip_io_sem
);
mutex_unlock
(
&
OCFS2_I
(
inode
)
->
ip_io_mutex
);
status
=
-
EIO
;
mlog_errno
(
status
);
goto
bail
;
...
...
@@ -220,7 +220,7 @@ int ocfs2_read_blocks(struct ocfs2_super *osb, u64 block, int nr,
ocfs2_set_buffer_uptodate
(
inode
,
bh
);
}
if
(
inode
)
up
(
&
OCFS2_I
(
inode
)
->
ip_io_sem
);
mutex_unlock
(
&
OCFS2_I
(
inode
)
->
ip_io_mutex
);
mlog
(
ML_BH_IO
,
"block=(%"
MLFu64
"), nr=(%d), cached=%s
\n
"
,
block
,
nr
,
(
!
(
flags
&
OCFS2_BH_CACHED
)
||
ignore_cache
)
?
"no"
:
"yes"
);
...
...
fs/ocfs2/inode.c
浏览文件 @
251b6ecc
...
...
@@ -903,10 +903,10 @@ void ocfs2_clear_inode(struct inode *inode)
"Clear inode of %"
MLFu64
", inode is locked
\n
"
,
oi
->
ip_blkno
);
mlog_bug_on_msg
(
down_trylock
(
&
oi
->
ip_io_sem
),
"Clear inode of %"
MLFu64
", io_
sem
is locked
\n
"
,
mlog_bug_on_msg
(
!
mutex_trylock
(
&
oi
->
ip_io_mutex
),
"Clear inode of %"
MLFu64
", io_
mutex
is locked
\n
"
,
oi
->
ip_blkno
);
up
(
&
oi
->
ip_io_sem
);
mutex_unlock
(
&
oi
->
ip_io_mutex
);
/*
* down_trylock() returns 0, down_write_trylock() returns 1
...
...
fs/ocfs2/inode.h
浏览文件 @
251b6ecc
...
...
@@ -46,10 +46,10 @@ struct ocfs2_inode_info
struct
list_head
ip_io_markers
;
int
ip_orphaned_slot
;
struct
semaphore
ip_io_sem
;
struct
mutex
ip_io_mutex
;
/* Used by the journalling code to attach an inode to a
* handle. These are protected by ip_io_
sem
in order to lock
* handle. These are protected by ip_io_
mutex
in order to lock
* out other I/O to the inode until we either commit or
* abort. */
struct
list_head
ip_handle_list
;
...
...
fs/ocfs2/journal.c
浏览文件 @
251b6ecc
...
...
@@ -401,7 +401,7 @@ int ocfs2_journal_access(struct ocfs2_journal_handle *handle,
* j_trans_barrier for us. */
ocfs2_set_inode_lock_trans
(
OCFS2_SB
(
inode
->
i_sb
)
->
journal
,
inode
);
down
(
&
OCFS2_I
(
inode
)
->
ip_io_sem
);
mutex_lock
(
&
OCFS2_I
(
inode
)
->
ip_io_mutex
);
switch
(
type
)
{
case
OCFS2_JOURNAL_ACCESS_CREATE
:
case
OCFS2_JOURNAL_ACCESS_WRITE
:
...
...
@@ -416,7 +416,7 @@ int ocfs2_journal_access(struct ocfs2_journal_handle *handle,
status
=
-
EINVAL
;
mlog
(
ML_ERROR
,
"Uknown access type!
\n
"
);
}
up
(
&
OCFS2_I
(
inode
)
->
ip_io_sem
);
mutex_unlock
(
&
OCFS2_I
(
inode
)
->
ip_io_mutex
);
if
(
status
<
0
)
mlog
(
ML_ERROR
,
"Error %d getting %d access to buffer!
\n
"
,
...
...
fs/ocfs2/super.c
浏览文件 @
251b6ecc
...
...
@@ -932,7 +932,7 @@ static void ocfs2_inode_init_once(void *data,
oi
->
ip_dir_start_lookup
=
0
;
init_rwsem
(
&
oi
->
ip_alloc_sem
);
init_MUTEX
(
&
(
oi
->
ip_io_sem
)
);
mutex_init
(
&
oi
->
ip_io_mutex
);
oi
->
ip_blkno
=
0ULL
;
oi
->
ip_clusters
=
0
;
...
...
fs/ocfs2/uptodate.c
浏览文件 @
251b6ecc
...
...
@@ -388,7 +388,7 @@ static void __ocfs2_set_buffer_uptodate(struct ocfs2_inode_info *oi,
}
}
/* Item insertion is guarded by ip_io_
sem
, so the insertion path takes
/* Item insertion is guarded by ip_io_
mutex
, so the insertion path takes
* advantage of this by not rechecking for a duplicate insert during
* the slow case. Additionally, if the cache needs to be bumped up to
* a tree, the code will not recheck after acquiring the lock --
...
...
@@ -418,7 +418,7 @@ void ocfs2_set_buffer_uptodate(struct inode *inode,
(
unsigned
long
long
)
bh
->
b_blocknr
);
/* No need to recheck under spinlock - insertion is guarded by
* ip_io_
sem
*/
* ip_io_
mutex
*/
spin_lock
(
&
oi
->
ip_lock
);
if
(
ocfs2_insert_can_use_array
(
oi
,
ci
))
{
/* Fast case - it's an array and there's a free
...
...
@@ -440,7 +440,7 @@ void ocfs2_set_buffer_uptodate(struct inode *inode,
/* Called against a newly allocated buffer. Most likely nobody should
* be able to read this sort of metadata while it's still being
* allocated, but this is careful to take ip_io_
sem
anyway. */
* allocated, but this is careful to take ip_io_
mutex
anyway. */
void
ocfs2_set_new_buffer_uptodate
(
struct
inode
*
inode
,
struct
buffer_head
*
bh
)
{
...
...
@@ -451,9 +451,9 @@ void ocfs2_set_new_buffer_uptodate(struct inode *inode,
set_buffer_uptodate
(
bh
);
down
(
&
oi
->
ip_io_sem
);
mutex_lock
(
&
oi
->
ip_io_mutex
);
ocfs2_set_buffer_uptodate
(
inode
,
bh
);
up
(
&
oi
->
ip_io_sem
);
mutex_unlock
(
&
oi
->
ip_io_mutex
);
}
/* Requires ip_lock. */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录