PERFORCE change 37753 for review
Marcel Moolenaar
marcel at FreeBSD.org
Sun Sep 7 17:03:36 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=37753
Change 37753 by marcel at marcel_nfs on 2003/09/07 17:02:50
IFC @37752
Affected files ...
.. //depot/projects/uart/alpha/alpha/pmap.c#10 integrate
.. //depot/projects/uart/coda/cnode.h#2 integrate
.. //depot/projects/uart/coda/coda.h#2 integrate
.. //depot/projects/uart/coda/coda_namecache.c#2 integrate
.. //depot/projects/uart/coda/coda_namecache.h#2 integrate
.. //depot/projects/uart/coda/coda_subr.c#2 integrate
.. //depot/projects/uart/coda/coda_subr.h#2 integrate
.. //depot/projects/uart/coda/coda_venus.c#2 integrate
.. //depot/projects/uart/coda/coda_venus.h#2 integrate
.. //depot/projects/uart/coda/coda_vfsops.c#2 integrate
.. //depot/projects/uart/coda/coda_vfsops.h#2 integrate
.. //depot/projects/uart/coda/coda_vnops.c#3 integrate
.. //depot/projects/uart/compat/linux/linux_misc.c#5 integrate
.. //depot/projects/uart/conf/NOTES#12 integrate
.. //depot/projects/uart/conf/options#11 integrate
.. //depot/projects/uart/dev/sound/isa/ad1816.c#3 integrate
.. //depot/projects/uart/dev/sound/isa/ess.c#3 integrate
.. //depot/projects/uart/dev/sound/isa/mss.c#3 integrate
.. //depot/projects/uart/dev/sound/isa/sb16.c#3 integrate
.. //depot/projects/uart/dev/sound/isa/sb8.c#3 integrate
.. //depot/projects/uart/dev/sound/isa/sndbuf_dma.c#2 integrate
.. //depot/projects/uart/dev/sound/pci/aureal.c#5 integrate
.. //depot/projects/uart/dev/sound/pci/aureal.h#2 integrate
.. //depot/projects/uart/dev/sound/pci/emu10k1.c#5 integrate
.. //depot/projects/uart/dev/sound/pci/es137x.c#6 integrate
.. //depot/projects/uart/dev/sound/pci/maestro.c#5 integrate
.. //depot/projects/uart/dev/sound/pci/neomagic-coeff.h#2 integrate
.. //depot/projects/uart/dev/sound/pci/neomagic.c#4 integrate
.. //depot/projects/uart/dev/sound/pci/neomagic.h#2 integrate
.. //depot/projects/uart/dev/sound/pci/solo.c#5 integrate
.. //depot/projects/uart/dev/sound/pci/t4dwave.c#5 integrate
.. //depot/projects/uart/dev/sound/pci/t4dwave.h#2 integrate
.. //depot/projects/uart/dev/sound/pcm/ac97.c#5 integrate
.. //depot/projects/uart/dev/sound/pcm/ac97.h#3 integrate
.. //depot/projects/uart/dev/sound/pcm/buffer.c#2 integrate
.. //depot/projects/uart/dev/sound/pcm/buffer.h#2 integrate
.. //depot/projects/uart/dev/sound/pcm/channel.c#3 integrate
.. //depot/projects/uart/dev/sound/pcm/channel.h#2 integrate
.. //depot/projects/uart/dev/sound/pcm/dsp.c#3 integrate
.. //depot/projects/uart/dev/sound/pcm/dsp.h#2 integrate
.. //depot/projects/uart/dev/sound/pcm/fake.c#2 integrate
.. //depot/projects/uart/dev/sound/pcm/feeder.c#4 integrate
.. //depot/projects/uart/dev/sound/pcm/feeder.h#4 integrate
.. //depot/projects/uart/dev/sound/pcm/feeder_fmt.c#3 integrate
.. //depot/projects/uart/dev/sound/pcm/mixer.c#2 integrate
.. //depot/projects/uart/dev/sound/pcm/mixer.h#2 integrate
.. //depot/projects/uart/dev/sound/pcm/sndstat.c#2 integrate
.. //depot/projects/uart/dev/sound/pcm/sound.c#3 integrate
.. //depot/projects/uart/dev/sound/pcm/sound.h#3 integrate
.. //depot/projects/uart/dev/sound/pcm/vchan.c#2 integrate
.. //depot/projects/uart/dev/sound/pcm/vchan.h#2 integrate
.. //depot/projects/uart/dev/uart/uart_cpu.h#10 integrate
.. //depot/projects/uart/dev/uart/uart_cpu_alpha.c#5 integrate
.. //depot/projects/uart/dev/uart/uart_cpu_amd64.c#3 integrate
.. //depot/projects/uart/dev/uart/uart_cpu_i386.c#4 integrate
.. //depot/projects/uart/dev/uart/uart_cpu_ia64.c#4 integrate
.. //depot/projects/uart/dev/uart/uart_cpu_pc98.c#2 integrate
.. //depot/projects/uart/dev/uart/uart_cpu_sparc64.c#12 integrate
.. //depot/projects/uart/dev/uart/uart_dev_sab82532.c#27 integrate
.. //depot/projects/uart/dev/uart/uart_dev_z8530.c#13 integrate
.. //depot/projects/uart/i386/i386/db_interface.c#3 integrate
.. //depot/projects/uart/i386/i386/machdep.c#4 integrate
.. //depot/projects/uart/i386/isa/clock.c#5 integrate
.. //depot/projects/uart/i386/linux/imgact_linux.c#2 integrate
.. //depot/projects/uart/ia64/acpica/madt.c#3 integrate
.. //depot/projects/uart/ia64/conf/GENERIC#3 integrate
.. //depot/projects/uart/ia64/conf/GENERIC.hints#3 integrate
.. //depot/projects/uart/ia64/ia64/pmap.c#8 integrate
.. //depot/projects/uart/kern/kern_umtx.c#5 integrate
.. //depot/projects/uart/modules/Makefile#8 integrate
.. //depot/projects/uart/modules/coda/Makefile#2 integrate
.. //depot/projects/uart/modules/coda5/Makefile#1 branch
.. //depot/projects/uart/modules/uart/Makefile#7 integrate
.. //depot/projects/uart/vm/vm_mmap.c#4 integrate
Differences ...
==== //depot/projects/uart/alpha/alpha/pmap.c#10 (text+ko) ====
@@ -148,7 +148,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/pmap.c,v 1.135 2003/08/28 23:12:28 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/pmap.c,v 1.136 2003/09/07 20:02:38 alc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -2749,23 +2749,30 @@
*/
if ((*pte & PG_FOW) == 0)
val |= MINCORE_MODIFIED|MINCORE_MODIFIED_OTHER;
- /*
- * Modified by someone
- */
- else if (m->dirty || pmap_is_modified(m))
- val |= MINCORE_MODIFIED_OTHER;
+ else {
+ /*
+ * Modified by someone
+ */
+ vm_page_lock_queues();
+ if (m->dirty || pmap_is_modified(m))
+ val |= MINCORE_MODIFIED_OTHER;
+ vm_page_unlock_queues();
+ }
/*
* Referenced by us
*/
if ((*pte & (PG_FOR | PG_FOE)) == 0)
val |= MINCORE_REFERENCED|MINCORE_REFERENCED_OTHER;
-
- /*
- * Referenced by someone
- */
- else if ((m->flags & PG_REFERENCED) || pmap_ts_referenced(m)) {
- val |= MINCORE_REFERENCED_OTHER;
- vm_page_flag_set(m, PG_REFERENCED);
+ else {
+ /*
+ * Referenced by someone
+ */
+ vm_page_lock_queues();
+ if ((m->flags & PG_REFERENCED) || pmap_ts_referenced(m)) {
+ val |= MINCORE_REFERENCED_OTHER;
+ vm_page_flag_set(m, PG_REFERENCED);
+ }
+ vm_page_unlock_queues();
}
}
return val;
==== //depot/projects/uart/coda/cnode.h#2 (text+ko) ====
@@ -27,7 +27,7 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/coda/cnode.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $FreeBSD: src/sys/coda/cnode.h,v 1.12 2003/03/06 10:48:03 tjr Exp $
+ * $FreeBSD: src/sys/coda/cnode.h,v 1.13 2003/09/07 07:43:09 tjr Exp $
*
*/
@@ -101,7 +101,7 @@
struct cnode {
struct vnode *c_vnode;
u_short c_flags; /* flags (see below) */
- ViceFid c_fid; /* file handle */
+ CodaFid c_fid; /* file handle */
struct lock c_lock; /* new lock protocol */
struct vnode *c_ovp; /* open vnode pointer */
u_short c_ocount; /* count of openers */
@@ -197,7 +197,7 @@
extern int coda_vmflush(struct cnode *cp);
/* cfs_vnodeops.h */
-extern struct cnode *make_coda_node(ViceFid *fid, struct mount *vfsp, short type);
+extern struct cnode *make_coda_node(CodaFid *fid, struct mount *vfsp, short type);
extern int coda_vnodeopstats_init(void);
/* coda_vfsops.h */
==== //depot/projects/uart/coda/coda.h#2 (text+ko) ====
@@ -27,7 +27,7 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/coda/coda.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $FreeBSD: src/sys/coda/coda.h,v 1.9 1999/12/29 04:54:30 peter Exp $
+ * $FreeBSD: src/sys/coda/coda.h,v 1.10 2003/09/07 07:43:09 tjr Exp $
*
*/
@@ -41,8 +41,8 @@
#ifndef _CODA_HEADER_
#define _CODA_HEADER_
+#include "opt_coda.h" /* for COMPAT_CODA_5 option */
-
/* Catch new _KERNEL defn for NetBSD */
#ifdef __NetBSD__
#include <sys/types.h>
@@ -162,59 +162,70 @@
#endif
-#ifndef _FID_T_
-#define _FID_T_ 1
-typedef u_long VolumeId;
-typedef u_long VnodeId;
-typedef u_long Unique_t;
-typedef u_long FileVersion;
-#endif
+#ifdef CODA_COMPAT_5
-#ifndef _VICEFID_T_
-#define _VICEFID_T_ 1
-typedef struct ViceFid {
- VolumeId Volume;
- VnodeId Vnode;
- Unique_t Unique;
-} ViceFid;
-#endif /* VICEFID */
+typedef struct {
+ u_long Volume;
+ u_long Vnode;
+ u_long Unique;
+} CodaFid;
+static __inline__ ino_t coda_f2i(CodaFid *fid)
+{
+ if (!fid) return 0;
+ return (fid->Unique + (fid->Vnode<<10) + (fid->Volume<<20));
+}
-#ifdef __linux__
-static __inline__ ino_t coda_f2i(struct ViceFid *fid)
+static __inline__ char * coda_f2s(CodaFid *fid)
+{
+ static char fid_str [35];
+ snprintf (fid_str, 35, "[%lx.%lx.%lx]", fid->Volume,
+ fid->Vnode, fid->Unique);
+ return fid_str;
+}
+
+static __inline__ int coda_fid_eq (CodaFid *fid1, CodaFid *fid2)
{
- if ( ! fid )
- return 0;
- if (fid->Vnode == 0xfffffffe || fid->Vnode == 0xffffffff)
- return ((fid->Volume << 20) | (fid->Unique & 0xfffff));
- else
- return (fid->Unique + (fid->Vnode<<10) + (fid->Volume<<20));
+ return (fid1->Volume == fid2->Volume &&
+ fid1->Vnode == fid2->Vnode &&
+ fid1->Unique == fid2->Unique);
}
-
-#else
-#define coda_f2i(fid)\
- ((fid) ? ((fid)->Unique + ((fid)->Vnode<<10) + ((fid)->Volume<<20)) : 0)
-#endif
+
+struct coda_cred {
+ u_int32_t cr_uid, cr_euid, cr_suid, cr_fsuid; /* Real, efftve, set, fs uid*/
+ u_int32_t cr_groupid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */
+};
+#else /* CODA_COMPAT_5 */
-#ifndef __BIT_TYPES_DEFINED__
-#define u_int32_t unsigned int
-#endif
+typedef struct {
+ u_int32_t opaque[4];
+} CodaFid;
+static __inline__ ino_t coda_f2i(CodaFid *fid)
+{
+ if ( ! fid )
+ return 0;
+ return (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ fid->opaque[0]);
+}
+
+static __inline__ char * coda_f2s(CodaFid *fid)
+ {
+ static char fid_str [35];
+ snprintf (fid_str, 35, "[%x.%x.%x.%x]", fid->opaque[0],
+ fid->opaque[1], fid->opaque[2], fid->opaque[3]);
+ return fid_str;
+ }
-#ifndef _VUID_T_
-#define _VUID_T_
-typedef u_int32_t vuid_t;
-typedef u_int32_t vgid_t;
-#endif /*_VUID_T_ */
+static __inline__ int coda_fid_eq (CodaFid *fid1, CodaFid *fid2)
+{
+ return (fid1->opaque[0] == fid2->opaque[0] &&
+ fid1->opaque[1] == fid2->opaque[1] &&
+ fid1->opaque[2] == fid2->opaque[2] &&
+ fid1->opaque[3] == fid2->opaque[3]);
+}
-#ifndef _CODACRED_T_
-#define _CODACRED_T_
-struct coda_cred {
- vuid_t cr_uid, cr_euid, cr_suid, cr_fsuid; /* Real, efftve, set, fs uid*/
- vgid_t cr_groupid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */
-};
-#endif
+#endif /* CODA_COMPAT_5 */
#ifndef _VENUS_VATTR_T_
#define _VENUS_VATTR_T_
@@ -227,8 +238,8 @@
int va_type; /* vnode type (for create) */
u_short va_mode; /* files access mode and type */
short va_nlink; /* number of references to file */
- vuid_t va_uid; /* owner user id */
- vgid_t va_gid; /* owner group id */
+ uid_t va_uid; /* owner user id */
+ gid_t va_gid; /* owner group id */
long va_fileid; /* file id */
u_quad_t va_size; /* file size in bytes */
long va_blocksize; /* blocksize preferred for i/o */
@@ -244,12 +255,21 @@
#endif
+/* structure used by CODA_STATFS for getting cache information from venus */
+struct coda_statfs {
+ int32_t f_blocks;
+ int32_t f_bfree;
+ int32_t f_bavail;
+ int32_t f_files;
+ int32_t f_ffree;
+};
+
/*
* Kernel <--> Venus communications.
*/
#define CODA_ROOT 2
-#define CODA_SYNC 3
+#define CODA_OPEN_BY_FD 3
#define CODA_OPEN 4
#define CODA_CLOSE 5
#define CODA_IOCTL 6
@@ -279,7 +299,8 @@
#define CODA_OPEN_BY_PATH 31
#define CODA_RESOLVE 32
#define CODA_REINTEGRATE 33
-#define CODA_NCALLS 34
+#define CODA_STATFS 34
+#define CODA_NCALLS 35
#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
@@ -293,21 +314,36 @@
#define CODA_KERNEL_VERSION 0
/* The old venus 4.6 compatible interface */
#define CODA_KERNEL_VERSION 1
-#endif
+#endif /* realms/cells */
+#ifdef CODA_COMPAT_5
/* venus_lookup gets an extra parameter to aid windows.*/
#define CODA_KERNEL_VERSION 2
+#else
+ /* 128-bit fids for realms */
+#define CODA_KERNEL_VERSION 3
+#endif
/*
* Venus <-> Coda RPC arguments
*/
+#ifdef CODA_COMPAT_5
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 */
+ 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 */
+ struct coda_cred cred; /* Common to all */
+};
+#else
+struct coda_in_hdr {
+ u_int32_t opcode;
+ u_int32_t unique; /* Keep multiple outstanding msgs distinct */
+ pid_t pid; /* Common to all */
+ pid_t pgid; /* Common to all */
+ uid_t uid; /* Common to all */
};
+#endif
/* Really important that opcode and unique are 1st two fields! */
struct coda_out_hdr {
@@ -319,7 +355,7 @@
/* coda_root: NO_IN */
struct coda_root_out {
struct coda_out_hdr oh;
- ViceFid VFid;
+ CodaFid Fid;
};
struct coda_root_in {
@@ -332,7 +368,7 @@
/* coda_open: */
struct coda_open_in {
struct coda_in_hdr ih;
- ViceFid VFid;
+ CodaFid Fid;
int flags;
};
@@ -346,7 +382,7 @@
/* coda_close: */
struct coda_close_in {
struct coda_in_hdr ih;
- ViceFid VFid;
+ CodaFid Fid;
int flags;
};
@@ -357,7 +393,7 @@
/* coda_ioctl: */
struct coda_ioctl_in {
struct coda_in_hdr ih;
- ViceFid VFid;
+ CodaFid Fid;
int cmd;
int len;
int rwflag;
@@ -374,7 +410,7 @@
/* coda_getattr: */
struct coda_getattr_in {
struct coda_in_hdr ih;
- ViceFid VFid;
+ CodaFid Fid;
};
struct coda_getattr_out {
@@ -386,7 +422,7 @@
/* coda_setattr: NO_OUT */
struct coda_setattr_in {
struct coda_in_hdr ih;
- ViceFid VFid;
+ CodaFid Fid;
struct coda_vattr attr;
};
@@ -397,7 +433,7 @@
/* coda_access: NO_OUT */
struct coda_access_in {
struct coda_in_hdr ih;
- ViceFid VFid;
+ CodaFid Fid;
int flags;
};
@@ -413,14 +449,14 @@
/* coda_lookup: */
struct coda_lookup_in {
struct coda_in_hdr ih;
- ViceFid VFid;
+ CodaFid Fid;
int name; /* Place holder for data. */
int flags;
};
struct coda_lookup_out {
struct coda_out_hdr oh;
- ViceFid VFid;
+ CodaFid Fid;
int vtype;
};
@@ -428,7 +464,7 @@
/* coda_create: */
struct coda_create_in {
struct coda_in_hdr ih;
- ViceFid VFid;
+ CodaFid Fid;
struct coda_vattr attr;
int excl;
int mode;
@@ -437,7 +473,7 @@
struct coda_create_out {
struct coda_out_hdr oh;
- ViceFid VFid;
+ CodaFid Fid;
struct coda_vattr attr;
};
@@ -445,7 +481,7 @@
/* coda_remove: NO_OUT */
struct coda_remove_in {
struct coda_in_hdr ih;
- ViceFid VFid;
+ CodaFid Fid;
int name; /* Place holder for data. */
};
@@ -456,8 +492,8 @@
/* coda_link: NO_OUT */
struct coda_link_in {
struct coda_in_hdr ih;
- ViceFid sourceFid; /* cnode to link *to* */
- ViceFid destFid; /* Directory in which to place link */
+ CodaFid sourceFid; /* cnode to link *to* */
+ CodaFid destFid; /* Directory in which to place link */
int tname; /* Place holder for data. */
};
@@ -469,9 +505,9 @@
/* coda_rename: NO_OUT */
struct coda_rename_in {
struct coda_in_hdr ih;
- ViceFid sourceFid;
+ CodaFid sourceFid;
int srcname;
- ViceFid destFid;
+ CodaFid destFid;
int destname;
};
@@ -482,14 +518,14 @@
/* coda_mkdir: */
struct coda_mkdir_in {
struct coda_in_hdr ih;
- ViceFid VFid;
+ CodaFid Fid;
struct coda_vattr attr;
int name; /* Place holder for data. */
};
struct coda_mkdir_out {
struct coda_out_hdr oh;
- ViceFid VFid;
+ CodaFid Fid;
struct coda_vattr attr;
};
@@ -497,7 +533,7 @@
/* coda_rmdir: NO_OUT */
struct coda_rmdir_in {
struct coda_in_hdr ih;
- ViceFid VFid;
+ CodaFid Fid;
int name; /* Place holder for data. */
};
@@ -508,7 +544,7 @@
/* coda_readdir: */
struct coda_readdir_in {
struct coda_in_hdr ih;
- ViceFid VFid;
+ CodaFid Fid;
int count;
int offset;
};
@@ -522,7 +558,7 @@
/* coda_symlink: NO_OUT */
struct coda_symlink_in {
struct coda_in_hdr ih;
- ViceFid VFid; /* Directory to put symlink in */
+ CodaFid Fid; /* Directory to put symlink in */
int srcname;
struct coda_vattr attr;
int tname;
@@ -535,7 +571,7 @@
/* coda_readlink: */
struct coda_readlink_in {
struct coda_in_hdr ih;
- ViceFid VFid;
+ CodaFid Fid;
};
struct coda_readlink_out {
@@ -548,7 +584,7 @@
/* coda_fsync: NO_OUT */
struct coda_fsync_in {
struct coda_in_hdr ih;
- ViceFid VFid;
+ CodaFid Fid;
};
struct coda_fsync_out {
@@ -558,18 +594,18 @@
/* coda_inactive: NO_OUT */
struct coda_inactive_in {
struct coda_in_hdr ih;
- ViceFid VFid;
+ CodaFid Fid;
};
/* coda_vget: */
struct coda_vget_in {
struct coda_in_hdr ih;
- ViceFid VFid;
+ CodaFid Fid;
};
struct coda_vget_out {
struct coda_out_hdr oh;
- ViceFid VFid;
+ CodaFid Fid;
int vtype;
};
@@ -582,75 +618,85 @@
/* CODA_PURGEUSER is a venus->kernel call */
struct coda_purgeuser_out {
struct coda_out_hdr oh;
+#ifdef CODA_COMPAT_5
struct coda_cred cred;
+#else
+ uid_t uid;
+#endif
};
/* coda_zapfile: */
/* CODA_ZAPFILE is a venus->kernel call */
struct coda_zapfile_out {
struct coda_out_hdr oh;
- ViceFid CodaFid;
+ CodaFid Fid;
};
/* coda_zapdir: */
/* CODA_ZAPDIR is a venus->kernel call */
struct coda_zapdir_out {
struct coda_out_hdr oh;
- ViceFid CodaFid;
+ CodaFid Fid;
};
/* coda_zapnode: */
/* CODA_ZAPVNODE is a venus->kernel call */
struct coda_zapvnode_out {
struct coda_out_hdr oh;
+#ifdef CODA_COMPAT_5
struct coda_cred cred;
- ViceFid VFid;
+#endif
+ CodaFid Fid;
};
/* coda_purgefid: */
/* CODA_PURGEFID is a venus->kernel call */
struct coda_purgefid_out {
struct coda_out_hdr oh;
- ViceFid CodaFid;
+ CodaFid Fid;
};
-/* coda_rdwr: */
-struct coda_rdwr_in {
- struct coda_in_hdr ih;
- ViceFid VFid;
- int rwflag;
- int count;
- int offset;
- int ioflag;
- caddr_t data; /* Place holder for data. */
+/* coda_replace: */
+/* CODA_REPLACE is a venus->kernel call */
+struct coda_replace_out { /* coda_replace is a venus->kernel call */
+ struct coda_out_hdr oh;
+ CodaFid NewFid;
+ CodaFid OldFid;
};
-struct coda_rdwr_out {
- struct coda_out_hdr oh;
- int rwflag;
- int count;
- caddr_t data; /* Place holder for data. */
+/* coda_open_by_fd: */
+struct coda_open_by_fd_in {
+ struct coda_in_hdr ih;
+ CodaFid Fid;
+ int flags;
};
-
-/* coda_replace: */
-/* CODA_REPLACE is a venus->kernel call */
-struct coda_replace_out { /* coda_replace is a venus->kernel call */
+struct coda_open_by_fd_out {
struct coda_out_hdr oh;
- ViceFid NewFid;
- ViceFid OldFid;
+ int fd;
+ struct file *fh;
};
/* coda_open_by_path: */
struct coda_open_by_path_in {
struct coda_in_hdr ih;
- ViceFid VFid;
+ CodaFid Fid;
int flags;
};
struct coda_open_by_path_out {
struct coda_out_hdr oh;
- int path;
+ int path;
+};
+
+/* coda_statfs: NO_IN */
+struct coda_statfs_in {
+ struct coda_in_hdr ih;
+};
+
+struct coda_statfs_out {
+ struct coda_out_hdr oh;
+ struct coda_statfs stat;
};
/*
@@ -679,10 +725,10 @@
struct coda_symlink_in coda_symlink;
struct coda_readlink_in coda_readlink;
struct coda_fsync_in coda_fsync;
- struct coda_inactive_in coda_inactive;
struct coda_vget_in coda_vget;
- struct coda_rdwr_in coda_rdwr;
- struct coda_open_by_path_in coda_open_by_path;
+ struct coda_open_by_fd_in coda_open_by_fd;
+ struct coda_open_by_path_in coda_open_by_path;
+ struct coda_statfs_in coda_statfs;
};
union outputArgs {
@@ -702,9 +748,10 @@
struct coda_zapdir_out coda_zapdir;
struct coda_zapvnode_out coda_zapvnode;
struct coda_purgefid_out coda_purgefid;
- struct coda_rdwr_out coda_rdwr;
struct coda_replace_out coda_replace;
- struct coda_open_by_path_out coda_open_by_path;
+ struct coda_open_by_fd_out coda_open_by_fd;
+ struct coda_open_by_path_out coda_open_by_path;
+ struct coda_statfs_out coda_statfs;
};
union coda_downcalls {
@@ -747,15 +794,32 @@
#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"
+#ifdef CODA_COMPAT_5
+#define CTL_FID { -1, -1, -1 }
+#define IS_CTL_FID(fidp) ((fidp)->Volume == -1 &&\
+ (fidp)->Vnode == -1 &&\
+ (fidp)->Unique == -1)
+#define INVAL_FID { 0, 0, 0 }
+#else
+#define CTL_FID { { -1, -1, -1, -1 } }
+#define IS_CTL_FID(fidp) ((fidp)->opaque[0] == -1 &&\
+ (fidp)->opaque[1] == -1 &&\
+ (fidp)->opaque[2] == -1 &&\
+ (fidp)->opaque[3] == -1)
+#define INVAL_FID { { 0, 0, 0, 0 } }
+#endif
+
+/* Data passed to mount */
+
+#define CODA_MOUNT_VERSION 1
-#define IS_CTL_FID(fidp) ((fidp)->Volume == CTL_VOL &&\
- (fidp)->Vnode == CTL_VNO &&\
- (fidp)->Unique == CTL_UNI)
+struct coda_mount_data {
+ int version;
+ int fd; /* Opened device */
+};
+
#endif
==== //depot/projects/uart/coda/coda_namecache.c#2 (text+ko) ====
@@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/coda/coda_namecache.c,v 1.19 2003/06/10 21:21:59 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/coda/coda_namecache.c,v 1.20 2003/09/07 07:43:09 tjr Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -354,10 +354,8 @@
* place it at the head of the lru list.
*/
CODA_NC_DEBUG(CODA_NC_REMOVE,
- myprintf(("coda_nc_remove %s from parent %lx.%lx.%lx\n",
- cncp->name, (cncp->dcp)->c_fid.Volume,
- (cncp->dcp)->c_fid.Vnode, (cncp->dcp)->c_fid.Unique));)
-
+ myprintf(("coda_nc_remove %s from parent %s\n",
+ cncp->name, coda_f2s(&cncp->dcp->c_fid))); )
CODA_NC_HSHREM(cncp);
CODA_NC_HSHNUL(cncp); /* have it be a null chain */
@@ -385,7 +383,7 @@
*/
void
coda_nc_zapParentfid(fid, dcstat)
- ViceFid *fid;
+ CodaFid *fid;
enum dc_status dcstat;
{
/* To get to a specific fid, we might either have another hashing
@@ -397,11 +395,10 @@
int i;
if (coda_nc_use == 0) /* Cache is off */
- return;
+ return;
CODA_NC_DEBUG(CODA_NC_ZAPPFID,
- myprintf(("ZapParent: fid 0x%lx, 0x%lx, 0x%lx \n",
- fid->Volume, fid->Vnode, fid->Unique)); )
+ myprintf(("ZapParent: fid %s\n", coda_f2s(fid))); )
coda_nc_stat.zapPfids++;
@@ -416,9 +413,7 @@
cncp != (struct coda_cache *)&coda_nc_hash[i];
cncp = ncncp) {
ncncp = cncp->hash_next;
- if ((cncp->dcp->c_fid.Volume == fid->Volume) &&
- (cncp->dcp->c_fid.Vnode == fid->Vnode) &&
- (cncp->dcp->c_fid.Unique == fid->Unique)) {
+ if (coda_fid_eq(&(cncp->dcp->c_fid), fid)) {
coda_nc_hash[i].length--; /* Used for tuning */
coda_nc_remove(cncp, dcstat);
}
@@ -432,7 +427,7 @@
*/
void
coda_nc_zapfid(fid, dcstat)
- ViceFid *fid;
+ CodaFid *fid;
enum dc_status dcstat;
{
/* See comment for zapParentfid. This routine will be used
@@ -445,8 +440,7 @@
return;
CODA_NC_DEBUG(CODA_NC_ZAPFID,
- myprintf(("Zapfid: fid 0x%lx, 0x%lx, 0x%lx \n",
- fid->Volume, fid->Vnode, fid->Unique)); )
+ myprintf(("Zapfid: fid %s\n", coda_f2s(fid))); )
coda_nc_stat.zapFids++;
@@ -455,11 +449,9 @@
cncp != (struct coda_cache *)&coda_nc_hash[i];
cncp = ncncp) {
ncncp = cncp->hash_next;
- if ((cncp->cp->c_fid.Volume == fid->Volume) &&
- (cncp->cp->c_fid.Vnode == fid->Vnode) &&
- (cncp->cp->c_fid.Unique == fid->Unique)) {
- coda_nc_hash[i].length--; /* Used for tuning */
- coda_nc_remove(cncp, dcstat);
+ if (coda_fid_eq(&cncp->cp->c_fid, fid)) {
+ coda_nc_hash[i].length--; /* Used for tuning */
+ coda_nc_remove(cncp, dcstat);
}
}
}
@@ -470,7 +462,7 @@
*/
void
coda_nc_zapvnode(fid, cred, dcstat)
- ViceFid *fid;
+ CodaFid *fid;
struct ucred *cred;
enum dc_status dcstat;
{
@@ -478,12 +470,15 @@
want to zap a file with a specific cred from the kernel.
We'll leave this one unimplemented.
*/
+
if (coda_nc_use == 0) /* Cache is off */
return;
- CODA_NC_DEBUG(CODA_NC_ZAPVNODE,
- myprintf(("Zapvnode: fid 0x%lx, 0x%lx, 0x%lx cred %p\n",
- fid->Volume, fid->Vnode, fid->Unique, cred)); )
+ CODA_NC_DEBUG(CODA_NC_ZAPVNODE,
+ myprintf(("Zapvnode: fid %s cred %p\n",
+ coda_f2s(fid), cred)); )
+
+
}
@@ -533,7 +528,7 @@
*/
void
coda_nc_purge_user(uid, dcstat)
- vuid_t uid;
+ uid_t uid;
enum dc_status dcstat;
{
/*
@@ -616,7 +611,8 @@
if (CTOV(cncp->cp)->v_vflag & VV_TEXT) {
if (coda_vmflush(cncp->cp))
CODADEBUG(CODA_FLUSH,
- myprintf(("coda_nc_flush: (%lx.%lx.%lx) busy\n", cncp->cp->c_fid.Volume, cncp->cp->c_fid.Vnode, cncp->cp->c_fid.Unique)); )
+ myprintf(("coda_nc_flush: %s busy\n",
+ coda_f2s(&cncp->cp->c_fid))); )
}
if ((dcstat == IS_DOWNCALL)
==== //depot/projects/uart/coda/coda_namecache.h#2 (text+ko) ====
@@ -27,7 +27,7 @@
* Mellon the rights to redistribute these changes without encumbrance.
*
* @(#) src/sys/coda/coda_namecache.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
- * $FreeBSD: src/sys/coda/coda_namecache.h,v 1.8 2002/09/22 13:25:57 iedowse Exp $
+ * $FreeBSD: src/sys/coda/coda_namecache.h,v 1.9 2003/09/07 07:43:09 tjr Exp $
*
*/
@@ -140,11 +140,11 @@
extern void coda_nc_enter(struct cnode *, const char *, int, struct ucred *, struct cnode *);
extern struct cnode *coda_nc_lookup(struct cnode *, const char *, int, struct ucred *);
-extern void coda_nc_zapParentfid(ViceFid *, enum dc_status);
-extern void coda_nc_zapfid(ViceFid *, enum dc_status);
-extern void coda_nc_zapvnode(ViceFid *, struct ucred *, enum dc_status);
+extern void coda_nc_zapParentfid(CodaFid *, enum dc_status);
+extern void coda_nc_zapfid(CodaFid *, enum dc_status);
+extern void coda_nc_zapvnode(CodaFid *, struct ucred *, enum dc_status);
extern void coda_nc_zapfile(struct cnode *, const char *, int);
-extern void coda_nc_purge_user(vuid_t, enum dc_status);
+extern void coda_nc_purge_user(uid_t, enum dc_status);
extern void coda_nc_flush(enum dc_status);
extern void print_coda_nc(void);
==== //depot/projects/uart/coda/coda_subr.c#2 (text+ko) ====
@@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/coda/coda_subr.c,v 1.23 2003/06/10 21:21:59 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/coda/coda_subr.c,v 1.24 2003/09/07 07:43:09 tjr Exp $");
#include <vcoda.h>
@@ -74,9 +74,16 @@
struct cnode *coda_freelist = NULL;
struct cnode *coda_cache[CODA_CACHESIZE];
-#define coda_hash(fid) (((fid)->Volume + (fid)->Vnode) & (CODA_CACHESIZE-1))
#define CNODE_NEXT(cp) ((cp)->c_next)
-#define ODD(vnode) ((vnode) & 0x1)
+
+#ifdef CODA_COMPAT_5
+#define coda_hash(fid) \
+ (((fid)->Volume + (fid)->Vnode) & (CODA_CACHESIZE-1))
+#define IS_DIR(cnode) (cnode.Vnode & 0x1)
+#else
+#define coda_hash(fid) (coda_f2i(fid) & (CODA_CACHESIZE-1))
+#define IS_DIR(cnode) (cnode.opaque[2] & 0x1)
+#endif
/*
* Allocate a cnode.
@@ -161,15 +168,13 @@
*/
struct cnode *
coda_find(fid)
- ViceFid *fid;
+ CodaFid *fid;
{
struct cnode *cp;
cp = coda_cache[coda_hash(fid)];
while (cp) {
- if ((cp->c_fid.Vnode == fid->Vnode) &&
- (cp->c_fid.Volume == fid->Volume) &&
- (cp->c_fid.Unique == fid->Unique) &&
+ if (coda_fid_eq(&(cp->c_fid), fid) &&
(!IS_UNMOUNTING(cp)))
{
coda_active++;
@@ -218,12 +223,10 @@
#endif
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list