From: Ryan C. Underwood Date: Sun, 6 Mar 2011 10:40:53 +0000 (+0000) Subject: Fix positional I/O support for largefiles X-Git-Tag: upstream/1.8.0_pre1^2~4091 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=bbf406da30428a22b4a6d28a7d36dbb786013cfa;p=packages%2Fo%2Fopenafs.git Fix positional I/O support for largefiles Commit 335ccb40 introduced positional I/O support for the fileserver, but didn't handle the largefile versions of preadv and pwritev. As a result, the fileserver cannot handle files of more than 2Gb in size. Fix this by using preadv64 and pwritev64 where O_LARGEFILE is defined, in the same way as for all other I/O primitives. Change-Id: Ia9f6411d0c8115176e1ec42dd9f72c96ba939bab Reviewed-by: Simon Wilkinson Reviewed-on: http://gerrit.openafs.org/4152 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/vol/ihandle.h b/src/vol/ihandle.h index 90292a174..3f863cd2e 100644 --- a/src/vol/ihandle.h +++ b/src/vol/ihandle.h @@ -528,8 +528,13 @@ extern afs_sfsize_t ih_size(FD_t); #endif #ifdef HAVE_PIOV +#ifdef O_LARGEFILE +#define FDH_PREADV(H, I, N, O) preadv64((H)->fd_fd, I, N, O) +#define FDH_PWRITEV(H, I, N, O) pwritev64((H)->fd_fd, I, N, O) +#else /* !O_LARGEFILE */ #define FDH_PREADV(H, I, N, O) preadv((H)->fd_fd, I, N, O) #define FDH_PWRITEV(H, I, N, O) pwritev((H)->fd_fd, I, N, O) +#endif /* !O_LARGEFILE */ #endif #define FDH_PREAD(H, B, S, O) OS_PREAD((H)->fd_fd, B, S, O)