diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-14 18:31:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-14 18:31:03 -0400 |
commit | ca2ec32658db160745990496f0f4580056a5dc9f (patch) | |
tree | d211f239219c85214da46dc1cbad4184a81d0248 /block | |
parent | 6c8a53c9e6a151fffb07f8b4c34bd1e33dddd467 (diff) | |
parent | fdc81f45e9f57858da6351836507fbcf1b7583ee (diff) |
Merge branch 'for-linus-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs update from Al Viro:
"Part one:
- struct filename-related cleanups
- saner iov_iter_init() replacements (and switching the syscalls to
use of those)
- ntfs switch to ->write_iter() (Anton)
- aio cleanups and splitting iocb into common and async parts
(Christoph)
- assorted fixes (me, bfields, Andrew Elble)
There's a lot more, including the completion of switchover to
->{read,write}_iter(), d_inode/d_backing_inode annotations, f_flags
race fixes, etc, but that goes after #for-davem merge. David has
pulled it, and once it's in I'll send the next vfs pull request"
* 'for-linus-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (35 commits)
sg_start_req(): use import_iovec()
sg_start_req(): make sure that there's not too many elements in iovec
blk_rq_map_user(): use import_single_range()
sg_io(): use import_iovec()
process_vm_access: switch to {compat_,}import_iovec()
switch keyctl_instantiate_key_common() to iov_iter
switch {compat_,}do_readv_writev() to {compat_,}import_iovec()
aio_setup_vectored_rw(): switch to {compat_,}import_iovec()
vmsplice_to_user(): switch to import_iovec()
kill aio_setup_single_vector()
aio: simplify arguments of aio_setup_..._rw()
aio: lift iov_iter_init() into aio_setup_..._rw()
lift iov_iter into {compat_,}do_readv_writev()
NFS: fix BUG() crash in notify_change() with patch to chown_common()
dcache: return -ESTALE not -EBUSY on distributed fs race
NTFS: Version 2.1.32 - Update file write from aio_write to write_iter.
VFS: Add iov_iter_fault_in_multipages_readable()
drop bogus check in file_open_root()
switch security_inode_getattr() to struct path *
constify tomoyo_realpath_from_path()
...
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-map.c | 6 | ||||
-rw-r--r-- | block/scsi_ioctl.c | 12 |
2 files changed, 8 insertions, 10 deletions
diff --git a/block/blk-map.c b/block/blk-map.c index b8d2725324a6..da310a105429 100644 --- a/block/blk-map.c +++ b/block/blk-map.c | |||
@@ -124,10 +124,10 @@ int blk_rq_map_user(struct request_queue *q, struct request *rq, | |||
124 | { | 124 | { |
125 | struct iovec iov; | 125 | struct iovec iov; |
126 | struct iov_iter i; | 126 | struct iov_iter i; |
127 | int ret = import_single_range(rq_data_dir(rq), ubuf, len, &iov, &i); | ||
127 | 128 | ||
128 | iov.iov_base = ubuf; | 129 | if (unlikely(ret < 0)) |
129 | iov.iov_len = len; | 130 | return ret; |
130 | iov_iter_init(&i, rq_data_dir(rq), &iov, 1, len); | ||
131 | 131 | ||
132 | return blk_rq_map_user_iov(q, rq, map_data, &i, gfp_mask); | 132 | return blk_rq_map_user_iov(q, rq, map_data, &i, gfp_mask); |
133 | } | 133 | } |
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index e1f71c396193..55b6f15dac90 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c | |||
@@ -335,16 +335,14 @@ static int sg_io(struct request_queue *q, struct gendisk *bd_disk, | |||
335 | struct iov_iter i; | 335 | struct iov_iter i; |
336 | struct iovec *iov = NULL; | 336 | struct iovec *iov = NULL; |
337 | 337 | ||
338 | ret = rw_copy_check_uvector(-1, hdr->dxferp, hdr->iovec_count, | 338 | ret = import_iovec(rq_data_dir(rq), |
339 | 0, NULL, &iov); | 339 | hdr->dxferp, hdr->iovec_count, |
340 | if (ret < 0) { | 340 | 0, &iov, &i); |
341 | kfree(iov); | 341 | if (ret < 0) |
342 | goto out_free_cdb; | 342 | goto out_free_cdb; |
343 | } | ||
344 | 343 | ||
345 | /* SG_IO howto says that the shorter of the two wins */ | 344 | /* SG_IO howto says that the shorter of the two wins */ |
346 | iov_iter_init(&i, rq_data_dir(rq), iov, hdr->iovec_count, | 345 | iov_iter_truncate(&i, hdr->dxfer_len); |
347 | min_t(unsigned, ret, hdr->dxfer_len)); | ||
348 | 346 | ||
349 | ret = blk_rq_map_user_iov(q, rq, NULL, &i, GFP_KERNEL); | 347 | ret = blk_rq_map_user_iov(q, rq, NULL, &i, GFP_KERNEL); |
350 | kfree(iov); | 348 | kfree(iov); |