diff options
| author | Patrick Mochel <mochel@osdl.org> | 2003-01-12 21:58:45 -0600 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2003-01-12 21:58:45 -0600 |
| commit | ef43a6db37115d40bc5ce560ec26c65bf1688f73 (patch) | |
| tree | 2837391532dccd5762de61fade9bd43e76d3724d | |
| parent | 8deb34fe8baddbf7b431fd66d8b4ee18d805cd63 (diff) | |
sysfs: restore count parameter to struct sysfs_ops::store().
- Fixup subsys_sysfs_ops along the way.
| -rw-r--r-- | fs/sysfs/inode.c | 12 | ||||
| -rw-r--r-- | include/linux/kobject.h | 2 | ||||
| -rw-r--r-- | include/linux/sysfs.h | 2 |
3 files changed, 9 insertions, 7 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 4197afcc69e2..f5d99df6aee2 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c @@ -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; diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 0cc01658044d..409d2af385cb 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -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 *); diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index b3cc047255b8..6a4cb2ffeaa9 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -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 |
