Index: openafs/src/vol/Makefile.in =================================================================== diff -c -r1.19 -r1.20 *** openafs/src/vol/Makefile.in 2004/12/01 22:53:30 1.19 --- openafs/src/vol/Makefile.in 2005/11/01 16:42:47 1.20 *************** *** 147,152 **** --- 147,155 ---- hp?00_ux101 | hp_ux10? ) \ ${CC} ${CFLAGS} -D_FILE64 -c ${srcdir}/listinodes.c \ ;; \ + hp_ux11* ) \ + ${CC} ${CFLAGS} -D_FILE_OFFSET_BITS=64 -c ${srcdir}/listinodes.c \ + ;; \ * ) ${CC} ${CFLAGS} -c ${srcdir}/listinodes.c \ ;; \ esac Index: openafs/src/vol/listinodes.c =================================================================== diff -c -r1.15 -r1.16 *** openafs/src/vol/listinodes.c 2005/04/03 18:09:35 1.15 --- openafs/src/vol/listinodes.c 2005/11/01 16:42:47 1.16 *************** *** 109,114 **** --- 109,136 ---- #endif #include "partition.h" + /*@+fcnmacros +macrofcndecl@*/ + #ifdef O_LARGEFILE + #ifdef S_SPLINT_S + extern off64_t afs_lseek(int FD, off64_t O, int F); + #endif /*S_SPLINT_S */ + #define afs_lseek(FD, O, F) lseek64(FD, (off64_t) (O), F) + #define afs_stat stat64 + #define afs_fstat fstat64 + #define afs_open open64 + #define afs_fopen fopen64 + #else /* !O_LARGEFILE */ + #ifdef S_SPLINT_S + extern off_t afs_lseek(int FD, off_t O, int F); + #endif /*S_SPLINT_S */ + #define afs_lseek(FD, O, F) lseek(FD, (off_t) (O), F) + #define afs_stat stat + #define afs_fstat fstat + #define afs_open open + #define afs_fopen fopen + #endif /* !O_LARGEFILE */ + /*@=fcnmacros =macrofcndecl@*/ + /* Notice: parts of this module have been cribbed from vfsck.c */ #define ROOTINODE 2 *************** *** 248,254 **** fmax = fs.s_fsize / (FSBSIZE / 512); /* first invalid blk num */ ! pfd = open(rdev, O_RDONLY); if (pfd < 0) { Log("Unable to open `%s' inode for reading\n", rdev); return -1; --- 270,276 ---- fmax = fs.s_fsize / (FSBSIZE / 512); /* first invalid blk num */ ! pfd = afs_open(rdev, O_RDONLY); if (pfd < 0) { Log("Unable to open `%s' inode for reading\n", rdev); return -1; *************** *** 359,365 **** { int pfd; ! pfd = open(devName, O_RDONLY); if (pfd < 0) { Log("Unable to open inode on %s for reading superblock.\n", devName); return -1; --- 381,387 ---- { int pfd; ! pfd = afs_open(devName, O_RDONLY); if (pfd < 0) { Log("Unable to open inode on %s for reading superblock.\n", devName); return -1; *************** *** 797,803 **** int_to_base64(stmp, renames[i].uniq)); for (tag = 2, j = 0; j < 64; tag++, j++) { (void)sprintf(npath, "%s.%s", nbase, int_to_base64(stmp, tag)); ! fd = open(npath, O_CREAT | O_EXCL | O_RDWR, 0); if (fd > 0) { close(fd); break; --- 819,825 ---- int_to_base64(stmp, renames[i].uniq)); for (tag = 2, j = 0; j < 64; tag++, j++) { (void)sprintf(npath, "%s.%s", nbase, int_to_base64(stmp, tag)); ! fd = afs_open(npath, O_CREAT | O_EXCL | O_RDWR, 0); if (fd > 0) { close(fd); break; *************** *** 1145,1151 **** sleep(10); #endif ! pfd = open(rdev, O_RDONLY); if (pfd <= 0) { sprintf(err1, "Could not open device %s to get inode list\n", rdev); perror(err1); --- 1167,1173 ---- sleep(10); #endif ! pfd = afs_open(rdev, O_RDONLY); if (pfd <= 0) { sprintf(err1, "Could not open device %s to get inode list\n", rdev); perror(err1); *************** *** 1286,1295 **** i = c * sblock.fs_ipg; e = i + sblock.fs_ipg; #if defined(AFS_HPUX102_ENV) ! if (lseek(pfd, dbtoo(fsbtodb(&sblock, itod(&sblock, i))), L_SET) == -1) { #else ! if (lseek(pfd, dbtob(fsbtodb(&sblock, itod(&sblock, i))), L_SET) == -1) { #endif #else --- 1308,1317 ---- i = c * sblock.fs_ipg; e = i + sblock.fs_ipg; #if defined(AFS_HPUX102_ENV) ! if (afs_lseek(pfd, dbtoo(fsbtodb(&sblock, itod(&sblock, i))), L_SET) == -1) { #else ! if (afs_lseek(pfd, dbtob(fsbtodb(&sblock, itod(&sblock, i))), L_SET) == -1) { #endif #else *************** *** 1307,1320 **** e = i + super.fs.fs_ipg; #ifdef AFS_OSF_ENV dblk1 = fsbtodb(&super.fs, itod(&super.fs, i)); ! if (lseek(pfd, (off_t) ((off_t) dblk1 * DEV_BSIZE), L_SET) == -1) { #else #if defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) f1 = fsbtodb(&super.fs, itod(&super.fs, i)); off = (offset_t) f1 << DEV_BSHIFT; if (llseek(pfd, off, L_SET) == -1) { #else ! if (lseek(pfd, dbtob(fsbtodb(&super.fs, itod(&super.fs, i))), L_SET) == -1) { #endif /* AFS_SUN5_ENV */ #endif /* AFS_OSF_ENV */ --- 1329,1342 ---- e = i + super.fs.fs_ipg; #ifdef AFS_OSF_ENV dblk1 = fsbtodb(&super.fs, itod(&super.fs, i)); ! if (afs_lseek(pfd, (off_t) ((off_t) dblk1 * DEV_BSIZE), L_SET) == -1) { #else #if defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) f1 = fsbtodb(&super.fs, itod(&super.fs, i)); off = (offset_t) f1 << DEV_BSHIFT; if (llseek(pfd, off, L_SET) == -1) { #else ! if (afs_lseek(pfd, dbtob(fsbtodb(&super.fs, itod(&super.fs, i))), L_SET) == -1) { #endif /* AFS_SUN5_ENV */ #endif /* AFS_OSF_ENV */ *************** *** 1336,1342 **** for (bj = bk = 0; bj < bufsize; bj = bj + 512, bk++) { if ((code = read(pfd, dptr, 512)) != 512) { Log("Error reading inode %d? for partition %s (errno = %d); run vfsck\n", bk + i, partition, errno); ! if (lseek(pfd, 512, L_SET) == -1) { Log("Lseek failed\n"); goto out; } --- 1358,1364 ---- for (bj = bk = 0; bj < bufsize; bj = bj + 512, bk++) { if ((code = read(pfd, dptr, 512)) != 512) { Log("Error reading inode %d? for partition %s (errno = %d); run vfsck\n", bk + i, partition, errno); ! if (afs_lseek(pfd, 512, L_SET) == -1) { Log("Lseek failed\n"); goto out; } *************** *** 1496,1507 **** return -1; } #else /* AFS_AIX41_ENV */ ! if (lseek(fd, blk * Bsize, 0) < 0) { Log("Unable to seek to offset %u for block %u\n", blk * Bsize, blk); } #endif /* AFS_AIX41_ENV */ #else ! if (lseek(fd, (off_t) dbtob(blk), L_SET) < 0) { Log("Unable to seek to offset %u for block %u\n", dbtob(blk), blk); } #endif --- 1518,1529 ---- return -1; } #else /* AFS_AIX41_ENV */ ! if (afs_lseek(fd, blk * Bsize, 0) < 0) { Log("Unable to seek to offset %u for block %u\n", blk * Bsize, blk); } #endif /* AFS_AIX41_ENV */ #else ! if (afs_lseek(fd, (off_t) dbtob(blk), L_SET) < 0) { Log("Unable to seek to offset %u for block %u\n", dbtob(blk), blk); } #endif Index: openafs/src/vol/namei_ops.c =================================================================== diff -c -r1.26 -r1.27 *** openafs/src/vol/namei_ops.c 2004/11/08 04:03:10 1.26 --- openafs/src/vol/namei_ops.c 2005/11/01 16:42:47 1.27 *************** *** 30,36 **** #ifdef AFS_AIX_ENV #include #endif ! #ifdef AFS_SUN5_ENV #include #endif #include --- 30,36 ---- #ifdef AFS_AIX_ENV #include #endif ! #if defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) #include #endif #include *************** *** 860,866 **** namei_GetLCOffsetAndIndexFromIno(ino, &offset, &index); if (lockit) { ! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) if (lockf(h->fd_fd, F_LOCK, 0) < 0) #else if (flock(h->fd_fd, LOCK_EX) < 0) --- 860,866 ---- namei_GetLCOffsetAndIndexFromIno(ino, &offset, &index); if (lockit) { ! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) if (lockf(h->fd_fd, F_LOCK, 0) < 0) #else if (flock(h->fd_fd, LOCK_EX) < 0) *************** *** 879,885 **** bad_getLinkByte: if (lockit) ! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) lockf(h->fd_fd, F_ULOCK, 0); #else flock(h->fd_fd, LOCK_UN); --- 879,885 ---- bad_getLinkByte: if (lockit) ! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) lockf(h->fd_fd, F_ULOCK, 0); #else flock(h->fd_fd, LOCK_UN); *************** *** 904,910 **** return -1; /* Only one manipulates at a time. */ ! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) if (lockf(fdP->fd_fd, F_LOCK, 0) < 0) { #else if (flock(fdP->fd_fd, LOCK_EX) < 0) { --- 904,910 ---- return -1; /* Only one manipulates at a time. */ ! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) if (lockf(fdP->fd_fd, F_LOCK, 0) < 0) { #else if (flock(fdP->fd_fd, LOCK_EX) < 0) { *************** *** 944,950 **** goto badGetFreeTag; } FDH_SYNC(fdP); ! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) lockf(fdP->fd_fd, F_ULOCK, 0); #else flock(fdP->fd_fd, LOCK_UN); --- 944,950 ---- goto badGetFreeTag; } FDH_SYNC(fdP); ! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) lockf(fdP->fd_fd, F_ULOCK, 0); #else flock(fdP->fd_fd, LOCK_UN); *************** *** 953,959 **** return col;; badGetFreeTag: ! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) lockf(fdP->fd_fd, F_ULOCK, 0); #else flock(fdP->fd_fd, LOCK_UN); --- 953,959 ---- return col;; badGetFreeTag: ! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) lockf(fdP->fd_fd, F_ULOCK, 0); #else flock(fdP->fd_fd, LOCK_UN); *************** *** 980,986 **** namei_GetLCOffsetAndIndexFromIno(ino, &offset, &index); if (!locked) { ! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) if (lockf(fdP->fd_fd, F_LOCK, 0) < 0) { #else if (flock(fdP->fd_fd, LOCK_EX) < 0) { --- 980,986 ---- namei_GetLCOffsetAndIndexFromIno(ino, &offset, &index); if (!locked) { ! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) if (lockf(fdP->fd_fd, F_LOCK, 0) < 0) { #else if (flock(fdP->fd_fd, LOCK_EX) < 0) { *************** *** 1023,1029 **** bad_SetLinkCount: ! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) lockf(fdP->fd_fd, F_ULOCK, 0); #else flock(fdP->fd_fd, LOCK_UN); --- 1023,1029 ---- bad_SetLinkCount: ! #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) lockf(fdP->fd_fd, F_ULOCK, 0); #else flock(fdP->fd_fd, LOCK_UN);