diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-03-05 19:50:45 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-05-06 23:32:47 +0200 |
commit | 886a39115005ced8b15ab067c9c2a8d546b40a5e (patch) | |
tree | cb72af0480369f31a449aa7a8451d407315c2bf3 /drivers | |
parent | give ->direct_IO() a copy of iov_iter (diff) | |
download | linux-886a39115005ced8b15ab067c9c2a8d546b40a5e.tar.xz linux-886a39115005ced8b15ab067c9c2a8d546b40a5e.zip |
new primitive: iov_iter_alignment()
returns the value aligned as badly as the worst remaining segment
in iov_iter is. Use instead of open-coded equivalents.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/lustre/lustre/llite/rw26.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/staging/lustre/lustre/llite/rw26.c b/drivers/staging/lustre/lustre/llite/rw26.c index 38a5b580e7f0..f718585c9e08 100644 --- a/drivers/staging/lustre/lustre/llite/rw26.c +++ b/drivers/staging/lustre/lustre/llite/rw26.c @@ -391,11 +391,8 @@ static ssize_t ll_direct_IO_26(int rw, struct kiocb *iocb, MAX_DIO_SIZE >> PAGE_CACHE_SHIFT); /* Check that all user buffers are aligned as well */ - for (seg = 0; seg < iter->nr_segs; seg++) { - if (((unsigned long)iter->iov[seg].iov_base & ~CFS_PAGE_MASK) || - (iter->iov[seg].iov_len & ~CFS_PAGE_MASK)) - return -EINVAL; - } + if (iov_iter_alignment(iter) & ~CFS_PAGE_MASK) + return -EINVAL; env = cl_env_get(&refcheck); LASSERT(!IS_ERR(env)); |