diff options
author | Tejun Heo <tj@kernel.org> | 2013-11-28 14:54:16 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-11-29 17:33:46 -0800 |
commit | c2b19daf6760fae9d5db9e9d1683644728888293 (patch) | |
tree | 28baf98d636e4a111790e5a0f52b1f49709d86b3 /lib/hexdump.c | |
parent | 93b2b8e4aa4317e3fe6414d117deb5f3c362e8bb (diff) | |
download | linux-c2b19daf6760fae9d5db9e9d1683644728888293.tar.bz2 |
sysfs, kernfs: prepare read path for kernfs
We're in the process of separating out core sysfs functionality into
kernfs which will deal with sysfs_dirents directly. This patch
rearranges read path so that the kernfs and sysfs parts are separate.
* Regular file read path is refactored such that
kernfs_seq_start/next/stop/show() handle all the boilerplate work
including locking and updating event count for poll, while
sysfs_kf_seq_show() deals with interaction with kobj show method.
* Bin file read path is refactored such that kernfs_file_direct_read()
handles all the boilerplate work including buffer management and
locking, while sysfs_kf_bin_read() deals with interaction with
bin_attribute read method.
kernfs_file_read() is added. It invokes either the seq_file or direct
read path depending on the file type. This will eventually allow
using the same file_operations for both file types, which is necessary
to separate out kernfs.
While this patch changes the order of some operations, it shouldn't
change any visible behavior.
v2: Dropped unnecessary zeroing of @count from sysfs_kf_seq_show().
Add comments explaining single_open() behavior. Both suggested by
Pavel.
v3: seq_stop() is called even after seq_start() failed.
kernfs_seq_start() updated so that it doesn't unlock
sysfs_open_file->mutex on failure so that kernfs_seq_stop()
doesn't try to unlock an already unlocked mutex. Reported by
Fengguang.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/hexdump.c')
0 files changed, 0 insertions, 0 deletions