Commit ef43a6db authored by Patrick Mochel's avatar Patrick Mochel

sysfs: restore count parameter to struct sysfs_ops::store().

- Fixup subsys_sysfs_ops along the way.
parent 8deb34fe
...@@ -167,14 +167,15 @@ subsys_attr_show(struct kobject * kobj, struct attribute * attr, char * page) ...@@ -167,14 +167,15 @@ subsys_attr_show(struct kobject * kobj, struct attribute * attr, char * page)
} }
static ssize_t 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 subsystem * s = to_subsys(kobj);
struct subsys_attribute * sattr = to_sattr(attr); struct subsys_attribute * sattr = to_sattr(attr);
ssize_t ret = 0; ssize_t ret = 0;
if (sattr->store) if (sattr->store)
ret = sattr->store(s,page); ret = sattr->store(s,page,count);
return ret; return ret;
} }
...@@ -322,13 +323,14 @@ fill_write_buffer(struct sysfs_buffer * buffer, const char * buf, size_t count) ...@@ -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(). * 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 attribute * attr = file->f_dentry->d_fsdata;
struct kobject * kobj = file->f_dentry->d_parent->d_fsdata; struct kobject * kobj = file->f_dentry->d_parent->d_fsdata;
struct sysfs_ops * ops = buffer->ops; 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) ...@@ -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); count = fill_write_buffer(buffer,buf,count);
if (count > 0) if (count > 0)
count = flush_write_buffer(file,buffer); count = flush_write_buffer(file,buffer,count);
if (count > 0) if (count > 0)
*ppos += count; *ppos += count;
return count; return count;
......
...@@ -166,7 +166,7 @@ static inline void subsys_put(struct subsystem * s) ...@@ -166,7 +166,7 @@ static inline void subsys_put(struct subsystem * s)
struct subsys_attribute { struct subsys_attribute {
struct attribute attr; struct attribute attr;
ssize_t (*show)(struct subsystem *, char *); 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 *); extern int subsys_create_file(struct subsystem * , struct subsys_attribute *);
......
...@@ -18,7 +18,7 @@ struct attribute { ...@@ -18,7 +18,7 @@ struct attribute {
struct sysfs_ops { struct sysfs_ops {
ssize_t (*show)(struct kobject *, struct attribute *,char *); 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 extern int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment