sysfs: copy bin mmap support from fs/sysfs/bin.c to fs/sysfs/file.c
authorTejun Heo <tj@kernel.org>
Tue, 1 Oct 2013 21:42:07 +0000 (17:42 -0400)
committerPawel Osmialowski <p.osmialowsk@mcdsrvbld02.digital.local>
Fri, 27 Mar 2015 13:37:24 +0000 (14:37 +0100)
commit4beeaeabbfe5d1b664aa6fd050bb480533014e0a
treea9f8e60a2830cea6ea2c4885a50888b8346b16db
parent33a43af6c7237913cef0e9b3e44d12b4856d389b
sysfs: copy bin mmap support from fs/sysfs/bin.c to fs/sysfs/file.c

sysfs bin file handling will be merged into the regular file support.
This patch copies mmap support from bin so that fs/sysfs/file.c can
handle mmapping bin files.

The code is copied mostly verbatim with the following updates.

* ->mmapped and ->vm_ops are added to sysfs_open_file and bin_buffer
  references are replaced with sysfs_open_file ones.

* Symbols are prefixed with sysfs_.

* sysfs_unmap_bin_file() grabs sysfs_open_dirent and traverses
  ->files.  Invocation of this function is added to
  sysfs_addrm_finish().

* sysfs_bin_mmap() is added to sysfs_bin_operations.

This is a preparation and the new mmap path isn't used yet.

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