Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
4d20a756
Commit
4d20a756
authored
Aug 03, 2016
by
Martin Brandenburg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
orangefs: add readahead count and size to sysfs
Signed-off-by:
Martin Brandenburg
<
martin@omnibond.com
>
parent
ed1e1587
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
115 additions
and
8 deletions
+115
-8
fs/orangefs/orangefs-sysfs.c
fs/orangefs/orangefs-sysfs.c
+115
-8
No files found.
fs/orangefs/orangefs-sysfs.c
View file @
4d20a756
...
@@ -73,6 +73,24 @@
...
@@ -73,6 +73,24 @@
* Description:
* Description:
* Time getattr is valid in milliseconds.
* 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/...
* What: /sys/fs/orangefs/acache/...
* Date: Jun 2015
* Date: Jun 2015
* Contact: Martin Brandenburg <martin@omnibond.com>
* Contact: Martin Brandenburg <martin@omnibond.com>
...
@@ -836,6 +854,20 @@ static int sysfs_service_op_show(char *kobj_id, char *buf, void *attr)
...
@@ -836,6 +854,20 @@ static int sysfs_service_op_show(char *kobj_id, char *buf, void *attr)
new_op
->
upcall
.
req
.
param
.
op
=
new_op
->
upcall
.
req
.
param
.
op
=
ORANGEFS_PARAM_REQUEST_OP_PERF_RESET
;
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
))
{
}
else
if
(
!
strcmp
(
kobj_id
,
ACACHE_KOBJ_ID
))
{
acache_attr
=
(
struct
acache_orangefs_attribute
*
)
attr
;
acache_attr
=
(
struct
acache_orangefs_attribute
*
)
attr
;
...
@@ -949,8 +981,17 @@ static int sysfs_service_op_show(char *kobj_id, char *buf, void *attr)
...
@@ -949,8 +981,17 @@ static int sysfs_service_op_show(char *kobj_id, char *buf, void *attr)
out:
out:
if
(
!
rc
)
{
if
(
!
rc
)
{
if
(
strcmp
(
kobj_id
,
PC_KOBJ_ID
))
{
if
(
strcmp
(
kobj_id
,
PC_KOBJ_ID
))
{
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
"
,
rc
=
scnprintf
(
buf
,
PAGE_SIZE
,
"%d
\n
"
,
(
int
)
new_op
->
downcall
.
resp
.
param
.
u
.
value64
);
(
int
)
new_op
->
downcall
.
resp
.
param
.
u
.
value64
);
}
}
else
{
}
else
{
rc
=
scnprintf
(
rc
=
scnprintf
(
buf
,
buf
,
...
@@ -1077,11 +1118,18 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr)
...
@@ -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.
*/
*/
if
(
strcmp
(
kobj_id
,
ORANGEFS_KOBJ_ID
)
||
strcmp
(((
struct
orangefs_attribute
*
)
attr
)
->
attr
.
name
,
"readahead_count_size"
))
{
rc
=
kstrtoint
(
buf
,
0
,
&
val
);
rc
=
kstrtoint
(
buf
,
0
,
&
val
);
if
(
rc
)
if
(
rc
)
goto
out
;
goto
out
;
}
new_op
->
upcall
.
req
.
param
.
type
=
ORANGEFS_PARAM_REQUEST_SET
;
if
(
!
strcmp
(
kobj_id
,
ORANGEFS_KOBJ_ID
))
{
if
(
!
strcmp
(
kobj_id
,
ORANGEFS_KOBJ_ID
))
{
orangefs_attr
=
(
struct
orangefs_attribute
*
)
attr
;
orangefs_attr
=
(
struct
orangefs_attribute
*
)
attr
;
...
@@ -1112,6 +1160,51 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr)
...
@@ -1112,6 +1160,51 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr)
rc
=
0
;
rc
=
0
;
goto
out
;
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
))
{
}
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)
...
@@ -1273,9 +1366,8 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr)
goto
out
;
goto
out
;
}
}
new_op
->
upcall
.
req
.
param
.
type
=
ORANGEFS_PARAM_REQUEST_SET
;
new_op
->
upcall
.
req
.
param
.
u
.
value64
=
val
;
new_op
->
upcall
.
req
.
param
.
u
.
value64
=
val
;
value_set:
/*
/*
* The service_operation will return a errno return code on
* The service_operation will return a errno return code on
...
@@ -1398,6 +1490,18 @@ static struct orangefs_attribute dcache_timeout_msecs_attribute =
...
@@ -1398,6 +1490,18 @@ static struct orangefs_attribute dcache_timeout_msecs_attribute =
static
struct
orangefs_attribute
getattr_timeout_msecs_attribute
=
static
struct
orangefs_attribute
getattr_timeout_msecs_attribute
=
__ATTR
(
getattr_timeout_msecs
,
0664
,
int_orangefs_show
,
int_store
);
__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
=
static
struct
orangefs_attribute
perf_counter_reset_attribute
=
__ATTR
(
perf_counter_reset
,
__ATTR
(
perf_counter_reset
,
0664
,
0664
,
...
@@ -1421,6 +1525,9 @@ static struct attribute *orangefs_default_attrs[] = {
...
@@ -1421,6 +1525,9 @@ static struct attribute *orangefs_default_attrs[] = {
&
slot_timeout_secs_attribute
.
attr
,
&
slot_timeout_secs_attribute
.
attr
,
&
dcache_timeout_msecs_attribute
.
attr
,
&
dcache_timeout_msecs_attribute
.
attr
,
&
getattr_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_counter_reset_attribute
.
attr
,
&
perf_history_size_attribute
.
attr
,
&
perf_history_size_attribute
.
attr
,
&
perf_time_interval_secs_attribute
.
attr
,
&
perf_time_interval_secs_attribute
.
attr
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment