]> git.hungrycats.org Git - linux/commitdiff
sysfs: restore count parameter to struct sysfs_ops::store().
authorPatrick Mochel <mochel@osdl.org>
Mon, 13 Jan 2003 03:58:45 +0000 (21:58 -0600)
committerPatrick Mochel <mochel@osdl.org>
Mon, 13 Jan 2003 03:58:45 +0000 (21:58 -0600)
- Fixup subsys_sysfs_ops along the way.

fs/sysfs/inode.c
include/linux/kobject.h
include/linux/sysfs.h

index 4197afcc69e211777a14693f7279a03864e3cfd2..f5d99df6aee21d95be409cdbb9fa79aa0f6681a1 100644 (file)
@@ -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;
index 0cc01658044dde3edda19ed1360ff74face44258..409d2af385cb81eecd11765519055729255d804d 100644 (file)
@@ -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 *);
index b3cc047255b8c53633b5339836caa45fa75bfedb..6a4cb2ffeaa9a0d6ca8ec70978f06a06b206fd89 100644 (file)
@@ -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