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