]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
solars-sparc32-largefile-20051011
authorChas Williams <chas@cmf.nrl.navy.mil>
Wed, 12 Oct 2005 07:15:39 +0000 (07:15 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 12 Oct 2005 07:15:39 +0000 (07:15 +0000)
readd largefile support for solaris sparc32

13 files changed:
src/afs/SOLARIS/osi_vnodeops.c
src/afs/VNOPS/afs_vnop_readdir.c
src/afs/VNOPS/afs_vnop_strategy.c
src/afs/afs_osi_uio.c
src/config/param.sun4x_510.h
src/config/param.sun4x_56.h
src/config/param.sun4x_57.h
src/config/param.sun4x_58.h
src/config/param.sun4x_59.h
src/config/param.sunx86_510.h
src/config/param.sunx86_57.h
src/config/param.sunx86_58.h
src/config/param.sunx86_59.h

index 9adff6065207d53a8b0204c6995d227c163a6b42..bb70b64fdc6143f4fbebeb96b280313a6acbae62 100644 (file)
@@ -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;
 }
index 8cfcae7ed46d3edbce4e952b4c6b3208ac42d890..2b385af4bacc7eb77fdeff81af3804d514b111c8 100644 (file)
@@ -625,9 +625,11 @@ afs_readdir(OSI_VC_ARG(avc), auio, acred)
     if (eofp)
        *eofp = 0;
 #endif
+#ifndef AFS_64BIT_CLIENT
     if (AfsLargeFileUio(auio)  /* file is large than 2 GB */
        ||AfsLargeFileSize(auio->uio_offset, auio->uio_resid))
        return EFBIG;
+#endif
 
     if ((code = afs_InitReq(&treq, acred))) {
 #ifdef AFS_HPUX_ENV
index e65975d36d0bc3ae0073419d94e6825a2a029837..dc3dde637062b2b5f91d24952905362b6da04962 100644 (file)
@@ -80,12 +80,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;
@@ -138,12 +139,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
index b072dd5a5db0ff2d033f856eac89d30014c64a37..953647db341aa35097c515fa3bf09eba51012ea2 100644 (file)
@@ -99,7 +99,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;
     }
     return 0;
index f9e5f3e04c24609de2f6736694444c00a33acd45..f21d2fe70affa15376d9f3412641312b19ba3ca2 100644 (file)
 #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
index 97855265c841d6596540aca631b9c319f42856cf..25e49be179dd635a38bb7c82b3bc67896edb9ca5 100644 (file)
@@ -13,8 +13,6 @@
 #ifndef        AFS_PARAM_H
 #define        AFS_PARAM_H
 
-#include <afs/afs_sysnames.h>
-
 #define AFS_VFS_ENV    1
 /* Used only in vfsck code; is it needed any more???? */
 
 #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 <afs/afs_sysnames.h>
+
 /* 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
index 577fb80b1faed0ec74012cc48fd6f278c1e4277b..ef65da55bd56f7f5616736d6767b84952a5008c4 100644 (file)
@@ -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
index abe8d464b622ccec750ff4965a0aedad5fd358b0..03a002412a7e865b781524c9eae97f67c3083fdb 100644 (file)
 #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
index e492a12def2acdb056e5ebd4fc492db69cb53149..ba57e2a61e69d578cf89ad55fe044fe9ca8e4ffd 100644 (file)
 #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
index c99fe5804e1b517f87822536f0a733c9275daa84..e028f055f0bf0c49ef42827eaaadba85c241b44d 100644 (file)
@@ -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
 #if defined(__amd64)
 #define        AFS_SUN57_64BIT_ENV     1
 #define AFS_64BIT_INO          1
-#define AFS_64BIT_CLIENT       1       
 #endif
 
 /**
 
 #define AFS_64BIT_ENV           1
 
-
 #include <afs/afs_sysnames.h>
 
 #if 0
index 1fb6f94c58501733ec83e87b6212c773d301992a..7597cfe36a0032e39f4728a10b3326484b6d249b 100644 (file)
@@ -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
 #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 */
index 4bb5d7db331723e884755d257d02fde14383a81c..8850aef33b4b1c7013dcc20e454c61984f94c819 100644 (file)
@@ -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
 #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 */
index b1f69460e896c70fb4b183f768d31f7f8293ed3a..d3d37dea1a8c26966ffa92b5675107c1ab57876c 100644 (file)
@@ -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