aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenpaging
diff options
context:
space:
mode:
authorOlaf Hering <olaf@aepfle.de>2012-01-27 19:03:37 +0000
committerOlaf Hering <olaf@aepfle.de>2012-01-27 19:03:37 +0000
commit7c4f9f61a2c98b3ae2cd5f898738368e1836fab2 (patch)
treef7b1ef6ceadfe5aa5b6f551100ce08523cf804d2 /tools/xenpaging
parent3fb8faf59e30206d45977e2908c2032d6ec3b3f0 (diff)
downloadxen-7c4f9f61a2c98b3ae2cd5f898738368e1836fab2.tar.gz
xen-7c4f9f61a2c98b3ae2cd5f898738368e1836fab2.tar.bz2
xen-7c4f9f61a2c98b3ae2cd5f898738368e1836fab2.zip
xenpaging: make file_op largefile aware
lseek() takes an off_t, the used "int << shiftsize" does not automatically convert the int into a larger type. This leads to write errors with pagefiles larger than 2G. Fix this by shifting an off_t instead of an int. Signed-off-by: Olaf Hering <olaf@aepfle.de> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/xenpaging')
-rw-r--r--tools/xenpaging/file_ops.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/xenpaging/file_ops.c b/tools/xenpaging/file_ops.c
index 079d2551a8..9351e168bd 100644
--- a/tools/xenpaging/file_ops.c
+++ b/tools/xenpaging/file_ops.c
@@ -26,12 +26,12 @@
static int file_op(int fd, void *page, int i,
ssize_t (*fn)(int, void *, size_t))
{
- off_t seek_ret;
+ off_t offset = i;
int total = 0;
int bytes;
- seek_ret = lseek(fd, i << PAGE_SHIFT, SEEK_SET);
- if ( seek_ret == (off_t)-1 )
+ offset = lseek(fd, offset << PAGE_SHIFT, SEEK_SET);
+ if ( offset == (off_t)-1 )
return -1;
while ( total < PAGE_SIZE )