]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
This commit was generated by cvs2svn to compensate for changes in r44,
authorSam Hartman <hartmans@debian.org>
Tue, 7 Nov 2000 16:09:08 +0000 (16:09 +0000)
committerSam Hartman <hartmans@debian.org>
Tue, 7 Nov 2000 16:09:08 +0000 (16:09 +0000)
which included commits to RCS files with non-trunk default branches.

35 files changed:
src/afs/LINUX/osi_alloc.c
src/afs/LINUX/osi_cred.c
src/afs/LINUX/osi_file.c
src/afs/LINUX/osi_misc.c
src/afs/LINUX/osi_module.c
src/afs/LINUX/osi_sleep.c
src/afs/LINUX/osi_vfs.h
src/afs/LINUX/osi_vfsops.c
src/afs/LINUX/osi_vnodeops.c
src/afs/Makefile
src/afs/SOLARIS/osi_inode.c
src/afs/SOLARIS/osi_vfsops.c
src/afs/VNOPS/afs_vnop_flock.c
src/afs/afs_analyze.c
src/afs/afs_cell.c
src/afs/afs_conn.c
src/afs/afs_server.c
src/afs/afs_user.c
src/afs/afs_util.c
src/afs/afs_vcache.c
src/afs/afs_volume.c
src/afsd/Makefile
src/afsd/afsd.c
src/comerr/Makefile
src/config/NTMakefile.i386_nt40
src/config/afs_sysnames.h
src/des/andrew-conf.h
src/libafs/MakefileProto.SOLARIS
src/lwp/Makefile
src/lwp/process.c
src/rx/LINUX/rx_kmutex.h
src/rx/LINUX/rx_knet.c
src/rx/Makefile
src/rx/SOLARIS/rx_knet.c
src/venus/kdump.c

index f88188e8a348fb1447469e910cc653ca7f60a3a4..ab0352d638893fc3c3ff8b83fbc661ca26febd82 100644 (file)
@@ -45,10 +45,14 @@ unsigned int afs_linux_hash_verify_count = 0; /* used by hash_verify */
 struct afs_lhash_stat afs_linux_lsb; /* hash table statistics */
 unsigned int afs_linux_hash_bucket_dist[MAX_BUCKET_LEN]; /* bucket population distribution in our hash table */
 
+#if defined(AFS_LINUX24_ENV)
+#include "../h/vmalloc.h"
+#else
 /* externs : can we do this in a better way. Including vmalloc.h causes other
  * problems.*/
 extern void vfree(void * addr);
 extern void *vmalloc(unsigned long size);
+#endif
 
 /* Allocator support functions (static) */
 
@@ -249,7 +253,11 @@ static void get_hash_stats()
 
 /************** Linux memory allocator interface functions **********/
 
+#if defined(AFS_LINUX24_ENV)
+DECLARE_MUTEX(afs_linux_alloc_sem);
+#else
 struct semaphore afs_linux_alloc_sem = MUTEX;
+#endif
 
 void *osi_linux_alloc(unsigned int asize)
 {
index 32065f66ded5a3b8860eb27c4c80fba1f11e8106..f452e030a9b80625e0ecf85d28e30012dcdeac0d 100644 (file)
@@ -27,7 +27,11 @@ int ncreds_inuse = 0;
  * Also assuming a fast path through both down and up if no waiters. Otherwise,
  * test if no creds in pool before grabbing lock in crfree().
  */
+#if defined(AFS_LINUX24_ENV)
+static DECLARE_MUTEX(linux_cred_pool_lock);
+#else
 static struct semaphore linux_cred_pool_lock = MUTEX;
+#endif
 #define CRED_LOCK() down(&linux_cred_pool_lock)
 #define CRED_UNLOCK() up(&linux_cred_pool_lock)
 
index 25cb2db9d77e4622e3ad0036aa7f953e2cd501b1..bb57725ac2395e6395e8ffe7670ce3e358fbbfa7 100644 (file)
@@ -11,6 +11,7 @@
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
 #include "../afs/afs_stats.h"  /* afs statistics */
+#include "../h/smp_lock.h"
 
 
 int afs_osicred_initialized=0;
@@ -54,7 +55,11 @@ void *osi_UFSOpen(ainode)
     FILE_INODE(filp) = tip;
     tip->i_flags |= MS_NOATIME; /* Disable updating access times. */
     filp->f_flags = O_RDWR;
+#if defined(AFS_LINUX24_ENV)
+    filp->f_op = fops_get(tip->i_fop);
+#else
     filp->f_op = tip->i_op->default_file_ops;
+#endif
     if (filp->f_op && filp->f_op->open)
        code = filp->f_op->open(tip, filp);
     if (code)
@@ -99,6 +104,33 @@ osi_UFSClose(afile)
       return 0;
   }
 
