Hello,

I did the following changes to userfs-0.9.4.2 to compile with the
linux 2.0.35 kernel.

(I hope they don't get munged too much by Netscape.)

----------------------------------------------------------------------------
1998-12-18  Andreas Buschmann  <[EMAIL PROTECTED]>

        * contrib/ulrich-dessauer/fslib/fslib.c (fsino2inode): Add flags
        to open call.

1998-12-14  Andreas Buschmann  <[EMAIL PROTECTED]>

        * kernel/linux/userfs_types.ty (struct upp_open_s): Add flags.
        kernel/src/file.c (userfs_open): Add assignment to snd.flags.

1998-12 Andreas Buschmann  <[EMAIL PROTECTED]>

        * kernel/linux/userfs_types.ty (ALLOC): Add unused attribute.
        kernel/linux/coder.h: Add unused attribute to all inline functions.
        
1998-11 Andreas Buschmann  <[EMAIL PROTECTED]>

        contrib/ulrich-dessauer/misc/zip.c (main): Add line to print pid.
        
1998-10 Andreas Buschmann  <[EMAIL PROTECTED]>

        * contrib/ulrich-dessauer/fslib/fslib.c (fsiattr2inode): New function.
        (fsino2inode): Replace assignment by memcpy.
        (filesystem): Replace ino by iattr.
        contrib/ulrich-dessauer/fslib/fslib.h (FS_Status): change field type.
        (fscalls): Add flags parameter to ufs_open.
        contrib/ulrich-dessauer/fslib/util.c: (def_statfs): Type of fs.fsid
        changed.
        <linux/fs.h>: Add include.
        (def_notify_change): Type of ino changed, parse flags instead.
        contrib/ulrich-dessauer/misc/cdfs.c (do_statfs): type of fs.fsid
        changed.
        lib/DirInode.cc (DirInode::do_multireaddir): Change debug output.
        lib/Makefile (CPPFLAGS): Add -DDEBUG.
        lwp-0.2d/sig.c (iohan): Changed type of fdtmp.
        rules (.cc.ii): Add C++ preprocessing rule.
----------------------------------------------------------------------------
diff -ur userfs-0.9.4.2.orig/contrib/ulrich-dessauer/fslib/fslib.c 
userfs-0.9.4.2/contrib/ulrich-dessauer/fslib/fslib.c
--- userfs-0.9.4.2.orig/contrib/ulrich-dessauer/fslib/fslib.c   Sun May 25 14:56:50 
1997
+++ userfs-0.9.4.2/contrib/ulrich-dessauer/fslib/fslib.c        Fri Dec 18 11:59:57 
+1998
@@ -75,6 +75,22 @@
 }
 
 static void
+fsiattr2inode (up_iattr *src, Inode *dst)
+{
+       dst -> mode = src -> ia_mode;
+       dst -> nlink = 0;
+       dst -> uid = src -> ia_uid;
+       dst -> gid = src -> ia_gid;
+       dst -> size = src -> ia_size;
+       dst -> atime = src -> ia_atime;
+       dst -> mtime = src -> ia_mtime;
+       dst -> ctime = src -> ia_ctime;
+       dst -> rdev = 0;
+       dst -> blksize = 0;
+       dst -> blocks = 0;
+}
+
+static void
 fsino2inode (up_inode *src, Inode *dst)
 {
        dst -> mode = src -> mode;
@@ -449,7 +465,8 @@
                                                statfs_r.bavail = fsstat -> bavail;
                                                statfs_r.files = fsstat -> files;
                                                statfs_r.ffree = fsstat -> ffree;
-                                               statfs_r.fsid = fsstat -> fsid.__val;
+                                               assert (sizeof (statfs_r.fsid) == 
+sizeof (fsstat -> fsid));
+                                               memcpy (statfs_r.fsid, fsstat -> fsid, 
+sizeof (statfs_r.fsid));
                                                statfs_r.namelen = fsstat -> namelen;
                                                reply.size = encode_upp_statfs_r (& 
statfs_r, buf) - buf;
                                        } else
@@ -473,7 +490,7 @@
                                        decode_upp_open_s (& open_s, buf);
                                        cred2perm (& open_s.cred, & perm);
                                        FREE (open_s.cred.groups.elems);
-                                       open_r.ctok = (ulong) (*fc -> ufs_open) 
(open_s.file.handle, & perm);
+                                       open_r.ctok = (ulong) (*fc -> ufs_open) 
+(open_s.file.handle, & perm, open_s.flags);
                                        if (perm.gcnt)
                                                free (perm.groups);
                                        if (open_r.ctok != 0)
