diff options
author | Tejun Heo | 2013-10-01 17:41:56 -0400 |
---|---|---|
committer | Greg Kroah-Hartman | 2013-10-05 11:02:04 -0700 |
commit | aea585ef8fa6516395022e9d2fed6ec5014128bc (patch) | |
tree | bc048cbe87bf5ed3400bb62eccc28a76c8878914 /fs/dcache.c | |
parent | 89e51dab7cb026193714f2858dbce203c98ecdec (diff) |
sysfs: remove sysfs_buffer->needs_read_fill
->needs_read_fill is used to implement the following behaviors.
1. Ensure buffer filling on the first read.
2. Force buffer filling after a write.
3. Force buffer filling after a successful poll.
However, #2 and #3 don't really work as sysfs doesn't reset file
position. While the read buffer would be refilled, the next read
would continue from the position after the last read or write,
requiring an explicit seek to the start for it to be useful, which
makes ->needs_read_fill superflous as read buffer is always refilled
if f_pos == 0.
Update sysfs_read_file() to test buffer->page for #1 instead and
remove ->needs_read_fill. While this changes behavior in extreme
corner cases - e.g. re-reading a sysfs file after seeking to non-zero
position after a write or poll, it's highly unlikely to lead to actual
breakage. This change is to prepare for using seq_file in the read
path.
While at it, reformat a comment in fill_write_buffer().
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Kay Sievers <kay@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/dcache.c')
0 files changed, 0 insertions, 0 deletions