sysfs: prepare path write for unified regular / bin file handling
authorTejun Heo <tj@kernel.org>
Tue, 1 Oct 2013 21:42:05 +0000 (17:42 -0400)
committerPawel Osmialowski <p.osmialowsk@mcdsrvbld02.digital.local>
Fri, 27 Mar 2015 17:13:10 +0000 (18:13 +0100)
commit10c0fd4c3c0b90f20f324eed035a898079ced9f8
tree8651c8491b76e976e5365617888f7fa2dfeeaf45
parent6ac0ee0ad9c5317269e59d957b3af4518c734561
sysfs: prepare path write for unified regular / bin file handling

sysfs bin file handling will be merged into the regular file support.
This patch prepares the write path.

bin file write is almost identical to regular file write except that
the write length is capped by the inode size and @off is passed to the
write method.  This patch adds bin file handling to sysfs_write_file()
so that it can handle both regular and bin files.

A new file_operations struct sysfs_bin_operations is added, which
currently only hosts sysfs_write_file() and generic_file_llseek().
This isn't used yet but will eventually replace fs/sysfs/bin.c.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/sysfs/file.c
fs/sysfs/sysfs.h