@@ -543,8 +560,8 @@
                                reply.errno = 0;
                                if (pre.isreq == UP_REQ) {
                                        decode_upp_notify_change_s (& notify_change_s, 
buf);
-                                       fsino2inode (& notify_change_s.ino, & inobuf);
-                                       if ((*fc -> ufs_notify_change) 
(notify_change_s.handle.handle, & inobuf, notify_change_s.flags) == Fail)
+                                       fsiattr2inode (& notify_change_s.iattr, & 
+inobuf);
+                                       if ((*fc -> ufs_notify_change) 
+(notify_change_s.handle.handle, & inobuf, notify_change_s.iattr.ia_valid) == Fail)
                                                reply.errno = Fail;
                                }
                        }
diff -ur userfs-0.9.4.2.orig/contrib/ulrich-dessauer/fslib/fslib.h 
userfs-0.9.4.2/contrib/ulrich-dessauer/fslib/fslib.h
--- userfs-0.9.4.2.orig/contrib/ulrich-dessauer/fslib/fslib.h   Thu Jun  2 09:34:53 
1994
+++ userfs-0.9.4.2/contrib/ulrich-dessauer/fslib/fslib.h        Fri Dec 18 11:59:57 
+1998
@@ -20,7 +20,8 @@
        time_t  bavail;
        time_t  files;
        time_t  ffree;
-       fsid_t  fsid;
+/*     fsid_t  fsid;   */
+       long    fsid[2];
        time_t  namelen;
 }      FS_Status;
 
@@ -107,7 +108,7 @@
        /* write an inode back */
        Status          (*ufs_iput) (ulong handle);
        /* called on every open */
-       ulong           (*ufs_open) (ulong handle, Permission *p);
+       ulong           (*ufs_open) (ulong handle, Permission *p, short flags);
        /* permission check */
        Status          (*ufs_permission) (ulong handle, long mask, Permission *p);
        /* rename a file */
diff -ur userfs-0.9.4.2.orig/contrib/ulrich-dessauer/fslib/util.c 
userfs-0.9.4.2/contrib/ulrich-dessauer/fslib/util.c
--- userfs-0.9.4.2.orig/contrib/ulrich-dessauer/fslib/util.c    Thu Jun  2 09:34:55 
1994
+++ userfs-0.9.4.2/contrib/ulrich-dessauer/fslib/util.c Mon Oct 26 12:09:10 1998
@@ -602,7 +602,8 @@
        fs.bavail = 0;
        fs.files = 0;
        fs.ffree = 0;
-       fs.fsid.val[0] = fs.fsid.val[1] = 0;
+       /* fs.fsid.val[0] = fs.fsid.val[1] = 0; */
+       fs.fsid[0] = fs.fsid[1] = 0;
        fs.namelen = namelen - 1;
        inform_user (UI_Statfs, & fs);
        return (& fs);
@@ -674,6 +675,11 @@
        return (d);
 }
 
+#include <sys/types.h>
+#define __KERNEL__      /* XXX Hack to get definitions needed */
+#include <linux/fs.h>
+#undef __KERNEL__
+
 Status
 def_notify_change (register ulong handle, register Inode *ino,
        register long flags)
@@ -682,6 +688,12 @@
 
        if (! (i = get_finode (handle)))
                return (Fail);
-       i -> ino = *ino;
+       if (flags & ATTR_MODE)  i -> ino.mode  = ino -> mode;
+       if (flags & ATTR_UID)   i -> ino.uid   = ino -> uid;
+       if (flags & ATTR_GID)   i -> ino.gid   = ino -> gid;
+       if (flags & ATTR_SIZE)  i -> ino.size  = ino -> size;
+       if (flags & ATTR_ATIME) i -> ino.atime = ino -> atime;
+       if (flags & ATTR_MTIME) i -> ino.mtime = ino -> mtime;
+       if (flags & ATTR_CTIME) i -> ino.ctime = ino -> ctime;
        return (Ok);
 }
diff -ur userfs-0.9.4.2.orig/contrib/ulrich-dessauer/misc/cdfs.c 
userfs-0.9.4.2/contrib/ulrich-dessauer/misc/cdfs.c
--- userfs-0.9.4.2.orig/contrib/ulrich-dessauer/misc/cdfs.c     Thu Jun  2 09:34:58 
1994
+++ userfs-0.9.4.2/contrib/ulrich-dessauer/misc/cdfs.c  Mon Oct 26 12:13:44 1998
@@ -214,7 +214,8 @@
        fs.bavail = 0;
        fs.files = 0;
        fs.ffree = 0;
-       fs.fsid.val[0] = fs.fsid.val[1] = 0;
+       /* fs.fsid.val[0] = fs.fsid.val[1] = 0; */
+       fs.fsid[0] = fs.fsid[1] = 0;
        fs.namelen = 128;
        return (& fs);
 }
