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
ef43a6db
Commit
ef43a6db
authored
Jan 12, 2003
by
Patrick Mochel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sysfs: restore count parameter to struct sysfs_ops::store().
- Fixup subsys_sysfs_ops along the way.
parent
8deb34fe
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
fs/sysfs/inode.c
fs/sysfs/inode.c
+7
-5
include/linux/kobject.h
include/linux/kobject.h
+1
-1
include/linux/sysfs.h
include/linux/sysfs.h
+1
-1
No files found.
fs/sysfs/inode.c
View file @
ef43a6db
...
...
@@ -167,14 +167,15 @@ subsys_attr_show(struct kobject * kobj, struct attribute * attr, char * page)
}
static
ssize_t
subsys_attr_store
(
struct
kobject
*
kobj
,
struct
attribute
*
attr
,
const
char
*
page
)
subsys_attr_store
(
struct
kobject
*
kobj
,
struct
attribute
*
attr
,
const
char
*
page
,
size_t
count
)
{
struct
subsystem
*
s
=
to_subsys
(
kobj
);
struct
subsys_attribute
*
sattr
=
to_sattr
(
attr
);
ssize_t
ret
=
0
;
if
(
sattr
->
store
)
ret
=
sattr
->
store
(
s
,
page
);
ret
=
sattr
->
store
(
s
,
page
,
count
);
return
ret
;
}
...
...
@@ -322,13 +323,14 @@ fill_write_buffer(struct sysfs_buffer * buffer, const char * buf, size_t count)
* passing the buffer that we acquired in fill_write_buffer().
*/
static
int
flush_write_buffer
(
struct
file
*
file
,
struct
sysfs_buffer
*
buffer
)
static
int
flush_write_buffer
(
struct
file
*
file
,
struct
sysfs_buffer
*
buffer
,
size_t
count
)
{
struct
attribute
*
attr
=
file
->
f_dentry
->
d_fsdata
;
struct
kobject
*
kobj
=
file
->
f_dentry
->
d_parent
->
d_fsdata
;
struct
sysfs_ops
*
ops
=
buffer
->
ops
;
return
ops
->
store
(
kobj
,
attr
,
buffer
->
page
);
return
ops
->
store
(
kobj
,
attr
,
buffer
->
page
,
count
);
}
...
...
@@ -356,7 +358,7 @@ sysfs_write_file(struct file *file, const char *buf, size_t count, loff_t *ppos)
count
=
fill_write_buffer
(
buffer
,
buf
,
count
);
if
(
count
>
0
)
count
=
flush_write_buffer
(
file
,
buffer
);
count
=
flush_write_buffer
(
file
,
buffer
,
count
);
if
(
count
>
0
)
*
ppos
+=
count
;
return
count
;
...
...
include/linux/kobject.h
View file @
ef43a6db
...
...
@@ -166,7 +166,7 @@ static inline void subsys_put(struct subsystem * s)
struct
subsys_attribute
{
struct
attribute
attr
;
ssize_t
(
*
show
)(
struct
subsystem
*
,
char
*
);
ssize_t
(
*
store
)(
struct
subsystem
*
,
const
char
*
);
ssize_t
(
*
store
)(
struct
subsystem
*
,
const
char
*
,
size_t
);
};
extern
int
subsys_create_file
(
struct
subsystem
*
,
struct
subsys_attribute
*
);
...
...
include/linux/sysfs.h
View file @
ef43a6db
...
...
@@ -18,7 +18,7 @@ struct attribute {
struct
sysfs_ops
{
ssize_t
(
*
show
)(
struct
kobject
*
,
struct
attribute
*
,
char
*
);
ssize_t
(
*
store
)(
struct
kobject
*
,
struct
attribute
*
,
const
char
*
);
ssize_t
(
*
store
)(
struct
kobject
*
,
struct
attribute
*
,
const
char
*
,
size_t
);
};
extern
int
...
...
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