+#if defined(AFS_LINUX24_ENV)
+int osi_notify_change(struct dentry * dentry, struct iattr * attr)
+{
+    struct inode *inode = dentry->d_inode;
+    int error;
+    time_t now = CURRENT_TIME;
+    unsigned int ia_valid = attr->ia_valid;
+
+    attr->ia_ctime = now;
+    if (!(ia_valid & ATTR_ATIME_SET))
+       attr->ia_atime = now;
+    if (!(ia_valid & ATTR_MTIME_SET))
+       attr->ia_mtime = now;
+
+    lock_kernel();
+    if (inode && inode->i_op && inode->i_op->setattr)
+       error = inode->i_op->setattr(dentry, attr);
+    else {
+       error = inode_change_ok(inode, attr);
+       if (!error)
+           inode_setattr(inode, attr);
+    }
+    unlock_kernel();
+    return error;
+}
+#endif
+
 osi_UFSTruncate(afile, asize)
     register struct osi_file *afile;
     afs_int32 asize; {
@@ -118,6 +150,11 @@ osi_UFSTruncate(afile, asize)
     MObtainWriteLock(&afs_xosi,321);    
     AFS_GUNLOCK();
     down(&inode->i_sem);
+#if defined(AFS_LINUX24_ENV)
+    newattrs.ia_size = asize;
+    newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
+    code = osi_notify_change(&afile->dentry, &newattrs);
+#else
     inode->i_size = newattrs.ia_size = asize;
     newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
     if (inode->i_sb->s_op && inode->i_sb->s_op->notify_change) {
@@ -128,6 +165,7 @@ osi_UFSTruncate(afile, asize)
        if (inode->i_op && inode->i_op->truncate)
            inode->i_op->truncate(inode);
     }
+#endif
     code = -code;
     up(&inode->i_sem);
     AFS_GLOCK();
index 0194d4d7f5516844651c698be0ae7f509e5f7714..edda974afa7c97761d26e2d8b3b70e11bd4c6a39 100644 (file)
@@ -22,17 +22,40 @@ char *crash_addr = 0; /* Induce an oops by writing here. */
 int osi_lookupname(char *aname, uio_seg_t seg, int followlink,
               vnode_t **dirvpp, struct dentry **dpp)
 {
+#if defined(AFS_LINUX24_ENV)
+    struct nameidata nd;
+#else
     struct dentry *dp = NULL;
+#endif
     int code;
 
     code = ENOENT;
+#if defined(AFS_LINUX24_ENV)
+    if (seg == AFS_UIOUSER) {
+        code = followlink ?
+           user_path_walk(aname, &nd) : user_path_walk_link(aname, &nd);
+    }
+    else {
+        if (path_init(aname, followlink ? LOOKUP_FOLLOW : 0, &nd))
+           code = path_walk(aname, &nd);
+    }
+
+    if (!code) {
+       if (nd.dentry->d_inode) {
+           *dpp = nd.dentry;
+           code = 0;
+       }
+       else
+           path_release(&nd);
+    }
+#else
     if (seg == AFS_UIOUSER) {
        dp = followlink ? namei(aname) : lnamei(aname);
     }
     else {
        dp = lookup_dentry(aname, NULL, followlink ? 1 : 0);
     }
-    
+
     if (dp && !IS_ERR(dp)) {
        if (dp->d_inode) {
            *dpp = dp;
@@ -41,6 +64,7 @@ int osi_lookupname(char *aname, uio_seg_t seg, int followlink,
        else
            dput(dp);
     }
+#endif
            
     return code;
 }
@@ -262,9 +286,17 @@ void osi_linux_free_inode_pages(void)
     for (i=0; i<VCSIZE; i++) {
        for(tvc = afs_vhashT[i]; tvc; tvc=tvc->hnext) {
            ip = (struct inode*)tvc;
+#if defined(AFS_LINUX24_ENV)
+           if (ip->i_data.nrpages) {
+#else
            if (ip->i_nrpages) {
+#endif
                invalidate_inode_pages(ip);
+#if defined(AFS_LINUX24_ENV)
+               if (ip->i_data.nrpages) {
+#else
                if (ip->i_nrpages) {
+#endif
                    printf("Failed to invalidate all pages on inode 0x%x\n",
                           ip);
                }
@@ -283,13 +315,26 @@ void osi_iput(struct inode *ip)
     extern struct vfs *afs_globalVFS;
 
     
+#if defined(AFS_LINUX24_ENV)
+    if (atomic_read(&ip->i_count) == 0 || atomic_read(&ip->i_count) & 0xffff0000) {
+#else
     if (ip->i_count == 0 || ip->i_count & 0xffff0000) {
+#endif
        osi_Panic("IPUT Bad refCount %d on inode 0x%x\n",
+#if defined(AFS_LINUX24_ENV)
+                 atomic_read(&ip->i_count), ip);
+#else
                  ip->i_count, ip);
+#endif
     }
     if (afs_globalVFS && afs_globalVFS == ip->i_sb ) {
+#if defined(AFS_LINUX24_ENV)
+       atomic_dec(&ip->i_count);
+       if (!atomic_read(&ip->i_count))
+#else
        ip->i_count --;
        if (!ip->i_count)
+#endif
            afs_delete_inode(ip);
     }
     else { 
index 79ca811438e97fd810571798beacca36eabbb40f..5d29b43c57ac718b95c3d5104a421b9b2afbaa77 100644 (file)
@@ -31,7 +31,11 @@ extern struct file_system_type afs_file_system;
 
 static long get_page_offset(void);
 
+#if defined(AFS_LINUX24_ENV)
+DECLARE_MUTEX(afs_global_lock);
+#else
 struct semaphore afs_global_lock = MUTEX;
+#endif
 int afs_global_owner = 0;
 unsigned long afs_linux_page_offset = 0; /* contains the PAGE_OFFSET value */
 
@@ -96,6 +100,9 @@ void cleanup_module(void)
 
 static long get_page_offset(void)
 {
+#if defined(AFS_PPC_LINUX22_ENV)
+    return PAGE_OFFSET;
+#else
     struct task_struct *p;
 
     /* search backward thru the circular list */
@@ -104,4 +111,5 @@ static long get_page_offset(void)
            return p->addr_limit.seg;
 
     return 0;
+#endif
 }
index 82451ab1ed69862734d6b702d502c5ad6a2990b5..f1b75d89a67d16bb575913dff76dafaadbecacfe 100644 (file)
@@ -124,7 +124,11 @@ typedef struct afs_event {
     int seq;                   /* Sequence number: this is incremented
                                   by wakeup calls; wait will not return until
                                   it changes */
+#if defined(AFS_LINUX24_ENV)
+    wait_queue_head_t cond;
+#else
     struct wait_queue *cond;
+#endif
 } afs_event_t;
 
 #define HASHSIZE 128
@@ -156,7 +160,11 @@ static afs_event_t *afs_getevent(char *event)
        afs_evhashcnt++;
        newp->next = afs_evhasht[hashcode];
        afs_evhasht[hashcode] = newp;
+#if defined(AFS_LINUX24_ENV)
+       init_waitqueue_head(&newp->cond);
+#else
        init_waitqueue(&newp->cond);
+#endif
        newp->seq = 0;
     }
     newp->event = event;
index 747846b946c59285e5b79ccab7b6df26926a05a7..74f7515b7cf739ac42e2d8d3ae4af9143b208aad 100644 (file)
@@ -34,31 +34,63 @@ typedef struct vnode {
        uid_t                   i_uid;
        gid_t                   i_gid;
        kdev_t                  i_rdev;
+#if defined(AFS_LINUX24_ENV)
+        loff_t                  i_size;
+#else
        off_t                   i_size;
+#endif
        time_t                  i_atime;
        time_t                  i_mtime;
        time_t                  i_ctime;
        unsigned long           i_blksize;
        unsigned long           i_blocks;
        unsigned long           i_version;
+#if !defined(AFS_LINUX24_ENV)
        unsigned long           i_nrpages;
+#endif
        struct semaphore        i_sem;
+#if defined(AFS_LINUX24_ENV)
+        struct semaphore        i_zombie;
+#else
        struct semaphore        i_atomic_write;
+#endif
        struct inode_operations *i_op;
+#if defined(AFS_LINUX24_ENV)
+        struct file_operations  *i_fop;
+#endif
        struct super_block      *i_sb;
+#if defined(AFS_LINUX24_ENV)
+        wait_queue_head_t       i_wait;
+#else
        struct wait_queue       *i_wait;
+#endif
        struct file_lock        *i_flock;
+#if defined(AFS_LINUX24_ENV)
+        struct address_space    *i_mapping;
+        struct address_space    i_data;
+#else
        struct vm_area_struct   *i_mmap;
        struct page             *i_pages;
+#endif
        struct dquot            *i_dquot[MAXQUOTAS];
+#if defined(AFS_LINUX24_ENV)
+        struct pipe_inode_info  *i_pipe;
+        struct block_device     *i_bdev;
+#endif
 
        unsigned long           i_state;
 
        unsigned int            i_flags;
+#if !defined(AFS_LINUX24_ENV)
        unsigned char           i_pipe;
+#endif
        unsigned char           i_sock;
 
+#if defined(AFS_LINUX24_ENV)
+        atomic_t                i_writecount;
+#else
        int                     i_writecount;
+#endif
        unsigned int            i_attr_flags;
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,10)
        __u32                   i_generation;
@@ -93,6 +125,9 @@ typedef struct vnode {
 #define i_number       i_ino
 #define v_count                i_count
 #define v_op           i_op
+#if defined(AFS_LINUX24_ENV)
+#define v_fop           i_fop
+#endif
 #define v_type         i_mode
 #define v_vfsp         i_sb
 #define vfs_vnodecovered s_covered
index c04a20e0ff9769ffe3de9adda41fddcf0277ac1d..3e9faa1e1de9aebd48800fe2b9940954ab6896c1 100644 (file)
@@ -17,6 +17,9 @@
 #include "../afs/afsincludes.h"
 #include "../afs/afs_stats.h"
 #include "../h/locks.h"
+#if defined(AFS_LINUX24_ENV)
+#include "../h/smp_lock.h"
+#endif
 
 #define __NO_VERSION__ /* don't define kernel_verion in module.h */
 #include <linux/module.h>
@@ -47,6 +50,9 @@ void put_inode_on_dummy_list(struct inode *ip);
  * 2) Mount call comes to us via do_mount -> read_super -> afs_read_super.
  *    We are expected to setup the super_block. See afs_read_super.
  */
+#if defined(AFS_LINUX24_ENV)
+DECLARE_FSTYPE(afs_file_system, "afs", afs_read_super, 0);
+#else
 struct file_system_type afs_file_system = {
     "afs",     /* name - used by mount operation. */
     0,         /* requires_dev - no for network filesystems. mount() will 
@@ -54,6 +60,7 @@ struct file_system_type afs_file_system = {
     afs_read_super, /* wrapper to afs_mount */
     NULL       /* pointer to next file_system_type once registered. */
 };
+#endif
 
 /* afs_read_super
  * read the "super block" for AFS - roughly eguivalent to struct vfs.
@@ -72,7 +79,9 @@ struct super_block *afs_read_super(struct super_block *sb, void *data,
     afs_was_mounted = 1;
 
     /* Set basics of super_block */
+#if !defined(AFS_LINUX24_ENV)
     lock_super(sb);
+#endif
     MOD_INC_USE_COUNT;
 
     afs_globalVFS = sb;
@@ -84,7 +93,9 @@ struct super_block *afs_read_super(struct super_block *sb, void *data,
     if (code)
        MOD_DEC_USE_COUNT;
 
+#if !defined(AFS_LINUX24_ENV)
     unlock_super(sb);
+#endif
 
     AFS_GUNLOCK();
     return code ? NULL : sb;
@@ -110,13 +121,23 @@ static int afs_root(struct super_block *afsp)
                                (struct vcache*)0, WRITE_LOCK);
            if (tvp) {
                extern struct inode_operations afs_dir_iops;
+#if defined(AFS_LINUX24_ENV)
+               extern struct file_operations afs_dir_fops;
+#endif
                
                /* "/afs" is a directory, reset inode ops accordingly. */
                tvp->v.v_op = &afs_dir_iops;
+#if defined(AFS_LINUX24_ENV)
+               tvp->v.v_fop = &afs_dir_fops;
+#endif
 
                /* setup super_block and mount point inode. */
                afs_globalVp = tvp;
+#if defined(AFS_LINUX24_ENV)
+               afsp->s_root = d_alloc_root((struct inode*)tvp);
+#else
                afsp->s_root = d_alloc_root((struct inode*)tvp, NULL);
+#endif
                afsp->s_root->d_op = &afs_dentry_operations;
            } else
                code = ENOENT;
@@ -212,15 +233,27 @@ void afs_delete_inode(struct inode *ip)
     struct vcache *vc = (struct vcache*)ip;
 
     AFS_GLOCK();
+#if defined(AFS_LINUX24_ENV)
+    lock_kernel();
+    if (atomic_read(&ip->i_count) > 1)
+#else
     if (ip->i_count > 1)
+#endif
        printf("afs_put_inode: ino %d (0x%x) has count %d\n", ip->i_ino, ip);
 
     ObtainWriteLock(&vc->lock, 504);
     afs_InactiveVCache(vc, credp);
+#if defined(AFS_LINUX24_ENV)
+    atomic_set(&ip->i_count, 0);
+#else
     ip->i_count = 0;
+#endif
     ip->i_nlink = 0; /* iput checks this after calling this routine. */
     ReleaseWriteLock(&vc->lock);
 
+#ifdef AFS_LINUX24_ENV
+    unlock_kernel();
+#endif
     AFS_GUNLOCK();
     crfree(credp);
 }
@@ -273,16 +306,22 @@ int afs_remount_fs(struct super_block *sbp, int *, char *)
  * statp is in user space, so we need to cobble together a statfs, then
  * copy it.
  */
+#if defined(AFS_LINUX24_ENV)
+int afs_statfs(struct super_block *sbp, struct statfs *statp)
+#else
 int afs_statfs(struct super_block *sbp, struct statfs *statp, int size)
+#endif
 {
     struct statfs stat;
 
     AFS_STATCNT(afs_statfs);
 
+#if !defined(AFS_LINUX24_ENV)
     if (size < sizeof(struct statfs))
        return;
        
     memset(&stat, 0, size);
+#endif
     stat.f_type = 0; /* Can we get a real type sometime? */
     stat.f_bsize = sbp->s_blocksize;
     stat.f_blocks =  stat.f_bfree =  stat.f_bavail =  stat.f_files =
@@ -290,12 +329,25 @@ int afs_statfs(struct super_block *sbp, struct statfs *statp, int size)
     stat.f_fsid.val[0] = AFS_VFSMAGIC;
     stat.f_fsid.val[1] = AFS_VFSFSID;
     stat.f_namelen = 256;
-    
+
+#if defined(AFS_LINUX24_ENV)
+    *statp = stat;
+#else
     memcpy_tofs(statp, &stat, size);
+#endif
     return 0;
 }
 
 
+#if defined(AFS_LINUX24_ENV)
+struct super_operations afs_sops = {
+    read_inode:        afs_read_inode,
+    write_inode:       afs_write_inode,
+    delete_inode:      afs_delete_inode,
+    put_super:         afs_put_super,
+    statfs:            afs_statfs,
+};
+#else
 struct super_operations afs_sops = {
     afs_read_inode,
     afs_write_inode,           /* afs_write_inode - see doc above. */
@@ -309,6 +361,7 @@ struct super_operations afs_sops = {
     NULL,              /* afs_clear_inode */
     NULL,              /* afs_umount_begin */
 };
+#endif
 
 /************** Support routines ************************/
 
index de2c51f6af6072b379847a4516b51649ffeed7ce..e5ce3dcb1f36012394195bba7a651f3f7204c26a 100644 (file)
 #include "../afs/afs_stats.h"
 #include "../h/mm.h"
 #include "../h/pagemap.h"
+#if defined(AFS_LINUX24_ENV)
+#include "../h/smp_lock.h"
+#endif
 
 extern struct vcache *afs_globalVp;
 
 extern struct dentry_operations *afs_dops;
+#if defined(AFS_LINUX24_ENV)
+extern struct inode_operations afs_file_iops;
+extern struct address_space_operations afs_file_aops;
+struct address_space_operations afs_symlink_aops;
+#endif
 extern struct inode_operations afs_dir_iops;
 extern struct inode_operations afs_symlink_iops;
 
@@ -215,7 +223,11 @@ tagain:
        len = strlen(de->name);
 
        /* filldir returns -EINVAL when the buffer is full. */
-       code = (*filldir)(dirbuf, de->name, len, offset, ino);
+#ifdef AFS_LINUX24_ENV
+       code = (*filldir)(dirbuf, de->name, len, offset, ino, DT_DIR);
+#else
+       code = (*filldir)(dirbuf, de->name, len, offset, ino); 
+#endif
        DRelease(de, 0);
        if (code)
            break;
@@ -301,10 +313,16 @@ static int afs_linux_mmap(struct file *fp, struct vm_area_struct *vmap)
     int code;
 
     AFS_GLOCK();
+#if defined(AFS_LINUX24_ENV)
+    afs_Trace3(afs_iclSetp, CM_TRACE_GMAP, ICL_TYPE_POINTER, vcp,
+              ICL_TYPE_POINTER, vmap->vm_start,
+              ICL_TYPE_INT32, vmap->vm_end - vmap->vm_start);
+#else
     afs_Trace4(afs_iclSetp, CM_TRACE_GMAP, ICL_TYPE_POINTER, vcp,
               ICL_TYPE_POINTER, vmap->vm_start,
               ICL_TYPE_INT32, vmap->vm_end - vmap->vm_start,
               ICL_TYPE_INT32, vmap->vm_offset);
+#endif
 
     /* get a validated vcache entry */
     code = afs_InitReq(&treq, credp);
@@ -322,36 +340,38 @@ static int afs_linux_mmap(struct file *fp, struct vm_area_struct *vmap)
        AFS_GLOCK();
     }
 
-    ObtainWriteLock(&vcp->lock,531);
-    /* Set out vma ops so we catch the close. The following test should be
-     * the same as used in generic_file_mmap.
-     */
-    if ((vmap->vm_flags & VM_SHARED) && (vmap->vm_flags & VM_MAYWRITE)) {
-       if (!afs_shared_mmap_ops_inited) {
-           afs_shared_mmap_ops_inited = 1;
-           afs_shared_mmap_ops = *vmap->vm_ops;
-           afs_shared_mmap_ops.close = afs_linux_vma_close;
+    if (code == 0) {
+       ObtainWriteLock(&vcp->lock,531);
+       /* Set out vma ops so we catch the close. The following test should be
+        * the same as used in generic_file_mmap.
+        */
+       if ((vmap->vm_flags & VM_SHARED) && (vmap->vm_flags & VM_MAYWRITE)) {
+           if (!afs_shared_mmap_ops_inited) {
+               afs_shared_mmap_ops_inited = 1;
+               afs_shared_mmap_ops = *vmap->vm_ops;
+               afs_shared_mmap_ops.close = afs_linux_vma_close;
+           }
+           vmap->vm_ops = &afs_shared_mmap_ops;
        }
-       vmap->vm_ops = &afs_shared_mmap_ops;
-    }
-    else {
-       if (!afs_private_mmap_ops_inited) {
-           afs_private_mmap_ops_inited = 1;
-           afs_private_mmap_ops = *vmap->vm_ops;
-           afs_private_mmap_ops.close = afs_linux_vma_close;
+       else {
+           if (!afs_private_mmap_ops_inited) {
+               afs_private_mmap_ops_inited = 1;
+               afs_private_mmap_ops = *vmap->vm_ops;
+               afs_private_mmap_ops.close = afs_linux_vma_close;
+           }
+           vmap->vm_ops = &afs_private_mmap_ops;
        }
-       vmap->vm_ops = &afs_private_mmap_ops;
-    }
     
     
-    /* Add an open reference on the first mapping. */
-    if (vcp->mapcnt == 0) {
-       vcp->execsOrWriters++;
-       vcp->opens++;
-       vcp->states |= CMAPPED;
+       /* Add an open reference on the first mapping. */
+       if (vcp->mapcnt == 0) {
+           vcp->execsOrWriters++;
+           vcp->opens++;
+           vcp->states |= CMAPPED;
+       }
+       ReleaseWriteLock(&vcp->lock);
+       vcp->mapcnt++;
     }
-    ReleaseWriteLock(&vcp->lock);
-    vcp->mapcnt++;
 
     AFS_GUNLOCK();
     crfree(credp);
@@ -364,7 +384,13 @@ int afs_linux_open(struct inode *ip, struct file *fp)
     cred_t *credp = crref();
 
     AFS_GLOCK();
+#ifdef AFS_LINUX24_ENV
+    lock_kernel();
+#endif
     code = afs_open((struct vcache**)&ip, fp->f_flags, credp);
+#ifdef AFS_LINUX24_ENV
+    unlock_kernel();
+#endif
     AFS_GUNLOCK();
 
     crfree(credp);
@@ -385,26 +411,42 @@ static int afs_linux_release(struct inode *ip, struct file *fp)
     struct vcache *vcp = (struct vcache*)ip;
 
     AFS_GLOCK();
+#ifdef AFS_LINUX24_ENV
+    lock_kernel();
+#endif
     if (vcp->flushcnt) {
        vcp->flushcnt--; /* protected by AFS global lock. */
     }
     else {
        code = afs_close(vcp, fp->f_flags, credp);
     }
+#ifdef AFS_LINUX24_ENV
+    unlock_kernel();
+#endif
     AFS_GUNLOCK();
 
     crfree(credp);
     return -code;
 }
 
+#if defined(AFS_LINUX24_ENV)
+static int afs_linux_fsync(struct file *fp, struct dentry *dp, int datasync)
+#else
 static int afs_linux_fsync(struct file *fp, struct dentry *dp)
+#endif
 {
     int code;
     struct inode *ip = FILE_INODE(fp);
     cred_t *credp = crref();
 
     AFS_GLOCK();
+#ifdef AFS_LINUX24_ENV
+    lock_kernel();
+#endif
     code = afs_fsync((struct vcache*)ip, credp);
+#ifdef AFS_LINUX24_ENV
+    unlock_kernel();
+#endif
     AFS_GUNLOCK();
     crfree(credp);
     return -code;
@@ -464,7 +506,11 @@ int afs_linux_flush(struct file *fp)
     cred_t *credp;
 
     /* Only do this on the last close of the file pointer. */
+#if defined(AFS_LINUX24_ENV)
+    if (atomic_read(&fp->f_count) > 1)
+#else
     if (fp->f_count > 1)
+#endif
        return 0;
 
     credp = crref();
@@ -486,6 +532,15 @@ int afs_linux_dir_read(struct file *fp, char *buf, size_t count, loff_t *ppos)
 
 
 
+#if defined(AFS_LINUX24_ENV)
+struct file_operations afs_dir_fops = {
+    read:      generic_read_dir,
+    readdir:   afs_linux_readdir,
+    ioctl:     afs_xioctl,
+    open:      afs_linux_open,
+    release:   afs_linux_release,
+};
+#else
 struct file_operations afs_dir_fops = {
     NULL,              /* afs_linux_lseek */
     afs_linux_dir_read,
@@ -503,7 +558,21 @@ struct file_operations afs_dir_fops = {
     NULL,              /* afs_linux_file_revalidate */
     afs_linux_lock,
 };
+#endif
 
+#if defined(AFS_LINUX24_ENV)
+struct file_operations afs_file_fops = {
+    read:      afs_linux_read,
+    write:     afs_linux_write,
+    ioctl:     afs_xioctl,
+    mmap:      afs_linux_mmap,
+    open:      afs_linux_open,
+    flush:     afs_linux_flush,
+    release:   afs_linux_release,
+    fsync:     afs_linux_fsync,
+    lock:      afs_linux_lock,
+};
+#else
 struct file_operations afs_file_fops = {
     NULL,              /* afs_linux_lseek */
     afs_linux_read,
@@ -521,6 +590,7 @@ struct file_operations afs_file_fops = {
     NULL,              /* afs_linux_file_revalidate */
     afs_linux_lock,
 };
+#endif
    
 
 /**********************************************************************
@@ -538,9 +608,15 @@ static int afs_linux_revalidate(struct dentry *dp)
     struct vcache *vcp = (struct vcache*)dp->d_inode;
 
     AFS_GLOCK();
+#ifdef AFS_LINUX24_ENV
+    lock_kernel();
+#endif
 
     /* If it's a negative dentry, then there's nothing to do. */
     if (!vcp) {
+#ifdef AFS_LINUX24_ENV
+        unlock_kernel();
+#endif
        AFS_GUNLOCK();
        return 0;
     }
@@ -550,6 +626,9 @@ static int afs_linux_revalidate(struct dentry *dp)
         if (*dp->d_name.name != '/' && vcp->mvstat == 2) /* root vnode */
            check_bad_parent(dp); /* check and correct mvid */
        vcache2inode(vcp);
+#ifdef AFS_LINUX24_ENV
+       unlock_kernel();
+#endif
        AFS_GUNLOCK();
        return 0;
     }
@@ -559,6 +638,9 @@ static int afs_linux_revalidate(struct dentry *dp)
     if (!code)
        code = afs_VerifyVCache(vcp, &treq);
 
+#ifdef AFS_LINUX24_ENV
+    unlock_kernel();
+#endif
     AFS_GUNLOCK();
     crfree(credp);
 
@@ -584,9 +666,15 @@ static int afs_linux_dentry_revalidate(struct dentry *dp)
     struct vcache *vcp = (struct vcache*)dp->d_inode;
 
     AFS_GLOCK();
+#ifdef AFS_LINUX24_ENV
+    lock_kernel();
+#endif
 
     /* If it's a negative dentry, then there's nothing to do. */
     if (!vcp) {
+#ifdef AFS_LINUX24_ENV
+       unlock_kernel();
+#endif
        AFS_GUNLOCK();
        return 0;
     }
@@ -596,6 +684,9 @@ static int afs_linux_dentry_revalidate(struct dentry *dp)
         if (*dp->d_name.name != '/' && vcp->mvstat == 2) /* root vnode */
            check_bad_parent(dp); /* check and correct mvid */
        vcache2inode(vcp);
+#ifdef AFS_LINUX24_ENV
+       unlock_kernel();
+#endif
        AFS_GUNLOCK();
        return 0;
     }
@@ -605,6 +696,9 @@ static int afs_linux_dentry_revalidate(struct dentry *dp)
     if (!code)
        code = afs_VerifyVCache(vcp, &treq);
 
+#ifdef AFS_LINUX24_ENV
+    unlock_kernel();
+#endif
     AFS_GUNLOCK();
     crfree(credp);
 
@@ -614,16 +708,36 @@ static int afs_linux_dentry_revalidate(struct dentry *dp)
 /* afs_dentry_iput */
 static void afs_dentry_iput(struct dentry *dp, struct inode *ip)
 {
+#if defined(AFS_LINUX24_ENV)
+    if (atomic_read(&ip->i_count) == 0 || atomic_read(&ip->i_count) & 0xffff0000) {
+#else
     if (ip->i_count == 0 || ip->i_count & 0xffff0000) {
+#endif
        osi_Panic("Bad refCount %d on inode 0x%x\n",
+#if defined(AFS_LINUX24_ENV)
+                 atomic_read(&ip->i_count), ip);
+#else
                  ip->i_count, ip);
+#endif
     }
+#if defined(AFS_LINUX24_ENV)
+    atomic_dec(&ip->i_count);
+    if (!atomic_read(&ip->i_count)) {
+#else
     ip->i_count --;
     if (!ip->i_count) {
+#endif
        afs_delete_inode(ip);
     }
 }
 
+#if defined(AFS_LINUX24_ENV)
+struct dentry_operations afs_dentry_operations = {
+       d_revalidate:   afs_linux_dentry_revalidate,
+       d_iput:         afs_dentry_iput,
+};
+struct dentry_operations *afs_dops = &afs_dentry_operations;
+#else
 struct dentry_operations afs_dentry_operations = {
        afs_linux_dentry_revalidate,    /* d_validate(struct dentry *) */
        NULL,                   /* d_hash */
@@ -633,6 +747,7 @@ struct dentry_operations afs_dentry_operations = {
        afs_dentry_iput         /* d_iput(struct dentry *, struct inode *) */
 };
 struct dentry_operations *afs_dops = &afs_dentry_operations;
+#endif
 
 /**********************************************************************
  * AFS Linux inode operations
@@ -665,10 +780,26 @@ int afs_linux_create(struct inode *dip, struct dentry *dp, int mode)
     if (!code) {
        vattr2inode(ip, &vattr);
        /* Reset ops if symlink or directory. */
+#if defined(AFS_LINUX24_ENV)
+       if (S_ISREG(ip->i_mode)) {
+           ip->i_op = &afs_file_iops;
+           ip->i_fop = &afs_file_fops;
+           ip->i_data.a_ops = &afs_file_aops;
+        } else if (S_ISDIR(ip->i_mode)) {
+           ip->i_op = &afs_dir_iops;
+           ip->i_fop = &afs_dir_fops;
+        } else if (S_ISLNK(ip->i_mode)) {
+           ip->i_op = &afs_symlink_iops;
+           ip->i_data.a_ops = &afs_symlink_aops;
+           ip->i_mapping = &ip->i_data;
+        } else
+           printk("afs_linux_create: FIXME\n");
+#else
        if (S_ISDIR(ip->i_mode))
            ip->i_op = &afs_dir_iops;
        else if (S_ISLNK(ip->i_mode))
            ip->i_op = &afs_symlink_iops;
+#endif
 
        dp->d_op = afs_dops;
        d_instantiate(dp, ip);
@@ -696,10 +827,26 @@ int afs_linux_lookup(struct inode *dip, struct dentry *dp)
     if (vcp) {
        struct inode *ip = (struct inode*)vcp;
        /* Reset ops if symlink or directory. */
+#if defined(AFS_LINUX24_ENV)
+       if (S_ISREG(ip->i_mode)) {
+           ip->i_op = &afs_file_iops;
+           ip->i_fop = &afs_file_fops;
+           ip->i_data.a_ops = &afs_file_aops;
+        } else if (S_ISDIR(ip->i_mode)) {
+           ip->i_op = &afs_dir_iops;
+           ip->i_fop = &afs_dir_fops;
+        } else if (S_ISLNK(ip->i_mode)) {
+           ip->i_op = &afs_symlink_iops;
+           ip->i_data.a_ops = &afs_symlink_aops;
+           ip->i_mapping = &ip->i_data;
+       } else
+           printk("afs_linux_lookup: FIXME\n");
+#else
        if (S_ISDIR(ip->i_mode))
            ip->i_op = &afs_dir_iops;
        else if (S_ISLNK(ip->i_mode))
            ip->i_op = &afs_symlink_iops;
+#endif
     }
     dp->d_op = afs_dops;
     d_add(dp, (struct inode*)vcp);
@@ -753,7 +900,11 @@ int afs_linux_unlink(struct inode *dip, struct dentry *dp)
     if (!list_empty(&dp->d_hash)) {
        d_drop(dp);
        /* Install a definite non-existence if we're the only user. */
+#if defined(AFS_LINUX24_ENV)
+       if (atomic_read(&dp->d_count) == 1)
+#else
        if (dp->d_count == 1)
+#endif
            putback = 1;
     }
 
@@ -807,6 +958,9 @@ int afs_linux_mkdir(struct inode *dip, struct dentry *dp, int mode)
 
     if (tvcp) {
        tvcp->v.v_op = &afs_dir_iops;
+#if defined(AFS_LINUX24_ENV)
+       tvcp->v.v_fop = &afs_dir_fops;
+#endif
        dp->d_op = afs_dops;
        d_instantiate(dp, (struct inode*)tvcp);
     }
@@ -897,6 +1051,7 @@ static int afs_linux_ireadlink(struct inode *ip, char *target, int maxlen,
        return -code;
 }
 
+#if !defined(AFS_LINUX24_ENV)
 /* afs_linux_readlink 
  * Fill target (which is in user space) with contents of symlink.
  */
@@ -923,7 +1078,6 @@ struct dentry * afs_linux_follow_link(struct dentry *dp,
     char *name;
     struct dentry *res;
 
-
     AFS_GLOCK();
     name = osi_Alloc(PATH_MAX+1);
     if (!name) {
@@ -949,6 +1103,7 @@ struct dentry * afs_linux_follow_link(struct dentry *dp,
     AFS_GUNLOCK();
     return res;
 }
+#endif
 
 /* afs_linux_readpage
  * all reads come through here. A strategy-like read call.
@@ -973,9 +1128,20 @@ int afs_linux_readpage(struct file *fp, struct page *pp)
     set_bit(PG_locked, &pp->flags); /* other bits? See mm.h */
     clear_bit(PG_error, &pp->flags);
 
+#if defined(AFS_LINUX24_ENV)
+    setup_uio(&tuio, &iovec, (char*)address, pp->index << PAGE_CACHE_SHIFT,
+             PAGESIZE, UIO_READ, AFS_UIOSYS);
+#else
     setup_uio(&tuio, &iovec, (char*)address, pp->offset, PAGESIZE,
              UIO_READ, AFS_UIOSYS);
+#endif
+#ifdef AFS_LINUX24_ENV
+    lock_kernel();
+#endif
     code = afs_rdwr((struct vcache*)ip, &tuio, UIO_READ, 0, credp);
+#ifdef AFS_LINUX24_ENV
+    unlock_kernel();
+#endif
 
     if (!code) {
        if (tuio.uio_resid) /* zero remainder of page */
@@ -999,7 +1165,7 @@ int afs_linux_readpage(struct file *fp, struct page *pp)
 }
 
 #ifdef NOTUSED
-/* afs_linux_writepage - is this used anywhere? */
+/* afs_linux_writepage - is this used anywhere? swap files via nfs? */
 int afs_linux_writepage(struct inode *ip, struct page *) { return -EINVAL };
 
 /* afs_linux_bmap - supports generic_readpage, but we roll our own. */
@@ -1060,12 +1226,21 @@ int afs_linux_updatepage(struct file *fp, struct page *pp,
 
     credp = crref();
     AFS_GLOCK();
+#ifdef AFS_LINUX24_ENV
+    lock_kernel();
+#endif
     afs_Trace4(afs_iclSetp, CM_TRACE_UPDATEPAGE, ICL_TYPE_POINTER, vcp,
               ICL_TYPE_POINTER, pp,
               ICL_TYPE_INT32, atomic_read(&pp->count),
               ICL_TYPE_INT32, 99999);
+#if defined(AFS_LINUX24_ENV)
+    setup_uio(&tuio, &iovec, page_addr + offset,
+             (pp->index << PAGE_CACHE_SHIFT) + offset, count,
+             UIO_WRITE, AFS_UIOSYS);
+#else
     setup_uio(&tuio, &iovec, page_addr + offset, pp->offset + offset, count,
              UIO_WRITE, AFS_UIOSYS);
+#endif
 
     code = afs_write(vcp, &tuio, fp->f_flags, credp, 0);
 
@@ -1077,6 +1252,9 @@ int afs_linux_updatepage(struct file *fp, struct page *pp,
               ICL_TYPE_INT32, atomic_read(&pp->count),
               ICL_TYPE_INT32, code);
 
+#ifdef AFS_LINUX24_ENV
+    unlock_kernel();
+#endif
     AFS_GUNLOCK();
     crfree(credp);
 
@@ -1084,8 +1262,42 @@ int afs_linux_updatepage(struct file *fp, struct page *pp,
     return code;
 }
 
+#if defined(AFS_LINUX24_ENV)
+static int afs_linux_commit_write(struct file *file, struct page *page, unsigned offset, unsigned to)
+{
+    long status;
+    loff_t pos = ((loff_t)page->index<<PAGE_CACHE_SHIFT) + to;
+
+    status = afs_linux_updatepage(file, page, offset, to-offset, 1);
+    kunmap(page);
 
+    return status;
+}
+
+static int afs_linux_prepare_write(struct file *file, struct page *page,
+                                  unsigned from, unsigned to)
+{
+    kmap(page);
+    return 0;
+}
+
+extern int afs_notify_change(struct dentry *dp, struct iattr* iattrp);
+#endif
+
+#if defined(AFS_LINUX24_ENV)
+struct inode_operations afs_file_iops = {
+    revalidate:                afs_linux_revalidate,
+    setattr:           afs_notify_change,
+    permission:                afs_linux_permission,
+};
+struct address_space_operations afs_file_aops = {
+        readpage: afs_linux_readpage,
+        commit_write: afs_linux_commit_write,
+        prepare_write: afs_linux_prepare_write,
+};
 
+struct inode_operations *afs_ops = &afs_file_iops;
+#else
 struct inode_operations afs_iops = {
     &afs_file_fops,    /* file operations */
     NULL,                      /* afs_linux_create */
@@ -1109,9 +1321,27 @@ struct inode_operations afs_iops = {
     afs_linux_revalidate,
 };
 
+struct inode_operations *afs_ops = &afs_iops;
+#endif
+
 /* Separate ops vector for directories. Linux 2.2 tests type of inode
  * by what sort of operation is allowed.....
  */
+#if defined(AFS_LINUX24_ENV)
+struct inode_operations afs_dir_iops = {
+    create:    afs_linux_create,
+    lookup:    afs_linux_lookup,
+    link:      afs_linux_link,
+    unlink:    afs_linux_unlink,
+    symlink:   afs_linux_symlink,
+    mkdir:     afs_linux_mkdir,
+    rmdir:     afs_linux_rmdir,
+    rename:    afs_linux_rename,
+    revalidate:        afs_linux_revalidate,
+    setattr:   afs_notify_change,
+    permission:        afs_linux_permission,
+};
+#else
 struct inode_operations afs_dir_iops = {
     &afs_dir_fops,     /* file operations for directories */
     afs_linux_create,
@@ -1134,12 +1364,49 @@ struct inode_operations afs_dir_iops = {
     NULL,              /* afs_linux_updatepage */
     afs_linux_revalidate,
 };
-
-struct inode_operations *afs_ops = &afs_iops;
+#endif
 
 /* We really need a separate symlink set of ops, since do_follow_link()
  * determines if it _is_ a link by checking if the follow_link op is set.
  */
+#if defined(AFS_LINUX24_ENV)
+static int afs_symlink_filler(struct file *file, struct page *page)
+{
+    struct inode *ip = (struct inode *) page->mapping->host;
+    char *p = (char *)kmap(page);
+    int code;
+
+    AFS_GLOCK();
+    lock_kernel();
+    code = afs_linux_ireadlink(ip, p, PAGE_SIZE, AFS_UIOSYS);
+    unlock_kernel();
+    AFS_GUNLOCK();
+
+    if (code<0)
+           goto fail;
+    p[code] = '\0';            /* null terminate? */
+    SetPageUptodate(page);
+    kunmap(page);
+    UnlockPage(page);
+    return 0;
+
+fail:
+    SetPageError(page);
+    kunmap(page);
+    UnlockPage(page);
+    return code;
+}
+
+struct address_space_operations afs_symlink_aops = {
+       readpage:       afs_symlink_filler
+};
+
+struct inode_operations afs_symlink_iops = {
+    readlink:          page_readlink,
+    follow_link:       page_follow_link,
+    setattr:           afs_notify_change,
+};
+#else
 struct inode_operations afs_symlink_iops = {
     NULL,              /* file operations */
     NULL,              /* create */
@@ -1162,3 +1429,4 @@ struct inode_operations afs_symlink_iops = {
     NULL,              /* updatepage */
     afs_linux_revalidate, /* tho the code appears to indicate not used? */
 };
+#endif
index aa9f848e061880bd64799319616cc82c678aff87..a73f40f7b2060fa4b40d7c7adcf8aa13f7fb54ff 100644 (file)
@@ -32,7 +32,7 @@ kinstall: AFS_component_version_number.c
        case ${SYS_NAME} in \
                sgi_* ) \
                        gencat -m afszcm.cat afs_trace.msf ;; \
-               i386_linux* ) \
+               *_linux* ) \
                        gencat --new afszcm.cat afs_trace.msf ;; \
                * ) \
                        gencat afszcm.cat afs_trace.msf ;; \
index 6982a43e8fb45863c30cfb776ffb4b6993b0dcb8..306b282fa2e8287c67f63657f65c12e92b95805f 100644 (file)
@@ -39,7 +39,11 @@ getinode(vfsp, dev, inode, ipp, credp,perror)
     
     *perror = 0;
     
-    if (!vfsp && !(vfsp = vfs_devsearch(dev))) {
+    if (!vfsp 
+#if !defined(AFS_SUN58_ENV)
+       && !(vfsp = vfs_devsearch(dev))
+#endif
+       ) {
        return (ENODEV);
     }
     if (code = (*ufs_igetp)(vfsp, inode, &ip, credp)) {
index e9b25fa4fce437d5507c8e3db1eb2193f7855981..343df6dc5f0bb3a0c555fbdcb055e3912fc6880f 100644 (file)
@@ -433,7 +433,9 @@ _init()
 #else
     read_binding_file(sysbind, sb_hashtab);
 #endif
+#if !defined(AFS_SUN58_ENV)
     make_syscallname("afs", AFS_SYSCALL);
+#endif
 
     if (sysent[AFS_SYSCALL].sy_call == nosys) {
        if ((sysn = mod_getsysname(AFS_SYSCALL)) != NULL) {
index 797f9815ecbc4fa57786f29244fd3bdd442dbc44..518186300d32b6316ecda73f4ad15d8bb798541b 100644 (file)
@@ -511,7 +511,7 @@ struct AFS_UCRED *acred; {
        acmd = F_SETLK;
     }
 #endif
-#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)
+#if (defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)) && !defined(AFS_SUN58_ENV)
     if ((acmd == F_GETLK) || (acmd == F_RGETLK)) {
 #else
     if (acmd == F_GETLK) {
@@ -525,7 +525,7 @@ struct AFS_UCRED *acred; {
        return code;
     }
     else if ((acmd == F_SETLK) || (acmd == F_SETLKW) 
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV)
+#if (defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)) && !defined(AFS_SUN58_ENV)
             || (acmd == F_RSETLK)|| (acmd == F_RSETLKW)) {
 #else
        ) {
@@ -548,7 +548,7 @@ struct AFS_UCRED *acred; {
        else if (af->l_type == F_UNLCK) code = LOCK_UN;
        else return EINVAL; /* unknown lock type */
        if (((acmd == F_SETLK) 
-#if    defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV)
+#if    (defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV)) && !defined(AFS_SUN58_ENV)
        || (acmd == F_RSETLK) 
 #endif
        ) && code != LOCK_UN)
index a17c0149a1def72204bcfaa3cc3345cc2a158051..32bfc5cbac4bc57b8703033a8c552ac54e309959 100644 (file)
@@ -36,6 +36,9 @@
 #if    defined(AFS_SUN56_ENV)
 #include <inet/led.h>
 #include <inet/common.h>
+#if     defined(AFS_SUN58_ENV)
+#include <netinet/ip6.h>
+#endif
 #include <inet/ip.h>
 #endif
 
index 9bb5046ff67c6b648d6a64203cf21e26c7bf0e3e..2b271e1b56643f16501e1a7b8a729ee169128828 100644 (file)
@@ -32,6 +32,9 @@
 #if    defined(AFS_SUN56_ENV)
 #include <inet/led.h>
 #include <inet/common.h>
+#if     defined(AFS_SUN58_ENV)
+#include <netinet/ip6.h>
+#endif
 #include <inet/ip.h>
 #endif
 
index c57216ab7793de1508ff27ffb442d188da2d7a94..16bc447e7e85c091d8dc52c119f1d43f15a80cd4 100644 (file)
@@ -32,6 +32,9 @@
 #if    defined(AFS_SUN56_ENV)
 #include <inet/led.h>
 #include <inet/common.h>
+#if     defined(AFS_SUN58_ENV)
+#include <netinet/ip6.h>
+#endif
 #include <inet/ip.h>
 #endif
 
index 8fe31b417df2566f191d34d5432298d3810541df..e2ddf743b09e7b42ceca52b5328c1713c42639d3 100644 (file)
 #if    defined(AFS_SUN56_ENV)
 #include <inet/led.h>
 #include <inet/common.h>
+#if     defined(AFS_SUN58_ENV)
+# include <netinet/ip6.h>
+# define ipif_local_addr ipif_lcl_addr
+#  ifndef V4_PART_OF_V6
+#  define V4_PART_OF_V6(v6)       v6.s6_addr32[3]
+#  endif
+# endif
 #include <inet/ip.h>
 #endif
 
index 65aaeaced2fc62e4b28cddc422da25aae10e26d4..18c317d572b66c096fd15121915358bf1499b151 100644 (file)
@@ -32,6 +32,9 @@
 #if    defined(AFS_SUN56_ENV)
 #include <inet/led.h>
 #include <inet/common.h>
+#if   defined(AFS_SUN58_ENV)
+#include <netinet/ip6.h>
+#endif
 #include <inet/ip.h>
 #endif
 
index b1e1a4b99febf2fb3db1e8c533c5faf7ab2b781f..4d22160ad862361bac5e6f1c7f598064e2dbe002 100644 (file)
@@ -34,6 +34,9 @@
 #if    defined(AFS_SUN56_ENV)
 #include <inet/led.h>
 #include <inet/common.h>
+#if     defined(AFS_SUN58_ENV)
+#include <netinet/ip6.h>
+#endif
 #include <inet/ip.h>
 #endif
 
index aa24dafbb12deeff0b14a6ea016db4c68aa0b534..385374ce20d61a15f189bfdd01e808e1d0ca843f 100644 (file)
@@ -585,22 +585,37 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
                    struct list_head *cur;
                    struct list_head *head = &ip->i_dentry;
                    int all = 1;
-               retry:
+               restart:
+#if defined(AFS_LINUX24_ENV)
+                   spin_lock(&dcache_lock);
+#endif
                    cur = head;
                    while ((cur = cur->next) != head) {
                        struct dentry *dentry = list_entry(cur, struct dentry, d_alias);
+#if defined(AFS_LINUX24_ENV)
+                       if (!atomic_read(&dentry->d_count)) {
+#else
                        if (!dentry->d_count) {
+#endif
                            AFS_GUNLOCK();
+#if defined(AFS_LINUX24_ENV)
+                           dget_locked(dentry);
+                           spin_unlock(&dcache_lock);
+#else
                            dget(dentry);
+#endif
                            d_drop(dentry);
                            dput(dentry);
                            AFS_GLOCK();
-                           goto retry;
+                           goto restart;
                        }
                        else {
                            all = 0;
                        }
                    }
+#if defined(AFS_LINUX24_ENV)
+                   spin_unlock(&dcache_lock);
+#endif
                    if (all) vn --;
                }
            }
@@ -904,8 +919,17 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
     {
        struct inode *ip = (struct inode*)tvc;
        sema_init(&ip->i_sem, 1);
+#if defined(AFS_LINUX24_ENV)
+       sema_init(&ip->i_zombie, 1);
+       init_waitqueue_head(&ip->i_wait);
+       spin_lock_init(&ip->i_data.i_shared_lock);
+       INIT_LIST_HEAD(&ip->i_data.pages);
+       ip->i_data.host = (void*) ip;
+       ip->i_mapping = &ip->i_data;
+#else
        sema_init(&ip->i_atomic_write, 1);
        init_waitqueue(&ip->i_wait);
+#endif
        INIT_LIST_HEAD(&ip->i_hash);
        INIT_LIST_HEAD(&ip->i_dentry);
        if (afs_globalVFS) {
index 909a48c4b6e19f43b07b393a5333fafc1f45140a..427e31563d0b553b61210a90bf60bc00d9caf639 100644 (file)
@@ -37,6 +37,9 @@
 #if    defined(AFS_SUN56_ENV)
 #include <inet/led.h>
 #include <inet/common.h>
+#if     defined(AFS_SUN58_ENV)
+#include <netinet/ip6.h>
+#endif
 #include <inet/ip.h>
 #endif
 
index d748260f5382d4632be402660cf2a586545509e8..debf725943a6bfdaff5ef1032314a04c2cbb3268 100644 (file)
@@ -88,6 +88,8 @@ install: all
                        ${INSTALL} -f afs.rc.solaris ${DESTDIR}root.client/usr/vice/etc/modload/afs.rc ;;\
                sun4x_57 ) \
                        ${INSTALL} -f afs.rc.solaris.2.7 ${DESTDIR}root.client/usr/vice/etc/modload/afs.rc ;;\
+               sun4x_58 ) \
+                       ${INSTALL} -f afs.rc.solaris.2.8 ${DESTDIR}root.client/usr/vice/etc/modload/afs.rc ;;\
                 sun4x_5? ) \
                         ${INSTALL} -f afs.rc.solaris.2_5 ${DESTDIR}root.client/usr/vice/etc/modload/afs.rc ;;\
                alpha_osf* ) \
index fb311f1f098f6821072016c5f247102716b94979..57eb222c92957ad5c3b8dbf81e4813b7ebc1d41b 100644 (file)
@@ -1368,7 +1368,7 @@ mainproc(as, arock)
 #endif
 #else
 #ifdef AFS_SUN5_ENV
-    if ((mount("",cacheMountDir,mountFlags,"afs", (char *)0, 0)) < 0) {
+    if ((mount("AFS",cacheMountDir,mountFlags,"afs", (char *)0, 0)) < 0) {
 #else
 #if defined(AFS_SGI_ENV)
     mountFlags = MS_FSS;
@@ -1464,7 +1464,7 @@ char **argv; {
 #endif
 
 static int HandleMTab() {
-#if defined (AFS_SUN_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV)
+#if (defined (AFS_SUN_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV)) && !defined(AFS_SUN58_ENV)
     FILE *tfilep;
 #ifdef AFS_SUN5_ENV
     char tbuf[16];
index b1625c49b68ea43338abf97fe8ca7c4f2b7462d6..d0575c64e55d92144fe4d86af1c0be31ffa701ac 100644 (file)
@@ -86,7 +86,7 @@ doc:  com_err.dvi
 #
 compile_et:    compile_et.o error_table.o
        case $(SYS_NAME) in \
-       i386_linux* ) \
+       *_linux* ) \
        ${CC} ${CFLAGS} -o compile_et compile_et.o error_table.o ${utilib};; \
        * ) \
        ${CC} ${CFLAGS} -o compile_et compile_et.o error_table.o ${utilib} -ll;; \
index 638eb7269dfe9103e5bcbe57e33561b74f2dc60e..c7707a50bdfbc1e330933431f6d30b5565382e8c 100644 (file)
@@ -144,7 +144,8 @@ afscdefs =\
        -I$(DESTDIR)\include\afs \
        -I$(DESTDIR)\include\rx \
        -DWIN32_LEAN_AND_MEAN \
-       -DSTRICT
+       -DSTRICT \
+       -D_WIN32_IE=0x0400
 
 afscdefs = $(afscdefs) $(AFSDEV_AUXCDEFINES)
 
index 4c25810bbec720af4505d94f6f4f8ddca6c8a725..33d64d40b8bb4f7a451ce1707908f1afe69f1c39 100644 (file)
@@ -77,6 +77,7 @@
 #define SYS_NAME_ID_sunx86_56                   936
 #define SYS_NAME_ID_sunx86_55                   937
 #define SYS_NAME_ID_sun4x_57            938
+#define SYS_NAME_ID_sun4x_58            939
 
 
 #define SYS_NAME_ID_vax_ul4            1003
 
 #define SYS_NAME_ID_i386_linux2                1500
 #define SYS_NAME_ID_i386_linux22       1501
+#define SYS_NAME_ID_i386_linux24        1502
+
+#define SYS_NAME_ID_ppc_linux2          1600
+#define SYS_NAME_ID_ppc_linux22         1601
+#define SYS_NAME_ID_ppc_linux24         1602
+
+
 
 /*
  * Placeholder to keep system-wide standard flags since this file is included by all 
index 9dbb4b622d428480b9b6bee5742a551344cce6d0..5613adf65f12c9b66b70f3e4dcf13f970613e472 100644 (file)
 #include "conf-winnt.h"
 #else
 #ifdef AFS_LINUX20_ENV
+#ifdef AFS_PPC_LINUX20_ENV
+#include "conf-ppc-linux.h"
+#else
 #include "conf-i386-linux.h"
+#endif
 #else
 Sorry, you lose.
 Figure out what the machine looks like and fix this file to include it.
index 873062af4e75e6836a0ae46b910c3e1fb32a1594..666f5ef8f1e698df03d4bba6c1ebc1eeaf66f55d 100644 (file)
@@ -34,7 +34,7 @@ CC = /opt/SUNWspro/bin/cc
 KDEFS= -Dsun4c -DSUN4C_60 -DNFSCLIENT -DSYSACCT -DOLDSCSI -DVDDRV -D_KERNEL \
        -DSYSV -dn ${ARCH_DEFS}
 
-<sun4x_57>
+<sun4x_57 sun4x_58>
 KDEFS_32 = 
 KDEFS_64 = -xarch=v9
 
@@ -42,17 +42,17 @@ KDEFS_64 = -xarch=v9
 CFLAGS=-I. -I.. ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
 
 # Name of directory to hold object files and libraries.
-<all -sun4x_57>
+<all -sun4x_57 -sun4x_58>
 KOBJ = MODLOAD
-<sun4x_57>
+<sun4x_57 sun4x_58>
 KOBJ = MODLOAD32 MODLOAD64
 
 
 # This tells Makefile.common to use it's single directory build target.
-<all -sun4x_57>
+<all -sun4x_57 -sun4x_58>
 COMPDIRS = single_compdir
 
-<sun4x_57>
+<sun4x_57 sun4x_58>
 COMPDIRS = solaris_compdirs
 
 <all>
@@ -81,7 +81,7 @@ setup:
 ## This is the target for a Solaris 7. Here we build both the 32 bit and
 ## the 64 bit libafs in MODLOAD32 and MODLOAD64 directories respectively
 
-<sun4x_57>
+<sun4x_57 sun4x_58>
 ${COMPDIRS}:
        for t in ${KOBJ} ; do \
                echo Building directory: $$t ; \
@@ -106,7 +106,7 @@ ${COMPDIRS}:
 LIBAFS = libafs.o
 LIBAFSNONFS = libafs.nonfs.o
 
-<all -sun4x_57>
+<all -sun4x_57 sun4x_58>
 DEST_LIBAFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS}
 DEST_LIBAFSNONFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFSNONFS}
 
@@ -130,7 +130,7 @@ ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
        $(RM) -f $@
        $(LD) -r -o $@  $(AFSAOBJS) ${AFSNONFSOBJS}
 
-<sun4x_57>
+<sun4x_57 sun4x_58>
 MODLOADDIR = ${DESTDIR}root.client/usr/vice/etc/modload
 
 libafs: ${LIBAFSNONFS}
index dda928744bad9de64bf55a22e30fe1704d21cd46..cfacbe4fea232e2e556e230fb33f0e2663bec7cd 100644 (file)
@@ -66,7 +66,7 @@ process.o     : process.s process.c
                                        $(CC) -c -I${SRCDIR}include -KPIC -G0  process.s;; \
                                sgi_61 | sgi_62 | sgi_63 ) \
                                        $(CC) -c ${XCFLAGS} -I${SRCDIR}include -KPIC -G0  process.s;; \
-                               hp* | i386_linux* | sgi_64 | sgi_65) \
+                               hp* | *_linux* | sgi_64 | sgi_65) \
                                        ${CC} ${CFLAGS} -c process.c;; \
                                ncrx86_*) \
                                        /usr/ccs/lib/cpp -P -I${SRCDIR}include process.s process.ss; \
index ad6e676c2cbfd756f538faebca07424c1124c0ca..706752bdf4fdabcea44e7d552373a8f65f88ff44 100644 (file)
@@ -31,7 +31,11 @@ extern char PRE_Block;             /* used in lwp.c and process.s */
 #elif  defined(AFS_HPUX_ENV)
 #define        LWP_SP  1
 #elif  defined(AFS_LINUX20_ENV)
+#if defined(AFS_PPC_LINUX20_ENV)
+#define LWP_SP 0
+#else
 #define LWP_SP 4
+#endif
 #else
      Need offset to SP in jmp_buf for this platform.
 #endif
index 66ed1c838940b403b69b4a5270f969916ebb4711..6a53dd110cb92ebc18e7c2672c4d3536ad1521ef 100644 (file)
@@ -39,8 +39,11 @@ typedef struct afs_kmutex {
     int owner;
 } afs_kmutex_t;
 
+#if defined(AFS_LINUX24_ENV)
+typedef wait_queue_head_t afs_kcondvar_t;
+#else
 typedef struct wait_queue *afs_kcondvar_t;
-
+#endif
 
 static inline int MUTEX_ISMINE(afs_kmutex_t *l)
 {
@@ -50,7 +53,11 @@ static inline int MUTEX_ISMINE(afs_kmutex_t *l)
 
 static inline void afs_mutex_init(afs_kmutex_t *l)
 {
+#if defined(AFS_LINUX24_ENV)
+    init_MUTEX(&l->sem);
+#else
     l->sem = MUTEX;
+#endif
     l->owner = 0;
 }
 #define MUTEX_INIT(a,b,c,d) afs_mutex_init(a)
@@ -85,7 +92,11 @@ static inline void MUTEX_EXIT(afs_kmutex_t *l)
     up(&l->sem);
 }
 
+#if defined(AFS_LINUX24_ENV)
+#define CV_INIT(cv,b,c,d) init_waitqueue_head((wait_queue_head_t *)(cv))
+#else
 #define CV_INIT(cv,b,c,d) init_waitqueue((struct wait_queue**)(cv))
+#endif
 #define CV_DESTROY(cv)
 
 /* CV_WAIT and CV_TIMEDWAIT rely on the fact that the Linux kernel has
@@ -99,7 +110,11 @@ static inline CV_WAIT(afs_kcondvar_t *cv, afs_kmutex_t *l)
     if (isAFSGlocked) AFS_GUNLOCK();
     MUTEX_EXIT(l);
 
+#if defined(AFS_LINUX24_ENV)
+    interruptible_sleep_on((wait_queue_head_t *)cv);
+#else
     interruptible_sleep_on((struct wait_queue**)cv);
+#endif
 
     MUTEX_ENTER(l);
     if (isAFSGlocked) AFS_GLOCK();
@@ -115,7 +130,11 @@ static inline CV_TIMEDWAIT(afs_kcondvar_t *cv, afs_kmutex_t *l, int waittime)
     if (isAFSGlocked) AFS_GUNLOCK();
     MUTEX_EXIT(l);
     
+#if defined(AFS_LINUX24_ENV)
+    t = interruptible_sleep_on_timeout((wait_queue_head_t *)cv, t);
+#else
     t = interruptible_sleep_on_timeout((struct wait_queue**)cv, t);
+#endif
     
     MUTEX_ENTER(l);
     if (isAFSGlocked) AFS_GLOCK();
@@ -123,8 +142,13 @@ static inline CV_TIMEDWAIT(afs_kcondvar_t *cv, afs_kmutex_t *l, int waittime)
     return 0;
 }
 
+#if defined(AFS_LINUX24_ENV)
+#define CV_SIGNAL(cv) wake_up((wait_queue_head_t *)cv)
+#define CV_BROADCAST(cv) wake_up((wait_queue_head_t *)cv)
+#else
 #define CV_SIGNAL(cv) wake_up((struct wait_queue**)cv)
 #define CV_BROADCAST(cv) wake_up((struct wait_queue**)cv)
+#endif
 
 #else
 
index 9d3dcfa84f0b2c675261540c67a7896b4d89697d..37a39f41f0908959953a7394841fb66a1946b6ac 100644 (file)
@@ -15,6 +15,9 @@
 #include "../afs/param.h"
 #ifdef AFS_LINUX22_ENV
 #include "../rx/rx_kcommon.h"
+#if defined(AFS_LINUX24_ENV)
+#include "../h/smp_lock.h"
+#endif
 #include <asm/uaccess.h>
 
 /* rxk_NewSocket
@@ -38,7 +41,11 @@ struct osi_socket *rxk_NewSocket(short aport)
     code = sockp->ops->bind(sockp, (struct sockaddr*)&myaddr, sizeof(myaddr));
 
     if (code<0) {
+#if defined(AFS_LINUX24_ENV)
+       printk("sock_release(rx_socket) FIXME\n");
+#else
        sock_release(sockp);
+#endif
        return NULL;
     }
 
index afcc7efcce4a5e759ef2fbabdac42aaa1efcbe1f..44e2a0f494d27877217420532cb66e53cfa85df3 100644 (file)
@@ -39,7 +39,7 @@ LIBS = librx.a ${SRCDIR}lib/liblwp.a ${SRCDIR}lib/afs/libcmd.a \
 LINK = ${CC} ${CFLAGS} -o $@ $@.o ${LIBS} ${SRCDIR}lib/afs/libsys.a ${XLIBS}
 
 KSRCS = rx.c rx.h rx_clock.c rx_clock.h rx_event.c rx_event.h \
-       rx_globals.c rx_globals.h rx_kernel.h \
+       rx_globals.c rx_globals.h rx_kernel.h rx_misc.h \
        rx_null.c rx_null.h rx_queue.h rx_getaddr.c rx_packet.c rx_packet.h \
        rx_multi.h rx_kcommon.h rx_kcommon.c \
        xdr.c xdr.h xdr_array.c xdr_arrayn.c xdr_rx.c rx_misc.c rx_rdwr.c \
@@ -124,7 +124,7 @@ kinstall: includes
                $(INSTALL) DUX/*.[ch] $(KERNELDIR)rx;; \
        hp_ux* ) \
                $(INSTALL) HPUX/*.[ch] $(KERNELDIR)rx;; \
-       i386_linux* ) \
+       *_linux* ) \
                $(INSTALL) LINUX/*.[ch] $(KERNELDIR)rx;; \
        rs_aix* ) \
                $(INSTALL) AIX/*.[ch] $(KERNELDIR)rx;; \
index 254b8c7a922d13192b119f3791fe3adcd503b681..c732bc9141117468359b7cda444b8dafdbd9e2f5 100644 (file)
@@ -21,6 +21,9 @@
 #include "../sys/stream.h"
 #include "../sys/tihdr.h"
 #include "../sys/fcntl.h"
+#ifdef AFS_SUN58_ENV
+#include "../netinet/ip6.h"
+#endif
 #include "../inet/ip.h"
 #include "../netinet/udp.h"
 
index f270d8f9bd0f3fddb07e8768923dfc42d673bf51..89d4c32f0f31a0d6f6b0e37e8957d9b11cb0a3a1 100644 (file)
@@ -2423,8 +2423,13 @@ void print_vnode(kmem, vep, ptr, pnt)
           vep->i_nrpages);
     printf("\ti_op=0x%x, i_dev=0x%x, i_rdev=0x%x, i_sb=0x%x\n",
           vep->i_op, vep->i_dev, vep->i_rdev, vep->i_sb);
+#ifdef AFS_LINUX24_ENV
+    printf("\ti_sem: count=%d, sleepers=%d, wait=0x%x\n",
+          vep->i_sem.count, vep->i_sem.sleepers, vep->i_sem.wait);
+#else
     printf("\ti_sem: count=%d, waking=%d, wait=0x%x\n",
           vep->i_sem.count, vep->i_sem.waking, vep->i_sem.wait);
+#endif
     printf("\ti_hash=0x%x:0x%x, i_list=0x%x:0x%x, i_dentry=0x%x:0x%x\n",
           vep->i_hash.prev, vep->i_hash.next,
           vep->i_list.prev, vep->i_list.next,