diff -ur userfs-0.9.4.2.orig/contrib/ulrich-dessauer/misc/zip.c 
userfs-0.9.4.2/contrib/ulrich-dessauer/misc/zip.c
--- userfs-0.9.4.2.orig/contrib/ulrich-dessauer/misc/zip.c      Thu Jun  2 09:34:59 
1994
+++ userfs-0.9.4.2/contrib/ulrich-dessauer/misc/zip.c   Thu Nov 19 10:34:48 1998
@@ -325,5 +325,9 @@
                exit (0);
        }
 # endif
+
+       printf("pid=%d, return to cont\n", getpid());
+       getchar();
+
        return (userfs (argc, argv, & calls));
 }
diff -ur userfs-0.9.4.2.orig/genser/coder.h userfs-0.9.4.2/genser/coder.h
--- userfs-0.9.4.2.orig/genser/coder.h  Sun Jul 16 14:57:44 1995
+++ userfs-0.9.4.2/genser/coder.h       Mon Dec 14 10:17:20 1998
@@ -24,6 +24,79 @@
 typedef unsigned long long Ulonglong;
 typedef long long longlong;
 
+/* declarations with unused attibute to suppress warnings */
+__inline__ static unsigned char *encode_char(const char *ch, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_char(char *ch, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_char(const char *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_Uchar(const Uchar *ch, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_Uchar(Uchar *ch, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_Uchar(const Uchar *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_short(const short *sh, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_short(short *sh, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_short(const short *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_Ushort(const Ushort *sh, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_Ushort(Ushort *sh, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_Ushort(const Ushort *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_long(const long *l, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_long(long *l, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_long(const long *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_Ulong(const Ulong *l, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_Ulong(Ulong *l, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_Ulong(const Ulong *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_longlong(const long long *l,
+                                                unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_longlong(long long *l,
+                                                unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_longlong(const long long *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_Ulonglong(const unsigned long long *l,
+                                                 unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_Ulonglong(unsigned long long *l,
+                                                 unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_Ulonglong(const unsigned long long *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_void(const void *v, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_void(void *v, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_void(const void *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_float(const float *f, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_float(float *f, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_float(const float *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_double(const double *d, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_double(double *d, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_double(const double *c)
+  __attribute__ ((__unused__));
+
+
 /** char **/
 __inline__ static unsigned char *encode_char(const char *ch, unsigned char *buf)
 {
diff -ur userfs-0.9.4.2.orig/kernel/linux/userfs_types.ty 
userfs-0.9.4.2/kernel/linux/userfs_types.ty
--- userfs-0.9.4.2.orig/kernel/linux/userfs_types.ty    Mon May 19 13:53:59 1997
+++ userfs-0.9.4.2/kernel/linux/userfs_types.ty Mon Dec 14 10:26:26 1998
@@ -21,6 +21,8 @@
 %#    include <assert.h>
 %#    include <stdlib.h>
 
+%static __inline__ void *ALLOC(int alloc)   __attribute__ ((__unused__));
+%
 %static __inline__ void *ALLOC(int alloc)
 %{
 %      void *mem = malloc(alloc);
@@ -248,6 +250,7 @@
 {
        up_cred cred;
        up_handle file;
+       short flags;
 } upp_open_s;
 typedef struct
 {
diff -ur userfs-0.9.4.2.orig/kernel/src/file.c userfs-0.9.4.2/kernel/src/file.c
--- userfs-0.9.4.2.orig/kernel/src/file.c       Mon May 19 13:53:59 1997
+++ userfs-0.9.4.2/kernel/src/file.c    Mon Dec 14 10:23:34 1998
@@ -424,6 +424,7 @@
 
        userfs_setcred(&snd.cred);
        snd.file = U_INO(ino).handle;
+       snd.flags = file -> f_flags;
 
        if ((ret = userfs_doop(ino->i_sb, &pre, &repl,
                                upp_open_s, &snd, upp_open_r, &rcv)) != 0)
diff -ur userfs-0.9.4.2.orig/lib/DirInode.cc userfs-0.9.4.2/lib/DirInode.cc
--- userfs-0.9.4.2.orig/lib/DirInode.cc Tue Jul 25 20:09:42 1995
+++ userfs-0.9.4.2/lib/DirInode.cc      Mon Oct 26 13:48:32 1998
@@ -302,9 +302,9 @@
                ents[i].name.alloc(len);
                memcpy(ents[i].name.elems, (const char *)de->name, len);
                ents[i].file.handle = de->ino->gethandle();
-               DB(printf("Multireaddir:%d '%s',nlen=%d,ino=%d,off=%d\n",
+               DB(printf("Multireaddir:%d '%s',nlen=%d,ino=%d,ind=%d\n",
                          i, (const char *)de->name,
-                         len, ents[i].file.handle, off));
+                         len, ents[i].file.handle, ind));
                res.nelem = i+1;
        }
        res.nelem = i;
diff -ur userfs-0.9.4.2.orig/lib/Makefile userfs-0.9.4.2/lib/Makefile
--- userfs-0.9.4.2.orig/lib/Makefile    Tue Jul 18 19:15:35 1995
+++ userfs-0.9.4.2/lib/Makefile Mon Oct 26 12:54:00 1998
@@ -1,7 +1,7 @@
 # Makefile for library
 TOP=..
 CPP=$(CC)
-CPPFLAGS=-I. -I$(TOP)/lwp -I$(TOP)/kernel -I$(TOP)/genser #-DDEBUG 
+CPPFLAGS=-I. -I$(TOP)/lwp -I$(TOP)/kernel -I$(TOP)/genser -DDEBUG 
 CFLAGS=$(CPPFLAGS)
 CXXFLAGS=$(CFLAGS)
 LIB=libuserfs.a
diff -ur userfs-0.9.4.2.orig/lib/coder.h userfs-0.9.4.2/lib/coder.h
--- userfs-0.9.4.2.orig/lib/coder.h     Sun Jul 16 14:57:44 1995
+++ userfs-0.9.4.2/lib/coder.h  Mon Dec 14 10:17:20 1998
@@ -24,6 +24,79 @@
 typedef unsigned long long Ulonglong;
 typedef long long longlong;
 
+/* declarations with unused attibute to suppress warnings */
+__inline__ static unsigned char *encode_char(const char *ch, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_char(char *ch, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_char(const char *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_Uchar(const Uchar *ch, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_Uchar(Uchar *ch, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_Uchar(const Uchar *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_short(const short *sh, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_short(short *sh, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_short(const short *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_Ushort(const Ushort *sh, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_Ushort(Ushort *sh, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_Ushort(const Ushort *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_long(const long *l, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_long(long *l, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_long(const long *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_Ulong(const Ulong *l, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_Ulong(Ulong *l, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_Ulong(const Ulong *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_longlong(const long long *l,
+                                                unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_longlong(long long *l,
+                                                unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_longlong(const long long *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_Ulonglong(const unsigned long long *l,
+                                                 unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_Ulonglong(unsigned long long *l,
+                                                 unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_Ulonglong(const unsigned long long *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_void(const void *v, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_void(void *v, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_void(const void *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_float(const float *f, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_float(float *f, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_float(const float *c)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *encode_double(const double *d, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned char *decode_double(double *d, unsigned char *buf)
+  __attribute__ ((__unused__));
+__inline__ static unsigned int sizeof_double(const double *c)
+  __attribute__ ((__unused__));
+
+
 /** char **/
 __inline__ static unsigned char *encode_char(const char *ch, unsigned char *buf)
 {
diff -ur userfs-0.9.4.2.orig/lwp-0.2d/sig.c userfs-0.9.4.2/lwp-0.2d/sig.c
--- userfs-0.9.4.2.orig/lwp-0.2d/sig.c  Mon Aug 12 15:55:42 1996
+++ userfs-0.9.4.2/lwp-0.2d/sig.c       Mon Oct 19 15:03:47 1998
@@ -39,7 +39,7 @@
  */
 static void iohan ()
 {
-       struct fd_set fdtmp;
+       fd_set fdtmp;
        struct timeval t;
        struct siginf *p;
        int pri;
diff -ur userfs-0.9.4.2.orig/rules userfs-0.9.4.2/rules
--- userfs-0.9.4.2.orig/rules   Mon May 19 13:55:44 1997
+++ userfs-0.9.4.2/rules        Fri Oct 23 11:39:32 1998
@@ -24,6 +24,11 @@
 XCFLAGS=$(PROF) $(DEBUG) $(WARN)
 XCXXFLAGS=$(PROF) $(DEBUG) $(WARN) #-fno-for-scope
 
+.SUFFIXES: .ii
+
+.cc.ii:
+       $(CXX) -E $(CXXFLAGS) $(XCXXFLAGS) $< >$@
+
 .cc.o:
        $(CXX) -c $(CXXFLAGS) $(XCXXFLAGS) $<
 
----------------------------------------------------------------------------

                                Tschuess
                                        Andreas

-- 
 /|)    Andreas Buschmann                       <[EMAIL PROTECTED]>
/-|)    Digitale Video Systeme                  +49 511 678 07-13
        DVS GmbH

Reply via email to