From 0db20a591a067276f49f7a3347372c875e0b898f Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Fri, 27 May 2011 10:27:03 -0400 Subject: [PATCH] volinfo: fix file size data type Use afs_sfsize_t for file size instead of int. Reviewed-on: http://gerrit.openafs.org/4737 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit 8eddff4b785a196b2aae8be2d3a0e75fa3b6c0cf) Change-Id: I670949abbb9ebfd652bb8baddcef47c7bad1b211 Reviewed-on: http://gerrit.openafs.org/11255 Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Stephan Wiesand --- src/vol/vol-info.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/vol/vol-info.c b/src/vol/vol-info.c index ad1877d65..9700295ac 100644 --- a/src/vol/vol-info.c +++ b/src/vol/vol-info.c @@ -798,16 +798,21 @@ NT_date(FILETIME * ft) #endif static int -GetFileInfo(FD_t fd, int *size, char **ctime, char **mtime, char **atime) +GetFileInfo(FD_t fd, afs_sfsize_t * size, char **ctime, char **mtime, + char **atime) { #ifdef AFS_NT40_ENV BY_HANDLE_FILE_INFORMATION fi; + LARGE_INTEGER fsize; if (!GetFileInformationByHandle(fd, &fi)) { - fprintf(stderr, "%s: GetFileInformationByHandle failed\n", - progname); + fprintf(stderr, "%s: GetFileInformationByHandle failed\n", progname); + return -1; + } + if (!GetFileSizeEx(fd, &fsize)) { + fprintf(stderr, "%s: GetFileSizeEx failed\n", progname); return -1; } - *size = (int)fi.nFileSizeLow; + *size = fsize.QuadPart; *ctime = "N/A"; *mtime = NT_date(&fi.ftLastWriteTime); *atime = NT_date(&fi.ftLastAccessTime); @@ -817,7 +822,7 @@ GetFileInfo(FD_t fd, int *size, char **ctime, char **mtime, char **atime) fprintf(stderr, "%s: fstat failed %d\n", progname, errno); return -1; } - *size = (int)status.st_size; + *size = status.st_size; *ctime = date(status.st_ctime); *mtime = date(status.st_mtime); *atime = date(status.st_atime); @@ -912,12 +917,13 @@ HandleVnodes(Volume * vp, VnodeClass class) char buf[SIZEOF_LARGEDISKVNODE]; struct VnodeDiskObject *vnode = (struct VnodeDiskObject *)buf; StreamHandle_t *file = NULL; - int vnodeIndex, nVnodes; + int vnodeIndex; + afs_sfsize_t nVnodes; afs_foff_t offset = 0; Inode ino; IHandle_t *ih = vp->vnodeIndex[class].handle; FdHandle_t *fdP = NULL; - int size; + afs_sfsize_t size; char *ctime, *atime, *mtime; /* print vnode table heading */ -- 2.39.5