diff --git a/fs/coda/cnode.c b/fs/coda/cnode.c
index 7f198864db9af765f49ccef720efd1464074628e..95b5e49478f9b3fe4226d312ea14a2ed97ae13e6 100644
--- a/fs/coda/cnode.c
+++ b/fs/coda/cnode.c
@@ -13,16 +13,7 @@
 
 inline int coda_fideq(ViceFid *fid1, ViceFid *fid2)
 {
-	if (fid1->Vnode != fid2->Vnode)   return 0;
-	if (fid1->Volume != fid2->Volume) return 0;
-	if (fid1->Unique != fid2->Unique) return 0;
-	return 1;
-}
-
-inline int coda_isnullfid(ViceFid *fid)
-{
-	if (fid->Vnode || fid->Volume || fid->Unique) return 0;
-	return 1;
+	return memcmp(fid1, fid2, sizeof(*fid1)) == 0;
 }
 
 static struct inode_operations coda_symlink_inode_operations = {
diff --git a/fs/coda/coda_linux.c b/fs/coda/coda_linux.c
index 387f079d591d77ebe851bddf772cab065a66e0d7..4ab24ea7b49d037bb6651c2c8a17299dd0f1ae6b 100644
--- a/fs/coda/coda_linux.c
+++ b/fs/coda/coda_linux.c
@@ -28,7 +28,7 @@ int coda_fake_statfs;
 char * coda_f2s(ViceFid *f)
 {
 	static char s[60];
-	sprintf(s, "(%-#lx.%-#lx.%-#lx)", f->Volume, f->Vnode, f->Unique);
+	sprintf(s, "(%-#x.%-#x.%-#x)", f->Volume, f->Vnode, f->Unique);
 	return s;
 }
 
@@ -215,58 +215,3 @@ void coda_iattr_to_vattr(struct iattr *iattr, struct coda_vattr *vattr)
 	}
 }
 
-void print_vattr(struct coda_vattr *attr)
-{
-    char *typestr;
-
-    switch (attr->va_type) {
-    case C_VNON:
-	typestr = "C_VNON";
-	break;
-    case C_VREG:
-	typestr = "C_VREG";
-	break;
-    case C_VDIR:
-	typestr = "C_VDIR";
-	break;
-    case C_VBLK:
-	typestr = "C_VBLK";
-	break;
-    case C_VCHR:
-	typestr = "C_VCHR";
-	break;
-    case C_VLNK:
-	typestr = "C_VLNK";
-	break;
-    case C_VSOCK:
-	typestr = "C_VSCK";
-	break;
-    case C_VFIFO:
-	typestr = "C_VFFO";
-	break;
-    case C_VBAD:
-	typestr = "C_VBAD";
-	break;
-    default:
-	typestr = "????";
-	break;
-    }
-
-
-    printk("attr: type %s (%o)  mode %o uid %d gid %d rdev %d\n",
-	   typestr, (int)attr->va_type, (int)attr->va_mode, 
-	   (int)attr->va_uid, (int)attr->va_gid, (int)attr->va_rdev);
-    
-    printk("      fileid %d nlink %d size %d blocksize %d bytes %d\n",
-	      (int)attr->va_fileid, (int)attr->va_nlink, 
-	      (int)attr->va_size,
-	      (int)attr->va_blocksize,(int)attr->va_bytes);
-    printk("      gen %ld flags %ld\n",
-	      attr->va_gen, attr->va_flags);
-    printk("      atime sec %d nsec %d\n",
-	      (int)attr->va_atime.tv_sec, (int)attr->va_atime.tv_nsec);
-    printk("      mtime sec %d nsec %d\n",
-	      (int)attr->va_mtime.tv_sec, (int)attr->va_mtime.tv_nsec);
-    printk("      ctime sec %d nsec %d\n",
-	      (int)attr->va_ctime.tv_sec, (int)attr->va_ctime.tv_nsec);
-}
diff --git a/fs/coda/dir.c b/fs/coda/dir.c
index 4c75d774e0dd5a8d3199c0fd4d299c62a3ae90d6..b47f5eefd692439ea809b0712a7fe54413f5d473 100644
--- a/fs/coda/dir.c
+++ b/fs/coda/dir.c
@@ -588,8 +588,7 @@ static int coda_venus_readdir(struct file *filp, filldir_t filldir,
 			break;
 		}
 		/* validate whether the directory file actually makes sense */
