Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
4d20a756
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看板
提交
4d20a756
编写于
8月 03, 2016
作者:
M
Martin Brandenburg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
orangefs: add readahead count and size to sysfs
Signed-off-by:
N
Martin Brandenburg
<
martin@omnibond.com
>
上级
ed1e1587
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
115 addition
and
8 deletion
+115
-8
fs/orangefs/orangefs-sysfs.c
fs/orangefs/orangefs-sysfs.c
+115
-8
未找到文件。
fs/orangefs/orangefs-sysfs.c
浏览文件 @
4d20a756
...
...
@@ -73,6 +73,24 @@
* Description:
* Time getattr is valid in milliseconds.
*
* What: /sys/fs/orangefs/readahead_count
* Date: Aug 2016
* Contact: Martin Brandenburg <martin@omnibond.com>
* Description:
* Readahead cache buffer count.
*
* What: /sys/fs/orangefs/readahead_size
* Date: Aug 2016
* Contact: Martin Brandenburg <martin@omnibond.com>
* Description:
* Readahead cache buffer size.
*
* What: /sys/fs/orangefs/readahead_count_size
* Date: Aug 2016
* Contact: Martin Brandenburg <martin@omnibond.com>
* Description:
* Readahead cache buffer count and size.
*
* What: /sys/fs/orangefs/acache/...
* Date: Jun 2015
* Contact: Martin Brandenburg <martin@omnibond.com>
...
...
@@ -836,6 +854,20 @@ static int sysfs_service_op_show(char *kobj_id, char *buf, void *attr)
new_op
->
upcall
.
req
.
param
.
op
=
ORANGEFS_PARAM_REQUEST_OP_PERF_RESET
;
else
if
(
!
strcmp
(
orangefs_attr
->
attr
.
name
,
"readahead_count"
))
new_op
->
upcall
.
req
.
param
.
op
=
ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT
;
else
if
(
!
strcmp
(
orangefs_attr
->
attr
.
name
,
"readahead_size"
))
new_op
->
upcall
.
req
.
param
.
op
=
ORANGEFS_PARAM_REQUEST_OP_READAHEAD_SIZE
;
else
if
(
!
strcmp
(
orangefs_attr
->
attr
.
name
,
"readahead_count_size"
))
new_op
->
upcall
.
req
.
param
.
op
=
ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE
;
}
else
if
(
!
strcmp
(
kobj_id
,
ACACHE_KOBJ_ID
))
{
acache_attr
=
(
struct
acache_orangefs_attribute
*
)
attr
;
...
...
@@ -949,8 +981,17 @@ static int sysfs_service_op_show(char *kobj_id, char *buf, void *attr)
out:
if
(
!
rc
)
{
if
(
strcmp
(
kobj_id
,
PC_KOBJ_ID
))
{
rc
=
scnprintf
(
buf
,
PAGE_SIZE
,
"%d
\n
"
,
(
int
)
new_op
->
downcall
.
resp
.
param
.
u
.
value64
);
if
(
new_op
->
upcall
.
req
.
param
.
op
==
ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE
)
{
rc
=
scnprintf
(
buf
,
PAGE_SIZE
,
"%d %d
\n
"
,
(
int
)
new_op
->
downcall
.
resp
.
param
.
u
.
value32
[
0
],
(
int
)
new_op
->
downcall
.
resp
.
param
.
u
.
value32
[
1
]);
}
else
{
rc
=
scnprintf
(
buf
,
PAGE_SIZE
,
"%d
\n
"
,
(
int
)
new_op
->
downcall
.
resp
.
param
.
u
.
value64
);
}
}
else
{
rc
=
scnprintf
(
buf
,
...
...
@@ -1077,11 +1118,18 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr)
}
/*
* The value we want to send back to userspace is in buf.
* The value we want to send back to userspace is in buf, unless this
* there are two parameters, which is specially handled below.
*/
rc
=
kstrtoint
(
buf
,
0
,
&
val
);
if
(
rc
)
goto
out
;
if
(
strcmp
(
kobj_id
,
ORANGEFS_KOBJ_ID
)
||
strcmp
(((
struct
orangefs_attribute
*
)
attr
)
->
attr
.
name
,
"readahead_count_size"
))
{
rc
=
kstrtoint
(
buf
,
0
,
&
val
);
if
(
rc
)
goto
out
;
}
new_op
->
upcall
.
req
.
param
.
type
=
ORANGEFS_PARAM_REQUEST_SET
;
if
(
!
strcmp
(
kobj_id
,
ORANGEFS_KOBJ_ID
))
{
orangefs_attr
=
(
struct
orangefs_attribute
*
)
attr
;
...
...
@@ -1112,6 +1160,51 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr)
rc
=
0
;
goto
out
;
}
}
else
if
(
!
strcmp
(
orangefs_attr
->
attr
.
name
,
"readahead_count"
))
{
if
((
val
>=
0
))
{
new_op
->
upcall
.
req
.
param
.
op
=
ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT
;
}
else
{
rc
=
0
;
goto
out
;
}
}
else
if
(
!
strcmp
(
orangefs_attr
->
attr
.
name
,
"readahead_size"
))
{
if
((
val
>=
0
))
{
new_op
->
upcall
.
req
.
param
.
op
=
ORANGEFS_PARAM_REQUEST_OP_READAHEAD_SIZE
;
}
else
{
rc
=
0
;
goto
out
;
}
}
else
if
(
!
strcmp
(
orangefs_attr
->
attr
.
name
,
"readahead_count_size"
))
{
int
val1
,
val2
;
rc
=
sscanf
(
buf
,
"%d %d"
,
&
val1
,
&
val2
);
if
(
rc
<
2
)
{
rc
=
0
;
goto
out
;
}
if
((
val1
>=
0
)
&&
(
val2
>=
0
))
{
new_op
->
upcall
.
req
.
param
.
op
=
ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE
;
}
else
{
rc
=
0
;
goto
out
;
}
new_op
->
upcall
.
req
.
param
.
u
.
value32
[
0
]
=
val1
;
new_op
->
upcall
.
req
.
param
.
u
.
value32
[
1
]
=
val2
;
goto
value_set
;
}
else
if
(
!
strcmp
(
orangefs_attr
->
attr
.
name
,
"perf_counter_reset"
))
{
if
((
val
>
0
))
{
new_op
->
upcall
.
req
.
param
.
op
=
ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE
;
}
else
{
rc
=
0
;
goto
out
;
}
}
}
else
if
(
!
strcmp
(
kobj_id
,
ACACHE_KOBJ_ID
))
{
...
...
@@ -1273,9 +1366,8 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr)
goto
out
;
}
new_op
->
upcall
.
req
.
param
.
type
=
ORANGEFS_PARAM_REQUEST_SET
;
new_op
->
upcall
.
req
.
param
.
u
.
value64
=
val
;
value_set:
/*
* The service_operation will return a errno return code on
...
...
@@ -1398,6 +1490,18 @@ static struct orangefs_attribute dcache_timeout_msecs_attribute =
static
struct
orangefs_attribute
getattr_timeout_msecs_attribute
=
__ATTR
(
getattr_timeout_msecs
,
0664
,
int_orangefs_show
,
int_store
);
static
struct
orangefs_attribute
readahead_count_attribute
=
__ATTR
(
readahead_count
,
0664
,
service_orangefs_show
,
service_orangefs_store
);
static
struct
orangefs_attribute
readahead_size_attribute
=
__ATTR
(
readahead_size
,
0664
,
service_orangefs_show
,
service_orangefs_store
);
static
struct
orangefs_attribute
readahead_count_size_attribute
=
__ATTR
(
readahead_count_size
,
0664
,
service_orangefs_show
,
service_orangefs_store
);
static
struct
orangefs_attribute
perf_counter_reset_attribute
=
__ATTR
(
perf_counter_reset
,
0664
,
...
...
@@ -1421,6 +1525,9 @@ static struct attribute *orangefs_default_attrs[] = {
&
slot_timeout_secs_attribute
.
attr
,
&
dcache_timeout_msecs_attribute
.
attr
,
&
getattr_timeout_msecs_attribute
.
attr
,
&
readahead_count_attribute
.
attr
,
&
readahead_size_attribute
.
attr
,
&
readahead_count_size_attribute
.
attr
,
&
perf_counter_reset_attribute
.
attr
,
&
perf_history_size_attribute
.
attr
,
&
perf_time_interval_secs_attribute
.
attr
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录