Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
adcf34a2
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看板
提交
adcf34a2
编写于
2月 24, 2016
作者:
M
Mike Marshall
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Orangefs: code sanitation
Signed-off-by:
N
Mike Marshall
<
hubcap@omnibond.com
>
上级
d37c0f30
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
29 addition
and
14 deletion
+29
-14
fs/orangefs/devorangefs-req.c
fs/orangefs/devorangefs-req.c
+1
-1
fs/orangefs/orangefs-kernel.h
fs/orangefs/orangefs-kernel.h
+1
-1
fs/orangefs/super.c
fs/orangefs/super.c
+2
-2
fs/orangefs/waitqueue.c
fs/orangefs/waitqueue.c
+25
-10
未找到文件。
fs/orangefs/devorangefs-req.c
浏览文件 @
adcf34a2
...
...
@@ -590,7 +590,7 @@ static long dispatch_ioctl_command(unsigned int command, unsigned long arg)
* remount all mounted orangefs volumes to regain the lost
* dynamic mount tables (if any) -- NOTE: this is done
* without keeping the superblock list locked due to the
* upcall/downcall waiting. also, the request
semaphore
is
* upcall/downcall waiting. also, the request
mutex
is
* used to ensure that no operations will be serviced until
* all of the remounts are serviced (to avoid ops between
* mounts to fail)
...
...
fs/orangefs/orangefs-kernel.h
浏览文件 @
adcf34a2
...
...
@@ -603,7 +603,7 @@ extern wait_queue_head_t orangefs_bufmap_init_waitq;
#define ORANGEFS_OP_INTERRUPTIBLE 1
/* service_operation() is interruptible */
#define ORANGEFS_OP_PRIORITY 2
/* service_operation() is high priority */
#define ORANGEFS_OP_CANCELLATION 4
/* this is a cancellation */
#define ORANGEFS_OP_NO_
SEMAPHORE 8
/* don't acquire semaphore
*/
#define ORANGEFS_OP_NO_
MUTEX 8
/* don't acquire request_mutex
*/
#define ORANGEFS_OP_ASYNC 16
/* Queue it, but don't wait */
int
service_operation
(
struct
orangefs_kernel_op_s
*
op
,
...
...
fs/orangefs/super.c
浏览文件 @
adcf34a2
...
...
@@ -229,12 +229,12 @@ int orangefs_remount(struct super_block *sb)
new_op
->
upcall
.
req
.
fs_mount
.
orangefs_config_server
);
/*
* we assume that the calling function has already acquire the
* we assume that the calling function has already acquire
d
the
* request_mutex to prevent other operations from bypassing
* this one
*/
ret
=
service_operation
(
new_op
,
"orangefs_remount"
,
ORANGEFS_OP_PRIORITY
|
ORANGEFS_OP_NO_
SEMAPHORE
);
ORANGEFS_OP_PRIORITY
|
ORANGEFS_OP_NO_
MUTEX
);
gossip_debug
(
GOSSIP_SUPER_DEBUG
,
"orangefs_remount: mount got return value of %d
\n
"
,
ret
);
...
...
fs/orangefs/waitqueue.c
浏览文件 @
adcf34a2
...
...
@@ -56,7 +56,6 @@ int service_operation(struct orangefs_kernel_op_s *op,
int
flags
)
{
long
timeout
=
MAX_SCHEDULE_TIMEOUT
;
/* flags to modify behavior */
int
ret
=
0
;
DEFINE_WAIT
(
wait_entry
);
...
...
@@ -74,14 +73,20 @@ int service_operation(struct orangefs_kernel_op_s *op,
current
->
comm
,
current
->
pid
);
if
(
!
(
flags
&
ORANGEFS_OP_NO_SEMAPHORE
))
{
/*
* If ORANGEFS_OP_NO_MUTEX was set in flags, we need to avoid
* aquiring the request_mutex because we're servicing a
* high priority remount operation and the request_mutex is
* already taken.
*/
if
(
!
(
flags
&
ORANGEFS_OP_NO_MUTEX
))
{
if
(
flags
&
ORANGEFS_OP_INTERRUPTIBLE
)
ret
=
mutex_lock_interruptible
(
&
request_mutex
);
else
ret
=
mutex_lock_killable
(
&
request_mutex
);
/*
* check to see if we were interrupted while waiting for
*
semaphore
*
mutex
*/
if
(
ret
<
0
)
{
op
->
downcall
.
status
=
ret
;
...
...
@@ -95,6 +100,7 @@ int service_operation(struct orangefs_kernel_op_s *op,
spin_lock
(
&
orangefs_request_list_lock
);
spin_lock
(
&
op
->
lock
);
set_op_state_waiting
(
op
);
/* add high priority remount op to the front of the line. */
if
(
flags
&
ORANGEFS_OP_PRIORITY
)
list_add
(
&
op
->
list
,
&
orangefs_request_list
);
else
...
...
@@ -109,7 +115,7 @@ int service_operation(struct orangefs_kernel_op_s *op,
}
spin_unlock
(
&
orangefs_request_list_lock
);
if
(
!
(
flags
&
ORANGEFS_OP_NO_
SEMAPHORE
))
if
(
!
(
flags
&
ORANGEFS_OP_NO_
MUTEX
))
mutex_unlock
(
&
request_mutex
);
ret
=
wait_for_matching_downcall
(
op
,
timeout
,
...
...
@@ -132,10 +138,17 @@ int service_operation(struct orangefs_kernel_op_s *op,
/* failed to get matching downcall */
if
(
ret
==
-
ETIMEDOUT
)
{
gossip_err
(
"orangefs: %s -- wait timed out; aborting attempt.
\n
"
,
gossip_err
(
"%s: %s -- wait timed out; aborting attempt.
\n
"
,
__func__
,
op_name
);
}
/*
* remove waiting ops from the request list or
* remove in-progress ops from the in-progress list.
*/
orangefs_clean_up_interrupted_operation
(
op
);
op
->
downcall
.
status
=
ret
;
/* retry if operation has not been serviced and if requested */
if
(
ret
==
-
EAGAIN
)
{
...
...
@@ -148,11 +161,12 @@ int service_operation(struct orangefs_kernel_op_s *op,
op_name
,
op
->
attempts
);
/*
* io ops (ops that use the shared memory buffer) have
* to be returned to their caller for a retry. Other ops
* can just be recycled here.
*/
if
(
!
op
->
uses_shared_memory
)
/*
* this operation doesn't use the shared memory
* system
*/
goto
retry_servicing
;
}
...
...
@@ -268,7 +282,8 @@ static int wait_for_matching_downcall(struct orangefs_kernel_op_s *op,
long
n
;
if
(
interruptible
)
n
=
wait_for_completion_interruptible_timeout
(
&
op
->
waitq
,
timeout
);
n
=
wait_for_completion_interruptible_timeout
(
&
op
->
waitq
,
timeout
);
else
n
=
wait_for_completion_killable_timeout
(
&
op
->
waitq
,
timeout
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录