Skip to content

Commit

Permalink
sysfs: merge regular and bin file handling
Browse files Browse the repository at this point in the history
With the previous changes, sysfs regular file code is ready to handle
bin files too.  This patch makes bin files share the regular file
path.

* sysfs_create/remove_bin_file() are moved to fs/sysfs/file.c.

* sysfs_init_inode() is updated to use the new sysfs_bin_operations
  instead of bin_fops for bin files.

* fs/sysfs/bin.c and the related pieces are removed.

This patch shouldn't introduce any behavior difference to bin file
accesses.

Overall, this unification reduces the amount of duplicate logic, makes
behaviors more consistent and paves the road for building simpler and
more versatile interface which will allow other subsystems to make use
of sysfs for their pseudo filesystems.

v2: Stale fs/sysfs/bin.c reference dropped from
    Documentation/DocBook/filesystems.tmpl.  Reported by kbuild test
    robot.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Kay Sievers <kay@vrfy.org>
Cc: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Tejun Heo authored and Greg Kroah-Hartman committed Oct 6, 2013
1 parent 49fe604 commit 3124eb1
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 502 deletions.
1 change: 0 additions & 1 deletion Documentation/DocBook/filesystems.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
<title>The Filesystem for Exporting Kernel Objects</title>
!Efs/sysfs/file.c
!Efs/sysfs/symlink.c
!Efs/sysfs/bin.c
</chapter>

<chapter id="debugfs">
Expand Down
3 changes: 1 addition & 2 deletions fs/sysfs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
# Makefile for the sysfs virtual filesystem
#

obj-y := inode.o file.o dir.o symlink.o mount.o bin.o \
group.o
obj-y := inode.o file.o dir.o symlink.o mount.o group.o
Loading

0 comments on commit 3124eb1

Please sign in to comment.