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
nexedi
linux
Commits
01c1180e
Commit
01c1180e
authored
Jan 12, 2003
by
Patrick Mochel
Committed by
Linus Torvalds
Jan 12, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sysfs: Fixup deadline iosched sysfs files.
This reinstates the count parameter to store() methods.
parent
e4679712
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
14 deletions
+8
-14
drivers/block/deadline-iosched.c
drivers/block/deadline-iosched.c
+8
-14
No files found.
drivers/block/deadline-iosched.c
View file @
01c1180e
...
...
@@ -767,7 +767,7 @@ static int deadline_init(request_queue_t *q, elevator_t *e)
struct
deadline_fs_entry
{
struct
attribute
attr
;
ssize_t
(
*
show
)(
struct
deadline_data
*
,
char
*
);
ssize_t
(
*
store
)(
struct
deadline_data
*
,
const
char
*
);
ssize_t
(
*
store
)(
struct
deadline_data
*
,
const
char
*
,
size_t
);
};
static
ssize_t
...
...
@@ -777,13 +777,12 @@ deadline_var_show(unsigned int var, char *page)
}
static
ssize_t
deadline_var_store
(
unsigned
int
*
var
,
const
char
*
page
)
deadline_var_store
(
unsigned
int
*
var
,
const
char
*
page
,
size_t
count
)
{
char
*
p
=
(
char
*
)
page
;
int
ret
=
strlen
(
p
);
*
var
=
simple_strtoul
(
p
,
&
p
,
10
);
return
re
t
;
return
coun
t
;
}
#define SHOW_FUNCTION(__FUNC, __VAR) \
...
...
@@ -799,9 +798,9 @@ SHOW_FUNCTION(deadline_fifobatch_show, dd->fifo_batch);
#undef SHOW_FUNCTION
#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX) \
static ssize_t __FUNC(struct deadline_data *dd, const char *page) \
static ssize_t __FUNC(struct deadline_data *dd, const char *page
, size_t count
) \
{ \
int ret = deadline_var_store(__PTR, (page)
);
\
int ret = deadline_var_store(__PTR, (page)
, count);
\
if (*(__PTR) < (MIN)) \
*(__PTR) = (MIN); \
else if (*(__PTR) > (MAX)) \
...
...
@@ -853,33 +852,28 @@ static struct attribute *default_attrs[] = {
#define to_deadline(atr) container_of((atr), struct deadline_fs_entry, attr)
static
ssize_t
deadline_attr_show
(
struct
kobject
*
kobj
,
struct
attribute
*
attr
,
char
*
page
,
size_t
length
,
loff_t
offset
)
deadline_attr_show
(
struct
kobject
*
kobj
,
struct
attribute
*
attr
,
char
*
page
)
{
elevator_t
*
e
=
container_of
(
kobj
,
elevator_t
,
kobj
);
struct
deadline_fs_entry
*
entry
=
to_deadline
(
attr
);
if
(
!
entry
->
show
)
return
0
;
if
(
offset
)
return
0
;
return
entry
->
show
(
e
->
elevator_data
,
page
);
}
static
ssize_t
deadline_attr_store
(
struct
kobject
*
kobj
,
struct
attribute
*
attr
,
const
char
*
page
,
size_t
length
,
loff_t
offset
)
const
char
*
page
,
size_t
length
)
{
elevator_t
*
e
=
container_of
(
kobj
,
elevator_t
,
kobj
);
struct
deadline_fs_entry
*
entry
=
to_deadline
(
attr
);
if
(
!
entry
->
store
)
return
-
EINVAL
;
if
(
offset
)
return
0
;
return
entry
->
store
(
e
->
elevator_data
,
page
);
return
entry
->
store
(
e
->
elevator_data
,
page
,
length
);
}
static
struct
sysfs_ops
deadline_sysfs_ops
=
{
...
...
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