From 25fab01622342209df28c9914d976bcedbdc1440 Mon Sep 17 00:00:00 2001 From: Chas Williams Date: Thu, 13 Oct 2005 16:16:58 +0000 Subject: [PATCH] STABLE14-solars-sparc32-largefile-20051011 readd largefile support for solaris sparc32 (cherry picked from commit b5f47e6d1574a6b267ece2d35f9d8d5a08414d7b) --- src/afs/SOLARIS/osi_vnodeops.c | 27 +++++++++++++++++++++------ src/afs/VNOPS/afs_vnop_strategy.c | 14 ++++++++------ src/afs/afs_osi_uio.c | 2 +- src/config/param.sun4x_510.h | 8 +------- src/config/param.sun4x_56.h | 9 ++++++--- src/config/param.sun4x_57.h | 3 ++- src/config/param.sun4x_58.h | 8 +------- src/config/param.sun4x_59.h | 8 +------- src/config/param.sunx86_510.h | 5 ++--- src/config/param.sunx86_57.h | 9 +++++---- src/config/param.sunx86_58.h | 9 +++++---- src/config/param.sunx86_59.h | 3 ++- 12 files changed, 55 insertions(+), 50 deletions(-) diff --git a/src/afs/SOLARIS/osi_vnodeops.c b/src/afs/SOLARIS/osi_vnodeops.c index 98ece1893..dcbc4c0a5 100644 --- a/src/afs/SOLARIS/osi_vnodeops.c +++ b/src/afs/SOLARIS/osi_vnodeops.c @@ -457,7 +457,11 @@ afs_GetOnePage(vp, off, alen, protp, pl, plsz, seg, addr, rw, acred) buf = pageio_setup(page, PAGESIZE, vp, B_READ); /* allocate a buf structure */ buf->b_edev = 0; buf->b_dev = 0; +#if defined(AFS_SUN56_ENV) + buf->b_lblkno = lbtodb(toffset); +#else buf->b_blkno = btodb(toffset); +#endif bp_mapin(buf); /* map it in to our address space */ AFS_GLOCK(); @@ -685,7 +689,11 @@ afs_putapage(struct vnode *vp, struct page *pages, return (ENOMEM); tbuf->b_dev = 0; +#if defined(AFS_SUN56_ENV) + tbuf->b_lblkno = lbtodb(pages->p_offset); +#else tbuf->b_blkno = btodb(pages->p_offset); +#endif bp_mapin(tbuf); AFS_GLOCK(); afs_Trace4(afs_iclSetp, CM_TRACE_PAGEOUTONE, ICL_TYPE_LONG, avc, @@ -743,7 +751,7 @@ afs_nfsrdwr(avc, auio, arw, ioflag, acred) afs_Trace4(afs_iclSetp, CM_TRACE_VMRW, ICL_TYPE_POINTER, (afs_int32) avc, ICL_TYPE_LONG, (arw == UIO_WRITE ? 1 : 0), ICL_TYPE_OFFSET, - ICL_HANDLE_OFFSET(auio->uio_offset), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(auio->uio_loffset), ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(auio->uio_resid)); #ifndef AFS_64BIT_CLIENT @@ -782,12 +790,13 @@ afs_nfsrdwr(avc, auio, arw, ioflag, acred) /* adjust parameters when appending files */ if ((ioflag & IO_APPEND) && arw == UIO_WRITE) { -#if defined(AFS_SUN56_ENV) - auio->uio_loffset = 0; -#endif +#if defined(AFS_SUN56_ENV) + auio->uio_loffset = avc->m.Length; /* write at EOF position */ +#else auio->uio_offset = avc->m.Length; /* write at EOF position */ +#endif } - if (auio->uio_offset < 0 || (auio->uio_offset + auio->uio_resid) < 0) { + if (auio->afsio_offset < 0 || (auio->afsio_offset + auio->uio_resid) < 0) { ReleaseWriteLock(&avc->lock); afs_BozonUnlock(&avc->pvnLock, avc); return EINVAL; @@ -1233,7 +1242,13 @@ afs_seek(vnp, ooff, noffp) { register int code = 0; - if ((*noffp < 0 || *noffp > MAXOFF_T)) +#ifndef AFS_64BIT_CLIENT +# define __MAXOFF_T MAXOFF_T +#else +# define __MAXOFF_T MAXOFFSET_T +#endif + + if ((*noffp < 0 || *noffp > __MAXOFF_T)) code = EINVAL; return code; } diff --git a/src/afs/VNOPS/afs_vnop_strategy.c b/src/afs/VNOPS/afs_vnop_strategy.c index 6fff09a8f..766c2da23 100644 --- a/src/afs/VNOPS/afs_vnop_strategy.c +++ b/src/afs/VNOPS/afs_vnop_strategy.c @@ -81,12 +81,13 @@ afs_ustrategy(abp) tuio.afsio_iovcnt = 1; #if defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_XBSD_ENV) #ifdef AFS_64BIT_CLIENT +#ifdef AFS_SUN5_ENV + tuio.afsio_offset = (afs_offs_t) ldbtob(abp->b_lblkno); +#else tuio.afsio_offset = (afs_offs_t) dbtob(abp->b_blkno); +#endif #else /* AFS_64BIT_CLIENT */ tuio.afsio_offset = (u_int) dbtob(abp->b_blkno); -#if defined(AFS_SUN5_ENV) - tuio._uio_offset._p._u = 0; -#endif #endif /* AFS_64BIT_CLIENT */ #else tuio.afsio_offset = DEV_BSIZE * abp->b_blkno; @@ -139,12 +140,13 @@ afs_ustrategy(abp) tuio.afsio_iovcnt = 1; #if defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) #ifdef AFS_64BIT_CLIENT +#ifdef AFS_SUN5_ENV + tuio.afsio_offset = (afs_offs_t) ldbtob(abp->b_lblkno); +#else tuio.afsio_offset = (afs_offs_t) dbtob(abp->b_blkno); +#endif #else /* AFS_64BIT_CLIENT */ tuio.afsio_offset = (u_int) dbtob(abp->b_blkno); -#ifdef AFS_SUN5_ENV - tuio._uio_offset._p._u = 0; -#endif #endif /* AFS_64BIT_CLIENT */ #ifdef AFS_SUN5_ENV #ifdef AFS_SUN59_ENV diff --git a/src/afs/afs_osi_uio.c b/src/afs/afs_osi_uio.c index 8b55c0c28..8b61efea1 100644 --- a/src/afs/afs_osi_uio.c +++ b/src/afs/afs_osi_uio.c @@ -104,7 +104,7 @@ afsio_skip(register struct uio *auio, register afs_int32 asize) tv->iov_base = (char *)(tv->iov_base) + cnt; tv->iov_len -= cnt; auio->uio_resid -= cnt; - auio->uio_offset += cnt; + auio->afsio_offset += cnt; asize -= cnt; } #endif diff --git a/src/config/param.sun4x_510.h b/src/config/param.sun4x_510.h index f9e5f3e04..f21d2fe70 100644 --- a/src/config/param.sun4x_510.h +++ b/src/config/param.sun4x_510.h @@ -24,13 +24,7 @@ #define AFS_BOZONLOCK_ENV 1 #define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ -/* - * Only define on 64 bit kernel, until problems with 32 bit - * and large file support are resolved - */ -#if defined(__sparcv9) #define AFS_64BIT_CLIENT 1 -#endif #define AFS_HAVE_FLOCK_SYSID 1 @@ -79,7 +73,7 @@ /*#define AFS_USEBUFFERS 1*/ #define afsio_iov uio_iov #define afsio_iovcnt uio_iovcnt -#define afsio_offset uio_offset +#define afsio_offset uio_loffset #define afsio_seg uio_segflg #define afsio_fmode uio_fmode #define afsio_resid uio_resid diff --git a/src/config/param.sun4x_56.h b/src/config/param.sun4x_56.h index 97855265c..25e49be17 100644 --- a/src/config/param.sun4x_56.h +++ b/src/config/param.sun4x_56.h @@ -13,8 +13,6 @@ #ifndef AFS_PARAM_H #define AFS_PARAM_H -#include - #define AFS_VFS_ENV 1 /* Used only in vfsck code; is it needed any more???? */ @@ -33,11 +31,16 @@ #define RXK_LISTENER_ENV 1 #define AFS_GCPAGS 1 /* if nonzero, garbage collect PAGs */ +#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ +#define AFS_64BIT_CLIENT 1 + #define AFS_3DISPARES 1 /* Utilize the 3 available disk inode 'spares' */ #define AFS_SYSCALL 105 #define AFS_HAVE_FLOCK_SYSID 1 +#include + /* File system entry (used if mount.h doesn't define MOUNT_AFS */ #define AFS_MOUNT_AFS "afs" @@ -69,7 +72,7 @@ /*#define AFS_USEBUFFERS 1*/ #define afsio_iov uio_iov #define afsio_iovcnt uio_iovcnt -#define afsio_offset uio_offset +#define afsio_offset uio_loffset #define afsio_seg uio_segflg #define afsio_fmode uio_fmode #define afsio_resid uio_resid diff --git a/src/config/param.sun4x_57.h b/src/config/param.sun4x_57.h index 577fb80b1..ef65da55b 100644 --- a/src/config/param.sun4x_57.h +++ b/src/config/param.sun4x_57.h @@ -30,6 +30,7 @@ #define AFS_BOZONLOCK_ENV 1 #define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ +#define AFS_64BIT_CLIENT 1 #define AFS_HAVE_FLOCK_SYSID 1 @@ -73,7 +74,7 @@ /*#define AFS_USEBUFFERS 1*/ #define afsio_iov uio_iov #define afsio_iovcnt uio_iovcnt -#define afsio_offset uio_offset +#define afsio_offset uio_loffset #define afsio_seg uio_segflg #define afsio_fmode uio_fmode #define afsio_resid uio_resid diff --git a/src/config/param.sun4x_58.h b/src/config/param.sun4x_58.h index abe8d464b..03a002412 100644 --- a/src/config/param.sun4x_58.h +++ b/src/config/param.sun4x_58.h @@ -22,13 +22,7 @@ #define AFS_BOZONLOCK_ENV 1 #define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ -/* - * Only define on 64 bit kernel, until problems with 32 bit - * and large file support are resolved - */ -#if defined(__sparcv9) #define AFS_64BIT_CLIENT 1 -#endif #define AFS_HAVE_FLOCK_SYSID 1 @@ -77,7 +71,7 @@ /*#define AFS_USEBUFFERS 1*/ #define afsio_iov uio_iov #define afsio_iovcnt uio_iovcnt -#define afsio_offset uio_offset +#define afsio_offset uio_loffset #define afsio_seg uio_segflg #define afsio_fmode uio_fmode #define afsio_resid uio_resid diff --git a/src/config/param.sun4x_59.h b/src/config/param.sun4x_59.h index e492a12de..ba57e2a61 100644 --- a/src/config/param.sun4x_59.h +++ b/src/config/param.sun4x_59.h @@ -23,13 +23,7 @@ #define AFS_BOZONLOCK_ENV 1 #define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ -/* - * Only define on 64 bit kernel, until problems with 32 bit - * and large file support are resolved - */ -#if defined(__sparcv9) #define AFS_64BIT_CLIENT 1 -#endif #define AFS_HAVE_FLOCK_SYSID 1 @@ -78,7 +72,7 @@ /*#define AFS_USEBUFFERS 1*/ #define afsio_iov uio_iov #define afsio_iovcnt uio_iovcnt -#define afsio_offset uio_offset +#define afsio_offset uio_loffset #define afsio_seg uio_segflg #define afsio_fmode uio_fmode #define afsio_resid uio_resid diff --git a/src/config/param.sunx86_510.h b/src/config/param.sunx86_510.h index c99fe5804..e028f055f 100644 --- a/src/config/param.sunx86_510.h +++ b/src/config/param.sunx86_510.h @@ -34,6 +34,7 @@ #define AFS_X86_ENV 1 #define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ +#define AFS_64BIT_CLIENT 1 #define AFS_HAVE_FLOCK_SYSID 1 @@ -82,7 +83,7 @@ /*#define AFS_USEBUFFERS 1*/ #define afsio_iov uio_iov #define afsio_iovcnt uio_iovcnt -#define afsio_offset uio_offset +#define afsio_offset uio_loffset #define afsio_seg uio_segflg #define afsio_fmode uio_fmode #define afsio_resid uio_resid @@ -100,7 +101,6 @@ #if defined(__amd64) #define AFS_SUN57_64BIT_ENV 1 #define AFS_64BIT_INO 1 -#define AFS_64BIT_CLIENT 1 #endif /** @@ -151,7 +151,6 @@ #define AFS_64BIT_ENV 1 - #include #if 0 diff --git a/src/config/param.sunx86_57.h b/src/config/param.sunx86_57.h index 1fb6f94c5..7597cfe36 100644 --- a/src/config/param.sunx86_57.h +++ b/src/config/param.sunx86_57.h @@ -32,6 +32,7 @@ #define AFS_X86_ENV 1 #define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ +#define AFS_64BIT_CLIENT 1 #define AFS_HAVE_FLOCK_SYSID 1 @@ -76,7 +77,7 @@ /*#define AFS_USEBUFFERS 1*/ #define afsio_iov uio_iov #define afsio_iovcnt uio_iovcnt -#define afsio_offset uio_offset +#define afsio_offset uio_loffset #define afsio_seg uio_segflg #define afsio_fmode uio_fmode #define afsio_resid uio_resid @@ -143,9 +144,9 @@ #define AFS_MOUNT_AFS 1 /* Machine / Operating system information */ -#define sys_sun4x_55 1 -#define SYS_NAME "sun4x_55" -#define SYS_NAME_ID SYS_NAME_ID_sun4x_55 +#define sys_sunx86_57 1 +#define SYS_NAME "sunx86_57" +#define SYS_NAME_ID SYS_NAME_ID_sunx86_57 #define AFSLITTLE_ENDIAN 1 #define AFS_HAVE_FFS 1 /* Use system's ffs. */ #define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */ diff --git a/src/config/param.sunx86_58.h b/src/config/param.sunx86_58.h index 4bb5d7db3..8850aef33 100644 --- a/src/config/param.sunx86_58.h +++ b/src/config/param.sunx86_58.h @@ -33,6 +33,7 @@ #define AFS_X86_ENV 1 #define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ +#define AFS_64BIT_CLIENT 1 #define AFS_HAVE_FLOCK_SYSID 1 @@ -81,7 +82,7 @@ /*#define AFS_USEBUFFERS 1*/ #define afsio_iov uio_iov #define afsio_iovcnt uio_iovcnt -#define afsio_offset uio_offset +#define afsio_offset uio_loffset #define afsio_seg uio_segflg #define afsio_fmode uio_fmode #define afsio_resid uio_resid @@ -148,9 +149,9 @@ #define AFS_MOUNT_AFS 1 /* Machine / Operating system information */ -#define sys_sun4x_55 1 -#define SYS_NAME "sun4x_55" -#define SYS_NAME_ID SYS_NAME_ID_sun4x_55 +#define sys_sunx86_58 1 +#define SYS_NAME "sunx86_58" +#define SYS_NAME_ID SYS_NAME_ID_sunx86_58 #define AFSLITTLE_ENDIAN 1 #define AFS_HAVE_FFS 1 /* Use system's ffs. */ #define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */ diff --git a/src/config/param.sunx86_59.h b/src/config/param.sunx86_59.h index b1f69460e..d3d37dea1 100644 --- a/src/config/param.sunx86_59.h +++ b/src/config/param.sunx86_59.h @@ -34,6 +34,7 @@ #define AFS_X86_ENV 1 #define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ +#define AFS_64BIT_CLIENT 1 #define AFS_HAVE_FLOCK_SYSID 1 @@ -82,7 +83,7 @@ /*#define AFS_USEBUFFERS 1*/ #define afsio_iov uio_iov #define afsio_iovcnt uio_iovcnt -#define afsio_offset uio_offset +#define afsio_offset uio_loffset #define afsio_seg uio_segflg #define afsio_fmode uio_fmode #define afsio_resid uio_resid -- 2.39.5