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)
committerMaciej Wereski <m.wereski@partner.samsung.com>
Tue, 9 Jun 2015 09:31:13 +0000 (11:31 +0200)
commit748ee10c946fc91213afaa79d4c0b8c304caf2a6
tree3873f77358d4da3db0c1cf91616461d8ff399724
parent7b3aa19bf98a7c910b0d2863efdbf6d0289a365c
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