]> git.karo-electronics.de Git - karo-tx-linux.git/commit
iov_iter: add a shorten call
authorZach Brown <zab@zabbo.net>
Fri, 14 Jun 2013 20:54:14 +0000 (15:54 -0500)
committerDave Kleikamp <dave.kleikamp@oracle.com>
Fri, 9 Aug 2013 21:43:32 +0000 (16:43 -0500)
commit581f9a2ac5a5ebd4f8dacae0077a5c723b50a868
tree6ed79e34ab3f0a0bd819eb48cc37ded05162560d
parentced14e6633cac6b245f8e501d881a95a4e60a25a
iov_iter: add a shorten call

The generic direct write path wants to shorten its memory vector.  It
does this when it finds that it has to perform a partial write due to
LIMIT_FSIZE.  .direct_IO() always performs IO on all of the referenced
memory because it doesn't have an argument to specify the length of the
IO.

We add an iov_iter operation for this so that the generic path can ask
to shorten the memory vector without having to know what kind it is.
We're happy to shorten the kernel copy of the iovec array, but we refuse
to shorten the bio_vec array and return an error in this case.

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Cc: Zach Brown <zab@zabbo.net>
fs/iov-iter.c
include/linux/fs.h