From bbf406da30428a22b4a6d28a7d36dbb786013cfa Mon Sep 17 00:00:00 2001 From: "Ryan C. Underwood" Date: Sun, 6 Mar 2011 10:40:53 +0000 Subject: [PATCH] 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 --- src/vol/ihandle.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/vol/ihandle.h b/src/vol/ihandle.h index 90292a174f..3f863cd2ec 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)