-		if (vdir->d_reclen < vdir_size + vdir->d_namlen ||
-		    vdir->d_namlen > CODA_MAXNAMLEN) {
+		if (vdir->d_reclen < vdir_size + vdir->d_namlen) {
 			printk("coda_venus_readdir: Invalid dir: %ld\n",
 			       filp->f_dentry->d_inode->i_ino);
 			ret = -EBADF;
diff --git a/fs/coda/inode.c b/fs/coda/inode.c
index 75b933ab6373226d340faa1363c1cd723a66a234..73739d68c5f53cf8735fe5c719dbc4194a3590bf 100644
--- a/fs/coda/inode.c
+++ b/fs/coda/inode.c
@@ -169,7 +169,6 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
 
 	vc->vc_sb = sb;
 
-	sbi->sbi_sb = sb;
 	sbi->sbi_vcomm = vc;
 	INIT_LIST_HEAD(&sbi->sbi_cihead);
 
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c
index 9ae6077058399e13b6bef1f73efb1b7eab775148..fa607f0f4bc33df27d3643f5f6aab464457e9945 100644
--- a/fs/coda/psdev.c
+++ b/fs/coda/psdev.c
@@ -61,7 +61,6 @@ unsigned long coda_timeout = 30; /* .. secs, then signals will dequeue */
 
 
 struct venus_comm coda_comms[MAX_CODADEVS];
-kmem_cache_t *cii_cache, *cred_cache, *upc_cache;
 
 /*
  * Device operations
@@ -126,13 +125,13 @@ static ssize_t coda_psdev_write(struct file *file, const char *buf,
 		}
 
 		if  ( nbytes < sizeof(struct coda_out_hdr) ) {
-		        printk("coda_downcall opc %ld uniq %ld, not enough!\n",
+		        printk("coda_downcall opc %d uniq %d, not enough!\n",
 			       hdr.opcode, hdr.unique);
 			count = nbytes;
 			goto out;
 		}
 		if ( nbytes > size ) {
-		        printk("Coda: downcall opc %ld, uniq %ld, too much!",
+		        printk("Coda: downcall opc %d, uniq %d, too much!",
 			       hdr.opcode, hdr.unique);
 		        nbytes = size;
 		}
@@ -171,7 +170,7 @@ static ssize_t coda_psdev_write(struct file *file, const char *buf,
 	unlock_kernel();
 
 	if (!req) {
-		printk("psdev_write: msg (%ld, %ld) not found\n", 
+		printk("psdev_write: msg (%d, %d) not found\n", 
 			hdr.opcode, hdr.unique);
 		retval = -ESRCH;
 		goto out;
@@ -179,7 +178,7 @@ static ssize_t coda_psdev_write(struct file *file, const char *buf,
 
         /* move data into response buffer. */
 	if (req->uc_outSize < nbytes) {
-                printk("psdev_write: too much cnt: %d, cnt: %ld, opc: %ld, uniq: %ld.\n",
+                printk("psdev_write: too much cnt: %d, cnt: %ld, opc: %d, uniq: %d.\n",
 		       req->uc_outSize, (long)nbytes, hdr.opcode, hdr.unique);
 		nbytes = req->uc_outSize; /* don't have more space! */
 	}
@@ -325,10 +324,7 @@ static int coda_psdev_release(struct inode * inode, struct file * file)
 	}
         
         /* Wakeup clients so they can return. */
-	lh = vcp->vc_pending.next;
-	next = lh;
-	while ( (lh = next) != &vcp->vc_pending) {
-		next = lh->next;
+	list_for_each_safe(lh, next, &vcp->vc_pending) {
 		req = list_entry(lh, struct upc_req, uc_chain);
 		/* Async requests need to be freed here */
 		if (req->uc_flags & REQ_ASYNC) {
@@ -340,9 +336,7 @@ static int coda_psdev_release(struct inode * inode, struct file * file)
 		wake_up(&req->uc_sleep);
         }
         
-	lh = &vcp->vc_processing;
-	while ( (lh = lh->next) != &vcp->vc_processing) {
-		req = list_entry(lh, struct upc_req, uc_chain);
+	list_for_each_entry(req, &vcp->vc_processing, uc_chain) {
 		req->uc_flags |= REQ_ABORT;
 	        wake_up(&req->uc_sleep);
         }
diff --git a/include/linux/coda.h b/include/linux/coda.h
index 0ea09388b1918fb4faf9855196823bf08c392bfa..3d0065854c9c7a7e3d75916b4d5ec35b71cf47f0 100644
--- a/include/linux/coda.h
+++ b/include/linux/coda.h
@@ -163,11 +163,11 @@ typedef unsigned int	   u_int32_t;
 #ifndef _VENUS_DIRENT_T_
 #define _VENUS_DIRENT_T_ 1
 struct venus_dirent {
-        unsigned long	d_fileno;		/* file number of entry */
-        unsigned short	d_reclen;		/* length of this record */
-        unsigned char 	d_type;			/* file type, see below */
-        unsigned char	d_namlen;		/* length of string in d_name */
-        char		d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */
+        u_int32_t d_fileno;		/* file number of entry */
+        u_int16_t d_reclen;		/* length of this record */
+        u_int8_t  d_type;			/* file type, see below */
+        u_int8_t  d_namlen;		/* length of string in d_name */
+        char	  d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */
 };
 #undef DIRSIZ
 #define DIRSIZ(dp)      ((sizeof (struct venus_dirent) - (CODA_MAXNAMLEN+1)) + \
@@ -196,10 +196,10 @@ struct venus_dirent {
 
 #ifndef	_FID_T_
 #define _FID_T_	1
-typedef u_long VolumeId;
-typedef u_long VnodeId;
-typedef u_long Unique_t;
-typedef u_long FileVersion;
+typedef u_int32_t VolumeId;
+typedef u_int32_t VnodeId;
+typedef u_int32_t Unique_t;
+typedef u_int32_t FileVersion;
 #endif 
 
 #ifndef	_VICEFID_T_
@@ -336,19 +336,19 @@ struct coda_statfs {
  *        Venus <-> Coda  RPC arguments
  */
 struct coda_in_hdr {
-    unsigned long opcode;
-    unsigned long unique;	    /* Keep multiple outstanding msgs distinct */
-    u_short pid;		    /* Common to all */
-    u_short pgid;		    /* Common to all */
-    u_short sid;                    /* Common to all */
-    struct coda_cred cred;	    /* Common to all */
+    u_int32_t opcode;
+    u_int32_t unique;	    /* Keep multiple outstanding msgs distinct */
+    u_int16_t pid;	    /* Common to all */
+    u_int16_t pgid;	    /* Common to all */
+    u_int16_t sid;          /* Common to all */
+    struct coda_cred cred;  /* Common to all */
 };
 
 /* Really important that opcode and unique are 1st two fields! */
 struct coda_out_hdr {
-    unsigned long opcode;
-    unsigned long unique;	
-    unsigned long result;
+    u_int32_t opcode;
+    u_int32_t unique;	
+    u_int32_t result;
 };
 
 /* coda_root: NO_IN */
@@ -633,14 +633,6 @@ struct coda_zapdir_out {
     ViceFid CodaFid;
 };
 
-/* coda_zapnode: */
-/* CODA_ZAPVNODE is a venus->kernel call */	
-struct coda_zapvnode_out { 
-    struct coda_out_hdr oh;
-    struct coda_cred cred;
-    ViceFid VFid;
-};
-
 /* coda_purgefid: */
 /* CODA_PURGEFID is a venus->kernel call */	
 struct coda_purgefid_out { 
@@ -741,7 +733,6 @@ union outputArgs {
     struct coda_purgeuser_out coda_purgeuser;
     struct coda_zapfile_out coda_zapfile;
     struct coda_zapdir_out coda_zapdir;
-    struct coda_zapvnode_out coda_zapvnode;
     struct coda_purgefid_out coda_purgefid;
     struct coda_replace_out coda_replace;
     struct coda_open_by_fd_out coda_open_by_fd;
@@ -755,7 +746,6 @@ union coda_downcalls {
     struct coda_purgeuser_out purgeuser;
     struct coda_zapfile_out zapfile;
     struct coda_zapdir_out zapdir;
-    struct coda_zapvnode_out zapvnode;
     struct coda_purgefid_out purgefid;
     struct coda_replace_out replace;
 };
@@ -778,18 +768,9 @@ struct PioctlData {
         struct ViceIoctl vi;
 };
 
-#define	CODA_CONTROL		".CONTROL"
-#define CODA_CONTROLLEN           8
-#define	CTL_VOL			-1
-#define	CTL_VNO			-1
-#define	CTL_UNI			-1
-#define CTL_INO                 -1
-#define	CTL_FILE		"/coda/.CONTROL"
-
-
-#define	IS_CTL_FID(fidp)	((fidp)->Volume == CTL_VOL &&\
-				 (fidp)->Vnode == CTL_VNO &&\
-				 (fidp)->Unique == CTL_UNI)
+#define CODA_CONTROL		".CONTROL"
+#define CODA_CONTROLLEN		8
+#define CTL_INO			-1
 
 /* Data passed to mount */
 
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index 650a6f997f8a615c29dd41f86c80d5cced3dd5bf..80835f7dd00d8e587863a2c2c8fd85fcd63dfbf4 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -42,7 +42,6 @@ int coda_permission(struct inode *inode, int mask, struct nameidata *nd);
 int coda_revalidate_inode(struct dentry *);
 int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *);
 int coda_setattr(struct dentry *, struct iattr *);
-int coda_isnullfid(ViceFid *fid);
 
 /* global variables */
 extern int coda_fake_statfs;
@@ -59,7 +58,6 @@ void coda_load_creds(struct coda_cred *cred);
 void coda_vattr_to_iattr(struct inode *, struct coda_vattr *);
 void coda_iattr_to_vattr(struct iattr *, struct coda_vattr *);
 unsigned short coda_flags_to_cflags(unsigned short);
-void print_vattr( struct coda_vattr *attr );
 int coda_cred_ok(struct coda_cred *cred);
 int coda_cred_eq(struct coda_cred *cred1, struct coda_cred *cred2);
 
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h
index e355bcacac17b5c8e49ad3d0e08c3060107ced60..e8a5d2f18247db1c190d36980be70aa302a6e389 100644
--- a/include/linux/coda_psdev.h
+++ b/include/linux/coda_psdev.h
@@ -6,12 +6,11 @@
 
 #define CODA_SUPER_MAGIC	0x73757245
 
-struct statfs;
+struct kstatfs;
 
 struct coda_sb_info
 {
-	struct venus_comm * sbi_vcomm;
-	struct super_block *sbi_sb;
+	struct venus_comm *sbi_vcomm;
 	struct list_head    sbi_cihead;
 };