LU-6260 llite: add support for direct IO api changes
For the 3.16 kernels the direct_IO api changed which
breaks the lustre build. This patch adds support back
for direct IO on newer kernels. Backported from the
upstream lustre client.
------------------------------------------------------
Linux-commit:
d8d3d94b80aa1a1c0ca75c58b8abdc7356f38418
pass iov_iter to ->direct_IO()
unmodified, for now
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
------------------------------------------------------
Linux-commit:
a6cbcd4a4a85e2fdb0b3344b88df2e8b3d526b9e
get rid of pointless iov_length() in ->direct_IO()
all callers have iov_length(iter->iov, iter->nr_segs) == iov_iter_count(iter)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
------------------------------------------------------
Linux-commit:
886a39115005ced8b15ab067c9c2a8d546b40a5e
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>
------------------------------------------------------
Linux-commit:
91f79c43d1b54d7154b118860d81b39bad07dfff
new helper: iov_iter_get_pages_alloc()
same as iov_iter_get_pages(), except that pages array is allocated
(kmalloc if possible, vmalloc if that fails) and left for caller to
free. Lustre and NFS ->direct_IO() switched to it.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
------------------------------------------------------
Linux-commit:
1d8cb70c7bdda47125ed551fc390aa9597c5f264
drivers: staging: lustre: Fix space required after that ',' errors
Fix checkpatch.pl space required after that ',' errors
Signed-off-by: Greg Donald <gdonald@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
------------------------------------------------------
Linux-commit:
ef96fdddcd386c88fee1f2078a174943472b615e
staging: lustre: lustre: llite: use DIV_ROUND_UP
The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /
(d)) but is perhaps more readable.
Coccinelle script used :
// <smpl>
@haskernel@
@@
@depends on haskernel@
expression n,d;
@@
(
- (n + d - 1) / d
+ DIV_ROUND_UP(n,d)
|
- (n + (d - 1)) / d
+ DIV_ROUND_UP(n,d)
)
@depends on haskernel@
expression n,d;
expression n,d;
@@
- DIV_ROUND_UP(n,(d))
+ DIV_ROUND_UP(n,d)
// </smpl>
Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
------------------------------------------------------
Linux-commit:
9fb186cf6907ba4e873d8396d7e5abfa4f22ca4e
Staging: Lustre: rw26.c: include according to checkpatch.pl
Signed-off-by: Georges-Axel Jaloyan <georges-axel.jaloyan@ens.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
------------------------------------------------------
Linux-commit:
6f67376318abea58589ebe6d69dffeabb6f6c26a
direct_IO: use iov_iter_rw() instead of rw everywhere
The rw parameter to direct_IO is redundant with iov_iter->type, and
treated slightly differently just about everywhere it's used: some users
do rw & WRITE, and others do rw == WRITE where they should be doing a
bitwise check. Simplify this with the new iov_iter_rw() helper, which
always returns either READ or WRITE.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
------------------------------------------------------
Linux-commit:
22c6186ecea0be9eff1c399298ad36e94a59995f
direct_IO: remove rw from a_ops->direct_IO()
Now that no one is using rw, remove it completely.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
------------------------------------------------------
Change-Id: I683e02a0952aec2d8fe387cf3ddaf75010858c7c
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: http://review.whamcloud.com/14665
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Thomas Stibor <t.stibor@gsi.de>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>