diff options
| author | Patrick Mochel <mochel@osdl.org> | 2003-01-09 04:41:35 -0600 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2003-01-09 04:41:35 -0600 |
| commit | 82cd7fff8d7411756775909f089d8b44f54018b9 (patch) | |
| tree | fbd8eb65c084f97e755158866cd1727c7c418b03 | |
| parent | 71074f8cd54cdeae46f26b8e5928fcea4380d1b3 (diff) | |
sysfs: remove count and off parameters from sysfs_ops methods.
The previous sysfs change implies that the show() and store() methods in
struct sysfs_ops are called only once, during the first read() or write().
This means that off is always 0, and count should always be PAGE_SIZE, to
fill or clear the entire buffer in one shot.
Therefore, those parameters can be removed from all attribute read/write
methods.
This changeset removes them from the definition and fixes sysfs to deal
with that appropriately.
| -rw-r--r-- | fs/sysfs/inode.c | 16 | ||||
| -rw-r--r-- | include/linux/sysfs.h | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 4cc55562161e..69fe8ccfda3e 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c @@ -154,27 +154,27 @@ static int sysfs_symlink(struct inode * dir, struct dentry *dentry, const char * * These operations allow subsystems to have files that can be * read/written. */ -ssize_t subsys_attr_show(struct kobject * kobj, struct attribute * attr, - char * page, size_t count, loff_t off) +static ssize_t +subsys_attr_show(struct kobject * kobj, struct attribute * attr, char * page) { struct subsystem * s = to_subsys(kobj); struct subsys_attribute * sattr = to_sattr(attr); ssize_t ret = 0; if (sattr->show) - ret = sattr->show(s,page,count,off); + ret = sattr->show(s,page,PAGE_SIZE,0); return ret; } -ssize_t subsys_attr_store(struct kobject * kobj, struct attribute * attr, - const char * page, size_t count, loff_t off) +static ssize_t +subsys_attr_store(struct kobject * kobj, struct attribute * attr, const char * page) { 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,count,off); + ret = sattr->store(s,page,PAGE_SIZE,0); return ret; } @@ -215,7 +215,7 @@ static int fill_read_buffer(struct file * file, struct sysfs_buffer * buffer) if (!buffer->page) return -ENOMEM; - count = ops->show(kobj,attr,buffer->page,PAGE_SIZE,0); + count = ops->show(kobj,attr,buffer->page); if (count >= 0) buffer->count = count; else @@ -328,7 +328,7 @@ static int flush_write_buffer(struct file * file, struct sysfs_buffer * buffer) struct kobject * kobj = file->f_dentry->d_parent->d_fsdata; struct sysfs_ops * ops = buffer->ops; - return ops->store(kobj,attr,buffer->page,PAGE_SIZE,0); + return ops->store(kobj,attr,buffer->page); } diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 29c3eb8d2c9e..b3cc047255b8 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -17,8 +17,8 @@ struct attribute { }; struct sysfs_ops { - ssize_t (*show)(struct kobject *, struct attribute *,char *, size_t, loff_t); - ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t, loff_t); + ssize_t (*show)(struct kobject *, struct attribute *,char *); + ssize_t (*store)(struct kobject *,struct attribute *,const char *); }; extern int |
