summaryrefslogtreecommitdiffstats
path: root/fs/minix
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2014-10-14 07:57:26 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-07 19:54:38 +0100
commit4ef67a8c95f32ed0c8c6ed5fe01d1dd16358350e (patch)
tree82e66c1da3bbe63345edb27d7e64e3245df729ee /fs/minix
parentsysfs/kernfs: allow attributes to request write buffer be pre-allocated. (diff)
downloadlinux-4ef67a8c95f32ed0c8c6ed5fe01d1dd16358350e.tar.xz
linux-4ef67a8c95f32ed0c8c6ed5fe01d1dd16358350e.zip
sysfs/kernfs: make read requests on pre-alloc files use the buffer.
To match the previous patch which used the pre-alloc buffer for writes, this patch causes reads to use the same buffer. This is not strictly necessary as the current seq_read() will allocate on first read, so user-space can trigger the required pre-alloc. But consistency is valuable. The read function is somewhat simpler than seq_read() and, for example, does not support reading from an offset into the file: reads must be at the start of the file. As seq_read() does not use the prealloc buffer, ->seq_show is incompatible with ->prealloc and caused an EINVAL return from open(). sysfs code which calls into kernfs always chooses the correct function. As the buffer is shared with writes and other reads, the mutex is extended to cover the copy_to_user. Signed-off-by: NeilBrown <neilb@suse.de> Reviewed-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/minix')
0 files changed, 0 insertions, 0 deletions