mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-04 09:09:56 +00:00
Pass2 complete
This commit is contained in:
parent
0d59b5e22c
commit
41159be768
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=38759
@ -1,8 +1,3 @@
|
||||
NOTE: Please do not edit any files in this directory
|
||||
until this NOTE is removed.
|
||||
In the next week, I want to clear out all the
|
||||
platform and release #ifdefs from the code.
|
||||
|
||||
NOTE: The matching user level code has not been released
|
||||
yet. It will be available soon. The existing released
|
||||
Coda code is not quite ready for current. We'll
|
||||
@ -14,8 +9,8 @@ BUG: There is a bug in file mapping/executing. When a file is
|
||||
you can run the file just fine. I haven't had time to look
|
||||
for this problem yet.
|
||||
|
||||
|
||||
WARNING:A version of this code has run on stable for a while now.
|
||||
WARNING:
|
||||
A version of this code has run on stable for a while now.
|
||||
The code has been recently ported to current. It is mostly
|
||||
working, but hasn't been run long enough to be sure all the
|
||||
bugs are sorted out. Let me know if there are any problems.
|
||||
|
@ -15,8 +15,8 @@ to experiment with.
|
||||
|
||||
To get more information on Coda, I would like to refer people to
|
||||
http://www.coda.cs.cmu.edu
|
||||
There is a wealth of documents, papers, theses there. There is also a
|
||||
good introduction to the Coda File System in
|
||||
There is a wealth of documents, papers, and theses there. There is
|
||||
also a good introduction to the Coda File System in
|
||||
http://www.coda.cs.cmu.edu/ljpaper/lj.html
|
||||
|
||||
Coda was originally developed as an academic prototype/testbed. It is
|
||||
@ -45,11 +45,11 @@ The relevant sources, binaries, and docs can be found in
|
||||
ftp://ftp.coda.cs.cmu.edu/pub/coda/
|
||||
|
||||
We intend to come out with new Coda releases often, not daily. We
|
||||
don't wish to slight any OS/platform not mentioned above. We are just
|
||||
don't want to slight any OS/platform not mentioned above. We are just
|
||||
limited in our resources as to what we can support internally. We
|
||||
will be happy to integrate OpenBSD support as well as other OS
|
||||
support. Also, adding platform support is relatively easy and we can
|
||||
discuss this. The only problem is that Coda has a light weight
|
||||
support. Also, adding platform support should be relatively easy and
|
||||
we can discuss this. The only difficulty is that Coda has a light weight
|
||||
process package. It does some manipulations in assembler which would
|
||||
have to be redone for a different platform.
|
||||
|
||||
|
@ -1,12 +1,17 @@
|
||||
OOPS:
|
||||
FreeBSD does not fsync!!!
|
||||
|
||||
Near term:
|
||||
Existing VOP_LOCKS's should proabably be
|
||||
vn_lock since that is what they were in -stable.
|
||||
Fix bug in executing/mapping new files.
|
||||
cfs_mount bug: interaction with cfs_inactive no cfs_unsave.
|
||||
vref/vn_lock == vget except no VXWANT which may be on.
|
||||
Review locks: vn_lock/VOP_UNLOCK/lockmgr ...
|
||||
|
||||
Medium term:
|
||||
Add missing VFS methods.
|
||||
Do performance profile.
|
||||
Tune hash algorithm used in cfs_namecache.
|
||||
Tune hash algorithm used in cfs_subr.
|
||||
|
||||
Eventually:
|
||||
Use standard queue macros.
|
||||
|
@ -1,53 +1,56 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_fbsd.c,v 1.6 1998/08/28 18:12:11 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_fbsd.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/ucred.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/conf.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vnode_pager.h>
|
||||
|
||||
#include <cfs/coda.h>
|
||||
#include <cfs/cnode.h>
|
||||
#include <cfs/cfs_vnodeops.h>
|
||||
|
||||
#ifdef DEVFS
|
||||
#include <sys/devfsext.h>
|
||||
#endif
|
||||
#include <sys/conf.h>
|
||||
|
||||
#include <sys/vnode.h>
|
||||
#include <cfs/coda.h>
|
||||
#include <cfs/cnode.h>
|
||||
#include <cfs/cfs_vnodeops.h>
|
||||
|
||||
/*
|
||||
From: "Jordan K. Hubbard" <jkh@time.cdrom.com>
|
||||
@ -63,7 +66,6 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
|
||||
#define VC_DEV_NO 93
|
||||
|
||||
#ifdef __FreeBSD_version
|
||||
/* Type of device methods. */
|
||||
extern d_open_t vc_nb_open;
|
||||
extern d_close_t vc_nb_close;
|
||||
@ -76,33 +78,8 @@ static struct cdevsw vccdevsw =
|
||||
{
|
||||
vc_nb_open, vc_nb_close, vc_nb_read, vc_nb_write, /*93*/
|
||||
vc_nb_ioctl, nostop, nullreset, nodevtotty,
|
||||
vc_nb_poll, nommap, NULL, "Coda", NULL, -1 };
|
||||
#else
|
||||
/* Type of device methods. */
|
||||
#define D_OPEN_T d_open_t
|
||||
#define D_CLOSE_T d_close_t
|
||||
#define D_RDWR_T d_rdwr_t
|
||||
#define D_READ_T d_read_t
|
||||
#define D_WRITE_T d_write_t
|
||||
#define D_IOCTL_T d_ioctl_t
|
||||
#define D_SELECT_T d_select_t
|
||||
|
||||
/* rvb why */
|
||||
D_OPEN_T vc_nb_open; /* was is defined in cfs_FreeBSD.h */
|
||||
D_CLOSE_T vc_nb_close;
|
||||
D_READ_T vc_nb_read;
|
||||
D_WRITE_T vc_nb_write;
|
||||
D_IOCTL_T vc_nb_ioctl;
|
||||
D_SELECT_T vc_nb_select;
|
||||
|
||||
static struct cdevsw vccdevsw =
|
||||
{
|
||||
vc_nb_open, vc_nb_close, vc_nb_read, vc_nb_write,
|
||||
vc_nb_ioctl, nostop, nullreset, nodevtotty,
|
||||
vc_nb_select, nommap, NULL, "Coda", NULL, -1 };
|
||||
|
||||
PSEUDO_SET(vcattach, vc);
|
||||
#endif
|
||||
vc_nb_poll, nommap, NULL, "Coda", NULL, -1
|
||||
};
|
||||
|
||||
void vcattach __P((void));
|
||||
static dev_t vccdev;
|
||||
@ -125,21 +102,9 @@ vcattach(void)
|
||||
VCDEBUG("cfs: vccdevsw entry installed at %d.\n", major(vccdev));
|
||||
}
|
||||
|
||||
void
|
||||
cvref(vp)
|
||||
struct vnode *vp;
|
||||
{
|
||||
if (vp->v_usecount <= 0)
|
||||
panic("vref used where vget required");
|
||||
|
||||
vp->v_usecount++;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __FreeBSD_version
|
||||
static vc_devsw_installed = 0;
|
||||
|
||||
static void vc_drvinit __P((void *unused));
|
||||
|
||||
static void
|
||||
vc_drvinit(void *unused)
|
||||
{
|
||||
@ -238,4 +203,3 @@ cfs_fbsd_putpages(v)
|
||||
|
||||
|
||||
SYSINIT(vccdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+VC_DEV_NO,vc_drvinit,NULL)
|
||||
#endif
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_namecache.c,v 1.11 1998/08/28 18:12:16 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_namecache.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -45,6 +47,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfs_namecache.c,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.11 1998/08/28 18:12:16 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -206,32 +211,25 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
#include <sys/param.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/ucred.h>
|
||||
#include <sys/select.h>
|
||||
|
||||
#ifndef insque
|
||||
#include <sys/systm.h>
|
||||
#endif /* insque */
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vm_object.h>
|
||||
|
||||
#include <cfs/coda.h>
|
||||
#include <cfs/cnode.h>
|
||||
#include <cfs/cfsnc.h>
|
||||
|
||||
#if defined(__NetBSD__) || defined(__FreeBSD__)
|
||||
#ifndef insque
|
||||
#include <sys/systm.h>
|
||||
#endif /* insque */
|
||||
#endif /* __NetBSD__ || defined(__FreeBSD__) */
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vm_object.h>
|
||||
#ifdef __FreeBSD_version
|
||||
#include <sys/ucred.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Declaration of the name cache data structure.
|
||||
*/
|
||||
|
||||
int cfsnc_use = 1; /* Indicate use of CFS Name Cache */
|
||||
|
||||
int cfsnc_size = CFSNC_CACHESIZE; /* size of the cache */
|
||||
int cfsnc_hashsize = CFSNC_HASHSIZE; /* size of the primary hash */
|
||||
|
||||
@ -246,16 +244,12 @@ struct cfsnc_statistics cfsnc_stat; /* Keep various stats */
|
||||
*/
|
||||
int cfsnc_debug = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Entry points for the CFS Name Cache
|
||||
*/
|
||||
static struct cfscache *
|
||||
cfsnc_find(struct cnode *dcp, const char *name, int namelen,
|
||||
static struct cfscache *cfsnc_find(struct cnode *dcp, const char *name, int namelen,
|
||||
struct ucred *cred, int hash);
|
||||
static void
|
||||
cfsnc_remove(struct cfscache *cncp, enum dc_status dcstat);
|
||||
|
||||
static void cfsnc_remove(struct cfscache *cncp, enum dc_status dcstat);
|
||||
|
||||
/*
|
||||
* Initialize the cache, the LRU structure and the Hash structure(s)
|
||||
@ -657,7 +651,7 @@ cfsnc_zapfile(dcp, name, namelen)
|
||||
|
||||
while (cncp) {
|
||||
cfsnchash[hash].length--; /* Used for tuning */
|
||||
/* 1.3 */
|
||||
|
||||
cfsnc_remove(cncp, NOT_DOWNCALL);
|
||||
cncp = cfsnc_find(dcp, name, namelen, 0, hash);
|
||||
}
|
||||
|
@ -1,136 +0,0 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_nbsd.c,v 1.21 1998/08/28 18:12:17 rvb Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
* Copyright (c) 1990 Carnegie-Mellon University
|
||||
* Copyright (c) 1989 Carnegie-Mellon University
|
||||
* All rights reserved. The CMU software License Agreement specifies
|
||||
* the terms and conditions for use and redistribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This code was written for the Coda file system at Carnegie Mellon
|
||||
* University. Contributers include David Steere, James Kistler,
|
||||
* M. Satyanarayanan, and Brian Noble.
|
||||
*/
|
||||
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfs_nbsd.c,v $
|
||||
* Revision 1.21 1998/08/28 18:12:17 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
* trees. It will then be tailored to the particular platform
|
||||
* by flushing conditional code.
|
||||
*
|
||||
* Revision 1.20 1998/08/18 17:05:15 rvb
|
||||
* Don't use __RCSID now
|
||||
*
|
||||
* Revision 1.19 1998/08/18 16:31:40 rvb
|
||||
* Sync the code for NetBSD -current; test on 1.3 later
|
||||
*
|
||||
* Revision 1.18 98/01/23 11:53:40 rvb
|
||||
* Bring RVB_CFS1_1 to HEAD
|
||||
*
|
||||
* Revision 1.17.2.1 97/12/09 16:07:11 rvb
|
||||
* Sync with vfs/include/coda.h
|
||||
*
|
||||
* Revision 1.17 97/12/05 10:39:15 rvb
|
||||
* Read CHANGES
|
||||
*
|
||||
* Revision 1.16.6.5 97/11/20 11:46:39 rvb
|
||||
* Capture current cfs_venus
|
||||
*
|
||||
* Revision 1.16.6.4 97/11/18 10:27:14 rvb
|
||||
* cfs_nbsd.c is DEAD!!!; integrated into cfs_vf/vnops.c
|
||||
* cfs_nb_foo and cfs_foo are joined
|
||||
*
|
||||
* Revision 1.16.6.3 97/11/13 22:02:58 rvb
|
||||
* pass2 cfs_NetBSD.h mt
|
||||
*
|
||||
* Revision 1.16.6.2 97/11/12 12:09:37 rvb
|
||||
* reorg pass1
|
||||
*
|
||||
* Revision 1.16.6.1 97/10/28 23:10:14 rvb
|
||||
* >64Meg; venus can be killed!
|
||||
*
|
||||
* Revision 1.16 97/07/18 15:28:41 rvb
|
||||
* Bigger/Better/Faster than AFS
|
||||
*
|
||||
* Revision 1.15 1997/02/19 18:41:39 bnoble
|
||||
* Didn't sufficiently unswap the now-unswapped dvp and vp in cfs_nb_link
|
||||
*
|
||||
* Revision 1.13 1997/02/18 23:46:25 bnoble
|
||||
* NetBSD swapped the order of arguments to VOP_LINK between 1.1 and 1.2.
|
||||
* This tracks that change.
|
||||
*
|
||||
* Revision 1.12 1997/02/18 22:23:38 bnoble
|
||||
* Rename lockdebug to cfs_lockdebug
|
||||
*
|
||||
* Revision 1.11 1997/02/13 18:46:14 rvb
|
||||
* Name CODA FS for df
|
||||
*
|
||||
* Revision 1.10 1997/02/12 15:32:05 rvb
|
||||
* Make statfs return values like for AFS
|
||||
*
|
||||
* Revision 1.9 1997/01/30 16:42:02 bnoble
|
||||
* Trace version as of SIGCOMM submission. Minor fix in cfs_nb_open
|
||||
*
|
||||
* Revision 1.8 1997/01/13 17:11:05 bnoble
|
||||
* Coda statfs needs to return something other than -1 for blocks avail. and
|
||||
* files available for wabi (and other windowsish) programs to install
|
||||
* there correctly.
|
||||
*
|
||||
* Revision 1.6 1996/12/05 16:20:14 bnoble
|
||||
* Minor debugging aids
|
||||
*
|
||||
* Revision 1.5 1996/11/25 18:25:11 bnoble
|
||||
* Added a diagnostic check for cfs_nb_lock
|
||||
*
|
||||
* Revision 1.4 1996/11/13 04:14:19 bnoble
|
||||
* Merging BNOBLE_WORK_6_20_96 into main line
|
||||
*
|
||||
*
|
||||
* Revision 1.3 1996/11/08 18:06:11 bnoble
|
||||
* Minor changes in vnode operation signature, VOP_UPDATE signature, and
|
||||
* some newly defined bits in the include files.
|
||||
*
|
||||
* Revision 1.2.8.1 1996/06/26 16:28:26 bnoble
|
||||
* Minor bug fixes
|
||||
*
|
||||
* Revision 1.2 1996/01/02 16:56:52 bnoble
|
||||
* Added support for Coda MiniCache and raw inode calls (final commit)
|
||||
*
|
||||
* Revision 1.1.2.1 1995/12/20 01:57:17 bnoble
|
||||
* Added CFS-specific files
|
||||
*
|
||||
*/
|
@ -1,35 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_psdev.c,v 1.9 1998/08/28 18:12:17 rvb Exp $ */
|
||||
|
||||
#define CTL_C
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_psdev.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -43,20 +43,19 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
* University. Contributers include David Steere, James Kistler, and
|
||||
* M. Satyanarayanan. */
|
||||
|
||||
/* ************************************************** */
|
||||
/* These routines define the psuedo device for communication between
|
||||
/*
|
||||
* These routines define the psuedo device for communication between
|
||||
* Coda's Venus and Minicache in Mach 2.6. They used to be in cfs_subr.c,
|
||||
* but I moved them to make it easier to port the Minicache without
|
||||
* porting coda. -- DCS 10/12/94
|
||||
*/
|
||||
|
||||
/*
|
||||
* Renamed to cfs_psdev: pseudo-device driver.
|
||||
*/
|
||||
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfs_psdev.c,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.9 1998/08/28 18:12:17 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -153,40 +152,28 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
extern int cfsnc_initialized; /* Set if cache has been initialized */
|
||||
|
||||
#include <vcfs.h>
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/file.h>
|
||||
#ifdef __FreeBSD_version
|
||||
#include <sys/ioccom.h>
|
||||
#else
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef NetBSD1_3
|
||||
#include <sys/poll.h>
|
||||
#endif
|
||||
#ifdef __FreeBSD_version
|
||||
#include <sys/poll.h>
|
||||
#else
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
#include <sys/conf.h>
|
||||
|
||||
#include <cfs/coda.h>
|
||||
#include <cfs/cnode.h>
|
||||
#include <cfs/cfsnc.h>
|
||||
#include <cfs/cfsio.h>
|
||||
|
||||
#define CTL_C
|
||||
|
||||
int cfs_psdev_print_entry = 0;
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define ENTRY \
|
||||
if(cfs_psdev_print_entry) myprintf(("Entered %s\n",__FUNCTION__))
|
||||
#else
|
||||
#define ENTRY
|
||||
#endif
|
||||
#define ENTRY if(cfs_psdev_print_entry) myprintf(("Entered %s\n",__FUNCTION__))
|
||||
|
||||
void vcfsattach(int n);
|
||||
int vc_nb_open(dev_t dev, int flag, int mode, struct proc *p);
|
||||
@ -194,11 +181,7 @@ int vc_nb_close (dev_t dev, int flag, int mode, struct proc *p);
|
||||
int vc_nb_read(dev_t dev, struct uio *uiop, int flag);
|
||||
int vc_nb_write(dev_t dev, struct uio *uiop, int flag);
|
||||
int vc_nb_ioctl(dev_t dev, int cmd, caddr_t addr, int flag, struct proc *p);
|
||||
#if defined(NetBSD1_3) || defined(__FreeBSD_version)
|
||||
int vc_nb_poll(dev_t dev, int events, struct proc *p);
|
||||
#else
|
||||
int vc_nb_select(dev_t dev, int flag, struct proc *p);
|
||||
#endif
|
||||
|
||||
struct vmsg {
|
||||
struct queue vm_chain;
|
||||
@ -222,9 +205,6 @@ vcfsattach(n)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* These functions are written for NetBSD.
|
||||
*/
|
||||
int
|
||||
vc_nb_open(dev, flag, mode, p)
|
||||
dev_t dev;
|
||||
@ -289,14 +269,6 @@ vc_nb_close (dev, flag, mode, p)
|
||||
if (mi->mi_rootvp) {
|
||||
/* Let unmount know this is for real */
|
||||
VTOC(mi->mi_rootvp)->c_flags |= C_UNMOUNTING;
|
||||
#ifdef NEW_LOCKMGR
|
||||
#ifdef __FreeBSD_version
|
||||
/* dounmount is different ... probably wrong ... */
|
||||
#else
|
||||
if (vfs_busy(mi->mi_vfsp, 0, 0))
|
||||
return (EBUSY);
|
||||
#endif
|
||||
#endif
|
||||
cfs_unmounting(mi->mi_vfsp);
|
||||
err = dounmount(mi->mi_vfsp, flag, p);
|
||||
if (err)
|
||||
@ -523,7 +495,6 @@ vc_nb_ioctl(dev, cmd, addr, flag, p)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NetBSD1_3) || defined(__FreeBSD_version)
|
||||
int
|
||||
vc_nb_poll(dev, events, p)
|
||||
dev_t dev;
|
||||
@ -551,33 +522,6 @@ vc_nb_poll(dev, events, p)
|
||||
|
||||
return(0);
|
||||
}
|
||||
#else
|
||||
int
|
||||
vc_nb_select(dev, flag, p)
|
||||
dev_t dev;
|
||||
int flag;
|
||||
struct proc *p;
|
||||
{
|
||||
register struct vcomm *vcp;
|
||||
|
||||
ENTRY;
|
||||
|
||||
if (minor(dev) >= NVCFS || minor(dev) < 0)
|
||||
return(ENXIO);
|
||||
|
||||
vcp = &cfs_mnttbl[minor(dev)].mi_vcomm;
|
||||
|
||||
if (flag != FREAD)
|
||||
return(0);
|
||||
|
||||
if (!EMPTY(vcp->vc_requests))
|
||||
return(1);
|
||||
|
||||
selrecord(p, &(vcp->vc_selproc));
|
||||
|
||||
return(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Statistics
|
||||
@ -593,7 +537,6 @@ struct cfs_clstat cfs_clstat;
|
||||
* (e.g. kill -9).
|
||||
*/
|
||||
|
||||
/* If you want this to be interruptible, set this to > PZERO */
|
||||
int cfscall_sleep = PZERO - 1;
|
||||
#ifdef CTL_C
|
||||
int cfs_pcatch = PCATCH;
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_subr.c,v 1.11 1998/08/28 18:12:18 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_subr.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -44,6 +46,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfs_subr.c,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.11 1998/08/28 18:12:18 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -202,8 +207,8 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/mount.h>
|
||||
|
||||
@ -212,8 +217,6 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
#include <cfs/cfs_subr.h>
|
||||
#include <cfs/cfsnc.h>
|
||||
|
||||
#if NVCFS
|
||||
|
||||
int cfs_active = 0;
|
||||
int cfs_reuse = 0;
|
||||
int cfs_new = 0;
|
||||
@ -221,11 +224,8 @@ int cfs_new = 0;
|
||||
struct cnode *cfs_freelist = NULL;
|
||||
struct cnode *cfs_cache[CFS_CACHESIZE];
|
||||
|
||||
#define cfshash(fid) \
|
||||
(((fid)->Volume + (fid)->Vnode) & (CFS_CACHESIZE-1))
|
||||
|
||||
#define cfshash(fid) (((fid)->Volume + (fid)->Vnode) & (CFS_CACHESIZE-1))
|
||||
#define CNODE_NEXT(cp) ((cp)->c_next)
|
||||
|
||||
#define ODD(vnode) ((vnode) & 0x1)
|
||||
|
||||
/*
|
||||
@ -690,24 +690,13 @@ int
|
||||
cfs_vmflush(cp)
|
||||
struct cnode *cp;
|
||||
{
|
||||
#if 0
|
||||
/* old code */
|
||||
/* Unset <device, inode> so that page_read doesn't try to use
|
||||
(possibly) invalid cache file. */
|
||||
cp->c_device = 0;
|
||||
cp->c_inode = 0;
|
||||
|
||||
return(inode_uncache_try(VTOI(CTOV(cp))) ? 0 : ETXTBSY);
|
||||
#else /* __NetBSD__ || __FreeBSD__ */
|
||||
return 0;
|
||||
#endif /* __NetBSD__ || __FreeBSD__ */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* kernel-internal debugging switches
|
||||
*/
|
||||
|
||||
void cfs_debugon(void)
|
||||
{
|
||||
cfsdebug = -1;
|
||||
@ -745,6 +734,3 @@ void cfs_debugoff(void)
|
||||
* 13) all <= 3
|
||||
* ...
|
||||
*/
|
||||
|
||||
|
||||
#endif /* NVCFS */
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_subr.h,v 1.4 1998/08/18 17:05:16 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_subr.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
struct cnode *cfs_alloc(void);
|
||||
void cfs_free(struct cnode *cp);
|
||||
@ -41,5 +43,3 @@ void cfs_debugoff(void);
|
||||
int cfs_kill(struct mount *whoIam, enum dc_status dcstat);
|
||||
void cfs_save(struct cnode *cp);
|
||||
void cfs_unsave(struct cnode *cp);
|
||||
|
||||
|
||||
|
@ -1,45 +1,42 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_venus.c,v 1.11 1998/08/28 18:12:20 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_venus.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/select.h>
|
||||
#ifdef __FreeBSD_version
|
||||
#include <sys/ioccom.h>
|
||||
#else
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
/* for CNV_OFLAGS below */
|
||||
#include <sys/fcntl.h>
|
||||
|
||||
#include <cfs/coda.h>
|
||||
@ -342,11 +339,11 @@ venus_access(void *mdp, ViceFid *fid, int mode,
|
||||
/* send the open to venus. */
|
||||
INIT_IN(&inp->ih, CFS_ACCESS, cred, p);
|
||||
inp->VFid = *fid;
|
||||
#ifdef NetBSD1_3
|
||||
inp->flags = mode;
|
||||
#else
|
||||
/* NOTE:
|
||||
* NetBSD and Venus internals use the "data" in the low 3 bits.
|
||||
* Hence, the conversion.
|
||||
*/
|
||||
inp->flags = mode>>6;
|
||||
#endif
|
||||
|
||||
error = cfscall(mdp, Isize, &Osize, (char *)inp);
|
||||
|
||||
@ -437,11 +434,7 @@ venus_create(void *mdp, ViceFid *fid,
|
||||
INIT_IN(&inp->ih, CFS_CREATE, cred, p);
|
||||
inp->VFid = *fid;
|
||||
inp->excl = exclusive ? C_O_EXCL : 0;
|
||||
#ifdef NetBSD1_3
|
||||
inp->mode = mode<<6;
|
||||
#else
|
||||
inp->mode = mode;
|
||||
#endif
|
||||
CNV_V2VV_ATTR(&inp->attr, va);
|
||||
|
||||
inp->name = Isize;
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_venus.h,v 1.4 1998/08/18 17:05:18 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_venus.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
int
|
||||
venus_root(void *mdp,
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_vfsops.c,v 1.11 1998/08/28 18:12:22 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_vfsops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -45,6 +47,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfs_vfsops.c,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.11 1998/08/28 18:12:22 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -173,11 +178,12 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/select.h>
|
||||
|
||||
#include <cfs/coda.h>
|
||||
@ -186,25 +192,14 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
#include <cfs/cfs_venus.h>
|
||||
#include <cfs/cfs_subr.h>
|
||||
#include <cfs/coda_opstats.h>
|
||||
/* for VN_RDEV */
|
||||
|
||||
#include <miscfs/specfs/specdev.h>
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#ifdef __FreeBSD_version
|
||||
MALLOC_DEFINE(M_CFS, "CFS storage", "Various Coda Structures");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int cfsdebug = 0;
|
||||
|
||||
int cfs_vfsop_print_entry = 0;
|
||||
#ifdef __GNUC__
|
||||
#define ENTRY \
|
||||
if(cfs_vfsop_print_entry) myprintf(("Entered %s\n",__FUNCTION__))
|
||||
#else
|
||||
#define ENTRY
|
||||
#endif
|
||||
|
||||
#define ENTRY if(cfs_vfsop_print_entry) myprintf(("Entered %s\n",__FUNCTION__))
|
||||
|
||||
struct vnode *cfs_ctlvp;
|
||||
struct cfs_mntinfo cfs_mnttbl[NVCFS]; /* indexed by minor device number */
|
||||
@ -220,65 +215,7 @@ struct cfs_op_stats cfs_vfsopstats[CFS_VFSOPS_SIZE];
|
||||
|
||||
extern int cfsnc_initialized; /* Set if cache has been initialized */
|
||||
extern int vc_nb_open __P((dev_t, int, int, struct proc *));
|
||||
#ifdef __NetBSD__
|
||||
extern struct cdevsw cdevsw[]; /* For sanity check in cfs_mount */
|
||||
#endif
|
||||
/* NetBSD interface to statfs */
|
||||
|
||||
#if defined(__NetBSD__) && defined(NetBSD1_3) && (NetBSD1_3 >= 5)
|
||||
extern struct vnodeopv_desc cfs_vnodeop_opv_desc;
|
||||
|
||||
struct vnodeopv_desc *cfs_vnodeopv_descs[] = {
|
||||
&cfs_vnodeop_opv_desc,
|
||||
NULL,
|
||||
};
|
||||
|
||||
struct vfsops cfs_vfsops = {
|
||||
MOUNT_CFS,
|
||||
cfs_mount,
|
||||
cfs_start,
|
||||
cfs_unmount,
|
||||
cfs_root,
|
||||
cfs_quotactl,
|
||||
cfs_nb_statfs,
|
||||
cfs_sync,
|
||||
cfs_vget,
|
||||
(int (*) (struct mount *, struct fid *, struct mbuf *, struct vnode **,
|
||||
int *, struct ucred **))
|
||||
eopnotsupp,
|
||||
(int (*) (struct vnode *, struct fid *)) eopnotsupp,
|
||||
cfs_init,
|
||||
#if (NetBSD1_3 >= 7)
|
||||
cfs_sysctl,
|
||||
#endif
|
||||
(int (*)(void)) eopnotsupp,
|
||||
cfs_vnodeopv_descs,
|
||||
0
|
||||
};
|
||||
#elif defined(__NetBSD__)
|
||||
struct vfsops cfs_vfsops = {
|
||||
MOUNT_CFS,
|
||||
cfs_mount,
|
||||
cfs_start,
|
||||
cfs_unmount,
|
||||
cfs_root,
|
||||
cfs_quotactl,
|
||||
cfs_nb_statfs,
|
||||
cfs_sync,
|
||||
cfs_vget,
|
||||
(int (*) (struct mount *, struct fid *, struct mbuf *, struct vnode **,
|
||||
int *, struct ucred **))
|
||||
eopnotsupp,
|
||||
(int (*) (struct vnode *, struct fid *)) eopnotsupp,
|
||||
cfs_init,
|
||||
#ifdef NetBSD1_3
|
||||
(int (*)(void)) eopnotsupp,
|
||||
#endif
|
||||
0
|
||||
};
|
||||
|
||||
#elif defined(__FreeBSD__)
|
||||
#ifdef __FreeBSD_version
|
||||
struct vfsops cfs_vfsops = {
|
||||
cfs_mount,
|
||||
cfs_start,
|
||||
@ -295,29 +232,7 @@ struct vfsops cfs_vfsops = {
|
||||
cfs_init,
|
||||
};
|
||||
|
||||
#else
|
||||
struct vfsops cfs_vfsops = {
|
||||
cfs_mount,
|
||||
cfs_start,
|
||||
cfs_unmount,
|
||||
cfs_root,
|
||||
cfs_quotactl,
|
||||
cfs_nb_statfs,
|
||||
cfs_sync,
|
||||
cfs_vget,
|
||||
(int (*) (struct mount *, struct fid *, struct mbuf *, struct vnode **,
|
||||
int *, struct ucred **))
|
||||
eopnotsupp,
|
||||
(int (*) (struct vnode *, struct fid *)) eopnotsupp,
|
||||
cfs_init,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include <sys/kernel.h>
|
||||
VFS_SET(cfs_vfsops, cfs, MOUNT_CFS, VFCF_NETWORK);
|
||||
#endif
|
||||
|
||||
int
|
||||
cfs_vfsopstats_init(void)
|
||||
@ -335,7 +250,6 @@ cfs_vfsopstats_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* cfs mount vfsop
|
||||
* Set up mount info record and attach it to vfs struct.
|
||||
@ -344,13 +258,8 @@ cfs_vfsopstats_init(void)
|
||||
int
|
||||
cfs_mount(vfsp, path, data, ndp, p)
|
||||
struct mount *vfsp; /* Allocated and initialized by mount(2) */
|
||||
#ifdef NetBSD1_3
|
||||
const char *path; /* path covered: ignored by the fs-layer */
|
||||
void *data; /* Need to define a data type for this in netbsd? */
|
||||
#else
|
||||
char *path; /* path covered: ignored by the fs-layer */
|
||||
caddr_t data; /* Need to define a data type for this in netbsd? */
|
||||
#endif
|
||||
struct nameidata *ndp; /* Clobber this to lookup the device name */
|
||||
struct proc *p; /* The ever-famous proc pointer */
|
||||
{
|
||||
@ -399,11 +308,7 @@ cfs_mount(vfsp, path, data, ndp, p)
|
||||
/*
|
||||
* See if the device table matches our expectations.
|
||||
*/
|
||||
#ifdef __NetBSD__
|
||||
if (cdevsw[major(dev)].d_open != vc_nb_open)
|
||||
#elif defined(__FreeBSD__)
|
||||
if (cdevsw[major(dev)]->d_open != vc_nb_open)
|
||||
#endif
|
||||
{
|
||||
MARK_INT_FAIL(CFS_MOUNT_STATS);
|
||||
return(ENXIO);
|
||||
@ -426,19 +331,8 @@ cfs_mount(vfsp, path, data, ndp, p)
|
||||
|
||||
/* No initialization (here) of mi_vcomm! */
|
||||
vfsp->mnt_data = (qaddr_t)mi;
|
||||
#ifdef __NetBSD__
|
||||
vfsp->mnt_stat.f_fsid.val[0] = 0;
|
||||
vfsp->mnt_stat.f_fsid.val[1] = makefstype(MOUNT_CFS);
|
||||
#elif defined(__FreeBSD__) && defined(__FreeBSD_version)
|
||||
|
||||
vfs_getnewfsid (vfsp);
|
||||
|
||||
#elif defined(__FreeBSD__)
|
||||
/* Seems a bit overkill, since usualy /coda is the only mount point
|
||||
* for cfs.
|
||||
*/
|
||||
getnewfsid (vfsp, MOUNT_CFS);
|
||||
#endif
|
||||
mi->mi_vfsp = vfsp;
|
||||
|
||||
/*
|
||||
@ -471,13 +365,12 @@ cfs_mount(vfsp, path, data, ndp, p)
|
||||
|
||||
/* set filesystem block size */
|
||||
vfsp->mnt_stat.f_bsize = 8192; /* XXX -JJK */
|
||||
#ifdef __FreeBSD__
|
||||
|
||||
/* Set f_iosize. XXX -- inamura@isl.ntt.co.jp.
|
||||
For vnode_pager_haspage() references. The value should be obtained
|
||||
from underlying UFS. */
|
||||
/* Checked UFS. iosize is set as 8192 */
|
||||
vfsp->mnt_stat.f_iosize = 8192;
|
||||
#endif
|
||||
|
||||
/* error is currently guaranteed to be zero, but in case some
|
||||
code changes... */
|
||||
@ -526,27 +419,10 @@ cfs_unmount(vfsp, mntflags, p)
|
||||
#endif
|
||||
vrele(mi->mi_rootvp);
|
||||
|
||||
#ifdef NetBSD1_3
|
||||
active = cfs_kill(vfsp, NOT_DOWNCALL);
|
||||
|
||||
#if defined(__NetBSD__) && defined(NetBSD1_3) && (NetBSD1_3 >= 7)
|
||||
if (1)
|
||||
#else
|
||||
if ((error = vfs_busy(mi->mi_vfsp)) == 0)
|
||||
#endif
|
||||
{
|
||||
error = vflush(mi->mi_vfsp, NULLVP, FORCECLOSE);
|
||||
printf("cfs_unmount: active = %d, vflush active %d\n", active, error);
|
||||
error = 0;
|
||||
} else {
|
||||
printf("cfs_unmount: busy\n");
|
||||
}
|
||||
#else /* FreeBSD I guess */
|
||||
active = cfs_kill(vfsp, NOT_DOWNCALL);
|
||||
error = vflush(mi->mi_vfsp, NULLVP, FORCECLOSE);
|
||||
printf("cfs_unmount: active = %d, vflush active %d\n", active, error);
|
||||
error = 0;
|
||||
#endif
|
||||
/* I'm going to take this out to allow lookups to go through. I'm
|
||||
* not sure it's important anyway. -- DCS 2/2/94
|
||||
*/
|
||||
@ -591,8 +467,12 @@ cfs_root(vfsp, vpp)
|
||||
{ /* Found valid root. */
|
||||
*vpp = mi->mi_rootvp;
|
||||
/* On Mach, this is vref. On NetBSD, VOP_LOCK */
|
||||
#if 1
|
||||
vref(*vpp);
|
||||
VOP_X_LOCK(*vpp, LK_EXCLUSIVE);
|
||||
vn_lock(*vpp, LK_EXCLUSIVE, p);
|
||||
#else
|
||||
vget(*vpp, LK_EXCLUSIVE, p);
|
||||
#endif
|
||||
MARK_INT_SAT(CFS_ROOT_STATS);
|
||||
return(0);
|
||||
}
|
||||
@ -610,8 +490,13 @@ cfs_root(vfsp, vpp)
|
||||
cfs_save(VTOC(mi->mi_rootvp));
|
||||
|
||||
*vpp = mi->mi_rootvp;
|
||||
#if 1
|
||||
vref(*vpp);
|
||||
VOP_X_LOCK(*vpp, LK_EXCLUSIVE);
|
||||
vn_lock(*vpp, LK_EXCLUSIVE, p);
|
||||
#else
|
||||
vget(*vpp, LK_EXCLUSIVE, p);
|
||||
#endif
|
||||
|
||||
MARK_INT_SAT(CFS_ROOT_STATS);
|
||||
goto exit;
|
||||
} else if (error == ENODEV) {
|
||||
@ -625,8 +510,13 @@ cfs_root(vfsp, vpp)
|
||||
* will fail.
|
||||
*/
|
||||
*vpp = mi->mi_rootvp;
|
||||
#if 1
|
||||
vref(*vpp);
|
||||
VOP_X_LOCK(*vpp, LK_EXCLUSIVE);
|
||||
vn_lock(*vpp, LK_EXCLUSIVE, p);
|
||||
#else
|
||||
vget(*vpp, LK_EXCLUSIVE, p);
|
||||
#endif
|
||||
|
||||
MARK_INT_FAIL(CFS_ROOT_STATS);
|
||||
error = 0;
|
||||
goto exit;
|
||||
@ -636,6 +526,7 @@ cfs_root(vfsp, vpp)
|
||||
|
||||
goto exit;
|
||||
}
|
||||
|
||||
exit:
|
||||
return(error);
|
||||
}
|
||||
@ -674,11 +565,7 @@ cfs_nb_statfs(vfsp, sbp, p)
|
||||
#define NB_SFS_SIZ 0x895440
|
||||
*/
|
||||
/* Note: Normal fs's have a bsize of 0x400 == 1024 */
|
||||
#ifdef __NetBSD__
|
||||
sbp->f_type = 0;
|
||||
#elif defined(__FreeBSD__)
|
||||
sbp->f_type = MOUNT_CFS;
|
||||
#endif
|
||||
sbp->f_bsize = 8192; /* XXX */
|
||||
sbp->f_iosize = 8192; /* XXX */
|
||||
#define NB_SFS_SIZ 0x8AB75D
|
||||
@ -688,9 +575,6 @@ cfs_nb_statfs(vfsp, sbp, p)
|
||||
sbp->f_files = NB_SFS_SIZ;
|
||||
sbp->f_ffree = NB_SFS_SIZ;
|
||||
bcopy((caddr_t)&(vfsp->mnt_stat.f_fsid), (caddr_t)&(sbp->f_fsid), sizeof (fsid_t));
|
||||
#ifdef __NetBSD__
|
||||
strncpy(sbp->f_fstypename, MOUNT_CFS, MFSNAMELEN-1);
|
||||
#endif
|
||||
strcpy(sbp->f_mntonname, "/coda");
|
||||
strcpy(sbp->f_mntfromname, "CFS");
|
||||
/* MARK_INT_SAT(CFS_STATFS_STATS); */
|
||||
@ -780,57 +664,12 @@ cfs_vptofh(vnp, fidp)
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
#ifdef __NetBSD__
|
||||
void
|
||||
cfs_init(void)
|
||||
{
|
||||
ENTRY;
|
||||
}
|
||||
#elif defined(__FreeBSD__)
|
||||
#ifdef __FreeBSD_version
|
||||
int
|
||||
cfs_init(struct vfsconf *vfsp)
|
||||
{
|
||||
ENTRY;
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int
|
||||
cfs_init(void)
|
||||
{
|
||||
ENTRY;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__NetBSD__) && defined(NetBSD1_3) && (NetBSD1_3 >= 7)
|
||||
int
|
||||
cfs_sysctl(name, namelen, oldp, oldlp, newp, newl, p)
|
||||
int *name;
|
||||
u_int namelen;
|
||||
void *oldp;
|
||||
size_t *oldlp;
|
||||
void *newp;
|
||||
size_t newl;
|
||||
struct proc *p;
|
||||
{
|
||||
|
||||
/* all sysctl names at this level are terminal */
|
||||
if (namelen != 1)
|
||||
return (ENOTDIR); /* overloaded */
|
||||
|
||||
switch (name[0]) {
|
||||
/*
|
||||
case FFS_CLUSTERREAD:
|
||||
return (sysctl_int(oldp, oldlp, newp, newl, &doclusterread));
|
||||
*/
|
||||
default:
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* To allow for greater ease of use, some vnodes may be orphaned when
|
||||
@ -873,11 +712,7 @@ struct mount *devtomp(dev)
|
||||
|
||||
for (mp = mountlist.cqh_first; mp != (void*)&mountlist; mp = nmp) {
|
||||
nmp = mp->mnt_list.cqe_next;
|
||||
if (
|
||||
#ifdef __NetBSD__
|
||||
(!strcmp(mp->mnt_op->vfs_name, MOUNT_UFS)) &&
|
||||
#endif
|
||||
((VFSTOUFS(mp))->um_dev == (dev_t) dev)) {
|
||||
if (((VFSTOUFS(mp))->um_dev == (dev_t) dev)) {
|
||||
/* mount corresponds to UFS and the device matches one we want */
|
||||
return(mp);
|
||||
}
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_vfsops.h,v 1.9 1998/08/28 18:12:22 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_vfsops.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* cfid structure:
|
||||
@ -41,17 +43,11 @@ struct cfid {
|
||||
ViceFid cfid_fid;
|
||||
};
|
||||
|
||||
|
||||
struct mount;
|
||||
|
||||
int cfs_vfsopstats_init(void);
|
||||
#ifdef NetBSD1_3
|
||||
int cfs_mount(struct mount *, const char *, void *, struct nameidata *,
|
||||
struct proc *);
|
||||
#else
|
||||
int cfs_mount(struct mount *, char *, caddr_t, struct nameidata *,
|
||||
struct proc *);
|
||||
#endif
|
||||
int cfs_start(struct mount *, int, struct proc *);
|
||||
int cfs_unmount(struct mount *, int, struct proc *);
|
||||
int cfs_root(struct mount *, struct vnode **);
|
||||
@ -62,17 +58,6 @@ int cfs_vget(struct mount *, ino_t, struct vnode **);
|
||||
int cfs_fhtovp(struct mount *, struct fid *, struct mbuf *, struct vnode **,
|
||||
int *, struct ucred **);
|
||||
int cfs_vptofh(struct vnode *, struct fid *);
|
||||
#ifdef __NetBSD__
|
||||
void cfs_init(void);
|
||||
#elif defined(__FreeBSD__)
|
||||
#ifdef __FreeBSD_version
|
||||
int cfs_init(struct vfsconf *vfsp);
|
||||
#else
|
||||
int cfs_init(void);
|
||||
#endif
|
||||
#endif
|
||||
#if defined(__NetBSD__) && defined(NetBSD1_3) && (NetBSD1_3 >= 7)
|
||||
int cfs_sysctl(int *, u_int, void *, size_t *, void *, size_t,
|
||||
struct proc *);
|
||||
#endif
|
||||
|
||||
int getNewVnode(struct vnode **vpp);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_vnodeops.h,v 1.7 1998/08/28 18:12:24 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_vnodeops.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -46,6 +48,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfs_vnodeops.h,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.7 1998/08/28 18:12:24 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -87,7 +92,6 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* NetBSD interfaces to the vnodeops */
|
||||
int cfs_open __P((void *));
|
||||
int cfs_close __P((void *));
|
||||
@ -117,22 +121,15 @@ int cfs_reclaim __P((void *));
|
||||
int cfs_lock __P((void *));
|
||||
int cfs_unlock __P((void *));
|
||||
int cfs_islocked __P((void *));
|
||||
int nbsd_vop_error __P((void *));
|
||||
int nbsd_vop_nop __P((void *));
|
||||
#ifdef __FreeBSD__
|
||||
int fbsd_vnotsup __P((void *ap));
|
||||
#ifdef __FreeBSD_version
|
||||
int cfs_vop_error __P((void *));
|
||||
int cfs_vop_nop __P((void *));
|
||||
int cfs_fbsd_getpages __P((void *));
|
||||
int cfs_fbsd_putpages __P((void *));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int (**cfs_vnodeop_p)(void *);
|
||||
|
||||
int cfs_rdwr(struct vnode *vp, struct uio *uiop, enum uio_rw rw,
|
||||
int ioflag, struct ucred *cred, struct proc *p);
|
||||
|
||||
|
||||
|
||||
int cfs_grab_vnode(dev_t dev, ino_t ino, struct vnode **vpp);
|
||||
void print_vattr(struct vattr *attr);
|
||||
void print_cred(struct ucred *cred);
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfsio.h,v 1.5 1998/08/18 17:05:23 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfsio.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -45,6 +47,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfsio.h,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.5 1998/08/18 17:05:23 rvb
|
||||
* Don't use __RCSID now
|
||||
*
|
||||
@ -106,20 +111,11 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
|
||||
/* Define ioctl commands for vcioctl, /dev/cfs */
|
||||
|
||||
#ifdef __STDC__
|
||||
#define CFSRESIZE _IOW('c', 1, struct cfs_resize ) /* Resize CFS NameCache */
|
||||
#define CFSSTATS _IO('c', 2) /* Collect stats */
|
||||
#define CFSPRINT _IO('c', 3) /* Print Cache */
|
||||
#define CFSTEST _IO('c', 4) /* Print Cache */
|
||||
#else /* sys/ioctl.h puts the quotes on */
|
||||
#define CFSRESIZE _IOW(c, 1, struct cfs_resize ) /* Resize CFS NameCache */
|
||||
#define CFSSTATS _IO(c, 2) /* Collect stats */
|
||||
#define CFSPRINT _IO(c, 3) /* Print Cache */
|
||||
|
||||
#define CFSTEST _IO(c, 4) /* Print Cache */
|
||||
#endif __STDC__
|
||||
|
||||
|
||||
struct cfs_resize { int hashsize, heapsize; };
|
||||
|
||||
#endif !_CFSIO_H_
|
||||
#endif
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfsk.h,v 1.9 1998/08/18 17:05:23 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfsk.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/* Macros to manipulate the queue */
|
||||
#ifndef INIT_QUEUE
|
||||
@ -61,4 +63,4 @@ do { \
|
||||
(el).back->forw = (el).forw; \
|
||||
} while (0)
|
||||
|
||||
#endif INIT_QUEUE
|
||||
#endif
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfsnc.h,v 1.8 1998/08/28 18:12:25 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfsnc.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -45,6 +47,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfsnc.h,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.8 1998/08/28 18:12:25 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -270,4 +275,4 @@ struct cfsnc_statistics {
|
||||
#define CFSNC_PRINTCFSNC ((u_long) 12)
|
||||
#define CFSNC_PRINTSTATS ((u_long) 13)
|
||||
|
||||
#endif /* _CFSNC_HEADER_ */
|
||||
#endif
|
||||
|
105
sys/cfs/cnode.h
105
sys/cfs/cnode.h
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cnode.h,v 1.10 1998/08/28 18:12:25 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cnode.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -45,6 +47,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cnode.h,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.10 1998/08/28 18:12:25 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -144,45 +149,11 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
#define _CNODE_H_
|
||||
|
||||
#include <sys/vnode.h>
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
|
||||
/* for the prototype of DELAY() */
|
||||
#include <sys/lock.h>
|
||||
#include <machine/clock.h>
|
||||
|
||||
#ifdef __FreeBSD_version
|
||||
/* You would think that <sys/param.h> or something would include this */
|
||||
#include <sys/lock.h>
|
||||
|
||||
MALLOC_DECLARE(M_CFS);
|
||||
|
||||
#else
|
||||
|
||||
/* yuck yuck yuck */
|
||||
#define vref(x) cvref(x)
|
||||
extern void cvref(struct vnode *vp);
|
||||
/* yuck yuck yuck */
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__NetBSD__) && defined(NetBSD1_3) && (NetBSD1_3 >= 7)
|
||||
#define NEW_LOCKMGR(l, f, i) lockmgr(l, f, i)
|
||||
#define VOP_X_LOCK(vn, fl) vn_lock(vn, fl)
|
||||
#define VOP_X_UNLOCK(vn, fl) VOP_UNLOCK(vn, fl)
|
||||
|
||||
#elif defined(__FreeBSD_version)
|
||||
#define NEW_LOCKMGR(l, f, i) lockmgr(l, f, i, curproc)
|
||||
#define VOP_X_LOCK(vn, fl) vn_lock(vn, fl, curproc)
|
||||
#define VOP_X_UNLOCK(vn, fl) VOP_UNLOCK(vn, fl, curproc)
|
||||
|
||||
/* NetBSD 1.3 & FreeBSD 2.2.x */
|
||||
#else
|
||||
#undef NEW_LOCKMGR
|
||||
#define VOP_X_LOCK(vn, fl) VOP_LOCK(vn)
|
||||
#define VOP_X_UNLOCK(vn, fl) VOP_UNLOCK(vn)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* tmp below since we need struct queue
|
||||
*/
|
||||
@ -232,9 +203,7 @@ struct cnode {
|
||||
struct vnode *c_vnode;
|
||||
u_short c_flags; /* flags (see below) */
|
||||
ViceFid c_fid; /* file handle */
|
||||
#ifdef NEW_LOCKMGR
|
||||
struct lock c_lock; /* new lock protocol */
|
||||
#endif
|
||||
struct vnode *c_ovp; /* open vnode pointer */
|
||||
u_short c_ocount; /* count of openers */
|
||||
u_short c_owrite; /* count of open for write */
|
||||
@ -332,10 +301,6 @@ int cfs_vnodeopstats_init(void);
|
||||
/* cfs_vfsops.h */
|
||||
struct mount *devtomp(dev_t dev);
|
||||
|
||||
#if !(defined NetBSD1_3) && !defined(__FreeBSD_version)
|
||||
#define __RCSID(x) static char *rcsid = x
|
||||
#endif
|
||||
|
||||
/* sigh */
|
||||
#define CFS_RDWR ((u_long) 31)
|
||||
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/coda.h,v 1.10 1998/08/28 18:12:26 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/coda.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
@ -38,8 +40,6 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
#ifndef _CFS_HEADER_
|
||||
#define _CFS_HEADER_
|
||||
|
||||
|
||||
|
||||
/* Catch new _KERNEL defn for NetBSD */
|
||||
#ifdef __NetBSD__
|
||||
#include <sys/types.h>
|
||||
|
@ -1,34 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/coda_opstats.h,v 1.5 1998/08/18 17:05:25 rvb Exp $ */
|
||||
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/coda_opstats.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* operation stats: what the minicache can intercept that
|
||||
@ -102,12 +103,10 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
#define CFS_READDIR_STATS 19
|
||||
#define CFS_VNODEOPS_SIZE 20
|
||||
|
||||
|
||||
/*
|
||||
* I propose the following structres:
|
||||
*/
|
||||
|
||||
|
||||
struct cfs_op_stats {
|
||||
int opcode; /* vfs opcode */
|
||||
long entries; /* number of times call attempted */
|
||||
@ -118,7 +117,6 @@ struct cfs_op_stats {
|
||||
/* (do we need that?) */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* With each call to the minicache, we'll bump the counters whenver
|
||||
* a call is satisfied internally (through the cache or through a
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/pioctl.h,v 1.7 1998/08/28 18:12:26 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/pioctl.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -41,6 +43,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: pioctl.h,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.7 1998/08/28 18:12:26 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -108,11 +113,8 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
are no input or output parameters
|
||||
*/
|
||||
|
||||
#ifdef __STDC__
|
||||
#define _VICEIOCTL(id) ((unsigned int ) _IOW('V', id, struct ViceIoctl))
|
||||
#else
|
||||
#define _VICEIOCTL(id) ((unsigned int ) _IOW(V, id, struct ViceIoctl))
|
||||
#endif
|
||||
|
||||
/* Use this macro to define up to 256 vice ioctl's. These ioctl's
|
||||
all potentially have in/out parameters--this depends upon the
|
||||
values in the ViceIoctl structure. This structure is itself passed
|
||||
@ -121,4 +123,4 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
|
||||
#define _VALIDVICEIOCTL(com) (com >= _VICEIOCTL(0) && com <= _VICEIOCTL(255))
|
||||
|
||||
#endif _SYS_PIOCTL_H_
|
||||
#endif
|
||||
|
@ -1,8 +1,3 @@
|
||||
NOTE: Please do not edit any files in this directory
|
||||
until this NOTE is removed.
|
||||
In the next week, I want to clear out all the
|
||||
platform and release #ifdefs from the code.
|
||||
|
||||
NOTE: The matching user level code has not been released
|
||||
yet. It will be available soon. The existing released
|
||||
Coda code is not quite ready for current. We'll
|
||||
@ -14,8 +9,8 @@ BUG: There is a bug in file mapping/executing. When a file is
|
||||
you can run the file just fine. I haven't had time to look
|
||||
for this problem yet.
|
||||
|
||||
|
||||
WARNING:A version of this code has run on stable for a while now.
|
||||
WARNING:
|
||||
A version of this code has run on stable for a while now.
|
||||
The code has been recently ported to current. It is mostly
|
||||
working, but hasn't been run long enough to be sure all the
|
||||
bugs are sorted out. Let me know if there are any problems.
|
||||
|
@ -15,8 +15,8 @@ to experiment with.
|
||||
|
||||
To get more information on Coda, I would like to refer people to
|
||||
http://www.coda.cs.cmu.edu
|
||||
There is a wealth of documents, papers, theses there. There is also a
|
||||
good introduction to the Coda File System in
|
||||
There is a wealth of documents, papers, and theses there. There is
|
||||
also a good introduction to the Coda File System in
|
||||
http://www.coda.cs.cmu.edu/ljpaper/lj.html
|
||||
|
||||
Coda was originally developed as an academic prototype/testbed. It is
|
||||
@ -45,11 +45,11 @@ The relevant sources, binaries, and docs can be found in
|
||||
ftp://ftp.coda.cs.cmu.edu/pub/coda/
|
||||
|
||||
We intend to come out with new Coda releases often, not daily. We
|
||||
don't wish to slight any OS/platform not mentioned above. We are just
|
||||
don't want to slight any OS/platform not mentioned above. We are just
|
||||
limited in our resources as to what we can support internally. We
|
||||
will be happy to integrate OpenBSD support as well as other OS
|
||||
support. Also, adding platform support is relatively easy and we can
|
||||
discuss this. The only problem is that Coda has a light weight
|
||||
support. Also, adding platform support should be relatively easy and
|
||||
we can discuss this. The only difficulty is that Coda has a light weight
|
||||
process package. It does some manipulations in assembler which would
|
||||
have to be redone for a different platform.
|
||||
|
||||
|
@ -1,12 +1,17 @@
|
||||
OOPS:
|
||||
FreeBSD does not fsync!!!
|
||||
|
||||
Near term:
|
||||
Existing VOP_LOCKS's should proabably be
|
||||
vn_lock since that is what they were in -stable.
|
||||
Fix bug in executing/mapping new files.
|
||||
cfs_mount bug: interaction with cfs_inactive no cfs_unsave.
|
||||
vref/vn_lock == vget except no VXWANT which may be on.
|
||||
Review locks: vn_lock/VOP_UNLOCK/lockmgr ...
|
||||
|
||||
Medium term:
|
||||
Add missing VFS methods.
|
||||
Do performance profile.
|
||||
Tune hash algorithm used in cfs_namecache.
|
||||
Tune hash algorithm used in cfs_subr.
|
||||
|
||||
Eventually:
|
||||
Use standard queue macros.
|
||||
|
105
sys/coda/cnode.h
105
sys/coda/cnode.h
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cnode.h,v 1.10 1998/08/28 18:12:25 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cnode.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -45,6 +47,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cnode.h,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.10 1998/08/28 18:12:25 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -144,45 +149,11 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
#define _CNODE_H_
|
||||
|
||||
#include <sys/vnode.h>
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
|
||||
/* for the prototype of DELAY() */
|
||||
#include <sys/lock.h>
|
||||
#include <machine/clock.h>
|
||||
|
||||
#ifdef __FreeBSD_version
|
||||
/* You would think that <sys/param.h> or something would include this */
|
||||
#include <sys/lock.h>
|
||||
|
||||
MALLOC_DECLARE(M_CFS);
|
||||
|
||||
#else
|
||||
|
||||
/* yuck yuck yuck */
|
||||
#define vref(x) cvref(x)
|
||||
extern void cvref(struct vnode *vp);
|
||||
/* yuck yuck yuck */
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__NetBSD__) && defined(NetBSD1_3) && (NetBSD1_3 >= 7)
|
||||
#define NEW_LOCKMGR(l, f, i) lockmgr(l, f, i)
|
||||
#define VOP_X_LOCK(vn, fl) vn_lock(vn, fl)
|
||||
#define VOP_X_UNLOCK(vn, fl) VOP_UNLOCK(vn, fl)
|
||||
|
||||
#elif defined(__FreeBSD_version)
|
||||
#define NEW_LOCKMGR(l, f, i) lockmgr(l, f, i, curproc)
|
||||
#define VOP_X_LOCK(vn, fl) vn_lock(vn, fl, curproc)
|
||||
#define VOP_X_UNLOCK(vn, fl) VOP_UNLOCK(vn, fl, curproc)
|
||||
|
||||
/* NetBSD 1.3 & FreeBSD 2.2.x */
|
||||
#else
|
||||
#undef NEW_LOCKMGR
|
||||
#define VOP_X_LOCK(vn, fl) VOP_LOCK(vn)
|
||||
#define VOP_X_UNLOCK(vn, fl) VOP_UNLOCK(vn)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* tmp below since we need struct queue
|
||||
*/
|
||||
@ -232,9 +203,7 @@ struct cnode {
|
||||
struct vnode *c_vnode;
|
||||
u_short c_flags; /* flags (see below) */
|
||||
ViceFid c_fid; /* file handle */
|
||||
#ifdef NEW_LOCKMGR
|
||||
struct lock c_lock; /* new lock protocol */
|
||||
#endif
|
||||
struct vnode *c_ovp; /* open vnode pointer */
|
||||
u_short c_ocount; /* count of openers */
|
||||
u_short c_owrite; /* count of open for write */
|
||||
@ -332,10 +301,6 @@ int cfs_vnodeopstats_init(void);
|
||||
/* cfs_vfsops.h */
|
||||
struct mount *devtomp(dev_t dev);
|
||||
|
||||
#if !(defined NetBSD1_3) && !defined(__FreeBSD_version)
|
||||
#define __RCSID(x) static char *rcsid = x
|
||||
#endif
|
||||
|
||||
/* sigh */
|
||||
#define CFS_RDWR ((u_long) 31)
|
||||
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/coda.h,v 1.10 1998/08/28 18:12:26 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/coda.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
@ -38,8 +40,6 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
#ifndef _CFS_HEADER_
|
||||
#define _CFS_HEADER_
|
||||
|
||||
|
||||
|
||||
/* Catch new _KERNEL defn for NetBSD */
|
||||
#ifdef __NetBSD__
|
||||
#include <sys/types.h>
|
||||
|
@ -1,53 +1,56 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_fbsd.c,v 1.6 1998/08/28 18:12:11 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_fbsd.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/ucred.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/conf.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vnode_pager.h>
|
||||
|
||||
#include <cfs/coda.h>
|
||||
#include <cfs/cnode.h>
|
||||
#include <cfs/cfs_vnodeops.h>
|
||||
|
||||
#ifdef DEVFS
|
||||
#include <sys/devfsext.h>
|
||||
#endif
|
||||
#include <sys/conf.h>
|
||||
|
||||
#include <sys/vnode.h>
|
||||
#include <cfs/coda.h>
|
||||
#include <cfs/cnode.h>
|
||||
#include <cfs/cfs_vnodeops.h>
|
||||
|
||||
/*
|
||||
From: "Jordan K. Hubbard" <jkh@time.cdrom.com>
|
||||
@ -63,7 +66,6 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
|
||||
#define VC_DEV_NO 93
|
||||
|
||||
#ifdef __FreeBSD_version
|
||||
/* Type of device methods. */
|
||||
extern d_open_t vc_nb_open;
|
||||
extern d_close_t vc_nb_close;
|
||||
@ -76,33 +78,8 @@ static struct cdevsw vccdevsw =
|
||||
{
|
||||
vc_nb_open, vc_nb_close, vc_nb_read, vc_nb_write, /*93*/
|
||||
vc_nb_ioctl, nostop, nullreset, nodevtotty,
|
||||
vc_nb_poll, nommap, NULL, "Coda", NULL, -1 };
|
||||
#else
|
||||
/* Type of device methods. */
|
||||
#define D_OPEN_T d_open_t
|
||||
#define D_CLOSE_T d_close_t
|
||||
#define D_RDWR_T d_rdwr_t
|
||||
#define D_READ_T d_read_t
|
||||
#define D_WRITE_T d_write_t
|
||||
#define D_IOCTL_T d_ioctl_t
|
||||
#define D_SELECT_T d_select_t
|
||||
|
||||
/* rvb why */
|
||||
D_OPEN_T vc_nb_open; /* was is defined in cfs_FreeBSD.h */
|
||||
D_CLOSE_T vc_nb_close;
|
||||
D_READ_T vc_nb_read;
|
||||
D_WRITE_T vc_nb_write;
|
||||
D_IOCTL_T vc_nb_ioctl;
|
||||
D_SELECT_T vc_nb_select;
|
||||
|
||||
static struct cdevsw vccdevsw =
|
||||
{
|
||||
vc_nb_open, vc_nb_close, vc_nb_read, vc_nb_write,
|
||||
vc_nb_ioctl, nostop, nullreset, nodevtotty,
|
||||
vc_nb_select, nommap, NULL, "Coda", NULL, -1 };
|
||||
|
||||
PSEUDO_SET(vcattach, vc);
|
||||
#endif
|
||||
vc_nb_poll, nommap, NULL, "Coda", NULL, -1
|
||||
};
|
||||
|
||||
void vcattach __P((void));
|
||||
static dev_t vccdev;
|
||||
@ -125,21 +102,9 @@ vcattach(void)
|
||||
VCDEBUG("cfs: vccdevsw entry installed at %d.\n", major(vccdev));
|
||||
}
|
||||
|
||||
void
|
||||
cvref(vp)
|
||||
struct vnode *vp;
|
||||
{
|
||||
if (vp->v_usecount <= 0)
|
||||
panic("vref used where vget required");
|
||||
|
||||
vp->v_usecount++;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __FreeBSD_version
|
||||
static vc_devsw_installed = 0;
|
||||
|
||||
static void vc_drvinit __P((void *unused));
|
||||
|
||||
static void
|
||||
vc_drvinit(void *unused)
|
||||
{
|
||||
@ -238,4 +203,3 @@ cfs_fbsd_putpages(v)
|
||||
|
||||
|
||||
SYSINIT(vccdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+VC_DEV_NO,vc_drvinit,NULL)
|
||||
#endif
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfsio.h,v 1.5 1998/08/18 17:05:23 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfsio.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -45,6 +47,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfsio.h,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.5 1998/08/18 17:05:23 rvb
|
||||
* Don't use __RCSID now
|
||||
*
|
||||
@ -106,20 +111,11 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
|
||||
/* Define ioctl commands for vcioctl, /dev/cfs */
|
||||
|
||||
#ifdef __STDC__
|
||||
#define CFSRESIZE _IOW('c', 1, struct cfs_resize ) /* Resize CFS NameCache */
|
||||
#define CFSSTATS _IO('c', 2) /* Collect stats */
|
||||
#define CFSPRINT _IO('c', 3) /* Print Cache */
|
||||
#define CFSTEST _IO('c', 4) /* Print Cache */
|
||||
#else /* sys/ioctl.h puts the quotes on */
|
||||
#define CFSRESIZE _IOW(c, 1, struct cfs_resize ) /* Resize CFS NameCache */
|
||||
#define CFSSTATS _IO(c, 2) /* Collect stats */
|
||||
#define CFSPRINT _IO(c, 3) /* Print Cache */
|
||||
|
||||
#define CFSTEST _IO(c, 4) /* Print Cache */
|
||||
#endif __STDC__
|
||||
|
||||
|
||||
struct cfs_resize { int hashsize, heapsize; };
|
||||
|
||||
#endif !_CFSIO_H_
|
||||
#endif
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfsk.h,v 1.9 1998/08/18 17:05:23 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfsk.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/* Macros to manipulate the queue */
|
||||
#ifndef INIT_QUEUE
|
||||
@ -61,4 +63,4 @@ do { \
|
||||
(el).back->forw = (el).forw; \
|
||||
} while (0)
|
||||
|
||||
#endif INIT_QUEUE
|
||||
#endif
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_namecache.c,v 1.11 1998/08/28 18:12:16 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_namecache.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -45,6 +47,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfs_namecache.c,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.11 1998/08/28 18:12:16 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -206,32 +211,25 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
#include <sys/param.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/ucred.h>
|
||||
#include <sys/select.h>
|
||||
|
||||
#ifndef insque
|
||||
#include <sys/systm.h>
|
||||
#endif /* insque */
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vm_object.h>
|
||||
|
||||
#include <cfs/coda.h>
|
||||
#include <cfs/cnode.h>
|
||||
#include <cfs/cfsnc.h>
|
||||
|
||||
#if defined(__NetBSD__) || defined(__FreeBSD__)
|
||||
#ifndef insque
|
||||
#include <sys/systm.h>
|
||||
#endif /* insque */
|
||||
#endif /* __NetBSD__ || defined(__FreeBSD__) */
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vm_object.h>
|
||||
#ifdef __FreeBSD_version
|
||||
#include <sys/ucred.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Declaration of the name cache data structure.
|
||||
*/
|
||||
|
||||
int cfsnc_use = 1; /* Indicate use of CFS Name Cache */
|
||||
|
||||
int cfsnc_size = CFSNC_CACHESIZE; /* size of the cache */
|
||||
int cfsnc_hashsize = CFSNC_HASHSIZE; /* size of the primary hash */
|
||||
|
||||
@ -246,16 +244,12 @@ struct cfsnc_statistics cfsnc_stat; /* Keep various stats */
|
||||
*/
|
||||
int cfsnc_debug = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Entry points for the CFS Name Cache
|
||||
*/
|
||||
static struct cfscache *
|
||||
cfsnc_find(struct cnode *dcp, const char *name, int namelen,
|
||||
static struct cfscache *cfsnc_find(struct cnode *dcp, const char *name, int namelen,
|
||||
struct ucred *cred, int hash);
|
||||
static void
|
||||
cfsnc_remove(struct cfscache *cncp, enum dc_status dcstat);
|
||||
|
||||
static void cfsnc_remove(struct cfscache *cncp, enum dc_status dcstat);
|
||||
|
||||
/*
|
||||
* Initialize the cache, the LRU structure and the Hash structure(s)
|
||||
@ -657,7 +651,7 @@ cfsnc_zapfile(dcp, name, namelen)
|
||||
|
||||
while (cncp) {
|
||||
cfsnchash[hash].length--; /* Used for tuning */
|
||||
/* 1.3 */
|
||||
|
||||
cfsnc_remove(cncp, NOT_DOWNCALL);
|
||||
cncp = cfsnc_find(dcp, name, namelen, 0, hash);
|
||||
}
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfsnc.h,v 1.8 1998/08/28 18:12:25 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfsnc.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -45,6 +47,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfsnc.h,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.8 1998/08/28 18:12:25 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -270,4 +275,4 @@ struct cfsnc_statistics {
|
||||
#define CFSNC_PRINTCFSNC ((u_long) 12)
|
||||
#define CFSNC_PRINTSTATS ((u_long) 13)
|
||||
|
||||
#endif /* _CFSNC_HEADER_ */
|
||||
#endif
|
||||
|
@ -1,136 +0,0 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_nbsd.c,v 1.21 1998/08/28 18:12:17 rvb Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
* Copyright (c) 1990 Carnegie-Mellon University
|
||||
* Copyright (c) 1989 Carnegie-Mellon University
|
||||
* All rights reserved. The CMU software License Agreement specifies
|
||||
* the terms and conditions for use and redistribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This code was written for the Coda file system at Carnegie Mellon
|
||||
* University. Contributers include David Steere, James Kistler,
|
||||
* M. Satyanarayanan, and Brian Noble.
|
||||
*/
|
||||
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfs_nbsd.c,v $
|
||||
* Revision 1.21 1998/08/28 18:12:17 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
* trees. It will then be tailored to the particular platform
|
||||
* by flushing conditional code.
|
||||
*
|
||||
* Revision 1.20 1998/08/18 17:05:15 rvb
|
||||
* Don't use __RCSID now
|
||||
*
|
||||
* Revision 1.19 1998/08/18 16:31:40 rvb
|
||||
* Sync the code for NetBSD -current; test on 1.3 later
|
||||
*
|
||||
* Revision 1.18 98/01/23 11:53:40 rvb
|
||||
* Bring RVB_CFS1_1 to HEAD
|
||||
*
|
||||
* Revision 1.17.2.1 97/12/09 16:07:11 rvb
|
||||
* Sync with vfs/include/coda.h
|
||||
*
|
||||
* Revision 1.17 97/12/05 10:39:15 rvb
|
||||
* Read CHANGES
|
||||
*
|
||||
* Revision 1.16.6.5 97/11/20 11:46:39 rvb
|
||||
* Capture current cfs_venus
|
||||
*
|
||||
* Revision 1.16.6.4 97/11/18 10:27:14 rvb
|
||||
* cfs_nbsd.c is DEAD!!!; integrated into cfs_vf/vnops.c
|
||||
* cfs_nb_foo and cfs_foo are joined
|
||||
*
|
||||
* Revision 1.16.6.3 97/11/13 22:02:58 rvb
|
||||
* pass2 cfs_NetBSD.h mt
|
||||
*
|
||||
* Revision 1.16.6.2 97/11/12 12:09:37 rvb
|
||||
* reorg pass1
|
||||
*
|
||||
* Revision 1.16.6.1 97/10/28 23:10:14 rvb
|
||||
* >64Meg; venus can be killed!
|
||||
*
|
||||
* Revision 1.16 97/07/18 15:28:41 rvb
|
||||
* Bigger/Better/Faster than AFS
|
||||
*
|
||||
* Revision 1.15 1997/02/19 18:41:39 bnoble
|
||||
* Didn't sufficiently unswap the now-unswapped dvp and vp in cfs_nb_link
|
||||
*
|
||||
* Revision 1.13 1997/02/18 23:46:25 bnoble
|
||||
* NetBSD swapped the order of arguments to VOP_LINK between 1.1 and 1.2.
|
||||
* This tracks that change.
|
||||
*
|
||||
* Revision 1.12 1997/02/18 22:23:38 bnoble
|
||||
* Rename lockdebug to cfs_lockdebug
|
||||
*
|
||||
* Revision 1.11 1997/02/13 18:46:14 rvb
|
||||
* Name CODA FS for df
|
||||
*
|
||||
* Revision 1.10 1997/02/12 15:32:05 rvb
|
||||
* Make statfs return values like for AFS
|
||||
*
|
||||
* Revision 1.9 1997/01/30 16:42:02 bnoble
|
||||
* Trace version as of SIGCOMM submission. Minor fix in cfs_nb_open
|
||||
*
|
||||
* Revision 1.8 1997/01/13 17:11:05 bnoble
|
||||
* Coda statfs needs to return something other than -1 for blocks avail. and
|
||||
* files available for wabi (and other windowsish) programs to install
|
||||
* there correctly.
|
||||
*
|
||||
* Revision 1.6 1996/12/05 16:20:14 bnoble
|
||||
* Minor debugging aids
|
||||
*
|
||||
* Revision 1.5 1996/11/25 18:25:11 bnoble
|
||||
* Added a diagnostic check for cfs_nb_lock
|
||||
*
|
||||
* Revision 1.4 1996/11/13 04:14:19 bnoble
|
||||
* Merging BNOBLE_WORK_6_20_96 into main line
|
||||
*
|
||||
*
|
||||
* Revision 1.3 1996/11/08 18:06:11 bnoble
|
||||
* Minor changes in vnode operation signature, VOP_UPDATE signature, and
|
||||
* some newly defined bits in the include files.
|
||||
*
|
||||
* Revision 1.2.8.1 1996/06/26 16:28:26 bnoble
|
||||
* Minor bug fixes
|
||||
*
|
||||
* Revision 1.2 1996/01/02 16:56:52 bnoble
|
||||
* Added support for Coda MiniCache and raw inode calls (final commit)
|
||||
*
|
||||
* Revision 1.1.2.1 1995/12/20 01:57:17 bnoble
|
||||
* Added CFS-specific files
|
||||
*
|
||||
*/
|
@ -1,34 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/coda_opstats.h,v 1.5 1998/08/18 17:05:25 rvb Exp $ */
|
||||
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/coda_opstats.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* operation stats: what the minicache can intercept that
|
||||
@ -102,12 +103,10 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
#define CFS_READDIR_STATS 19
|
||||
#define CFS_VNODEOPS_SIZE 20
|
||||
|
||||
|
||||
/*
|
||||
* I propose the following structres:
|
||||
*/
|
||||
|
||||
|
||||
struct cfs_op_stats {
|
||||
int opcode; /* vfs opcode */
|
||||
long entries; /* number of times call attempted */
|
||||
@ -118,7 +117,6 @@ struct cfs_op_stats {
|
||||
/* (do we need that?) */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* With each call to the minicache, we'll bump the counters whenver
|
||||
* a call is satisfied internally (through the cache or through a
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/pioctl.h,v 1.7 1998/08/28 18:12:26 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/pioctl.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -41,6 +43,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: pioctl.h,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.7 1998/08/28 18:12:26 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -108,11 +113,8 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
are no input or output parameters
|
||||
*/
|
||||
|
||||
#ifdef __STDC__
|
||||
#define _VICEIOCTL(id) ((unsigned int ) _IOW('V', id, struct ViceIoctl))
|
||||
#else
|
||||
#define _VICEIOCTL(id) ((unsigned int ) _IOW(V, id, struct ViceIoctl))
|
||||
#endif
|
||||
|
||||
/* Use this macro to define up to 256 vice ioctl's. These ioctl's
|
||||
all potentially have in/out parameters--this depends upon the
|
||||
values in the ViceIoctl structure. This structure is itself passed
|
||||
@ -121,4 +123,4 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
|
||||
#define _VALIDVICEIOCTL(com) (com >= _VICEIOCTL(0) && com <= _VICEIOCTL(255))
|
||||
|
||||
#endif _SYS_PIOCTL_H_
|
||||
#endif
|
||||
|
@ -1,35 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_psdev.c,v 1.9 1998/08/28 18:12:17 rvb Exp $ */
|
||||
|
||||
#define CTL_C
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_psdev.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -43,20 +43,19 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
* University. Contributers include David Steere, James Kistler, and
|
||||
* M. Satyanarayanan. */
|
||||
|
||||
/* ************************************************** */
|
||||
/* These routines define the psuedo device for communication between
|
||||
/*
|
||||
* These routines define the psuedo device for communication between
|
||||
* Coda's Venus and Minicache in Mach 2.6. They used to be in cfs_subr.c,
|
||||
* but I moved them to make it easier to port the Minicache without
|
||||
* porting coda. -- DCS 10/12/94
|
||||
*/
|
||||
|
||||
/*
|
||||
* Renamed to cfs_psdev: pseudo-device driver.
|
||||
*/
|
||||
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfs_psdev.c,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.9 1998/08/28 18:12:17 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -153,40 +152,28 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
extern int cfsnc_initialized; /* Set if cache has been initialized */
|
||||
|
||||
#include <vcfs.h>
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/file.h>
|
||||
#ifdef __FreeBSD_version
|
||||
#include <sys/ioccom.h>
|
||||
#else
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef NetBSD1_3
|
||||
#include <sys/poll.h>
|
||||
#endif
|
||||
#ifdef __FreeBSD_version
|
||||
#include <sys/poll.h>
|
||||
#else
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
#include <sys/conf.h>
|
||||
|
||||
#include <cfs/coda.h>
|
||||
#include <cfs/cnode.h>
|
||||
#include <cfs/cfsnc.h>
|
||||
#include <cfs/cfsio.h>
|
||||
|
||||
#define CTL_C
|
||||
|
||||
int cfs_psdev_print_entry = 0;
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define ENTRY \
|
||||
if(cfs_psdev_print_entry) myprintf(("Entered %s\n",__FUNCTION__))
|
||||
#else
|
||||
#define ENTRY
|
||||
#endif
|
||||
#define ENTRY if(cfs_psdev_print_entry) myprintf(("Entered %s\n",__FUNCTION__))
|
||||
|
||||
void vcfsattach(int n);
|
||||
int vc_nb_open(dev_t dev, int flag, int mode, struct proc *p);
|
||||
@ -194,11 +181,7 @@ int vc_nb_close (dev_t dev, int flag, int mode, struct proc *p);
|
||||
int vc_nb_read(dev_t dev, struct uio *uiop, int flag);
|
||||
int vc_nb_write(dev_t dev, struct uio *uiop, int flag);
|
||||
int vc_nb_ioctl(dev_t dev, int cmd, caddr_t addr, int flag, struct proc *p);
|
||||
#if defined(NetBSD1_3) || defined(__FreeBSD_version)
|
||||
int vc_nb_poll(dev_t dev, int events, struct proc *p);
|
||||
#else
|
||||
int vc_nb_select(dev_t dev, int flag, struct proc *p);
|
||||
#endif
|
||||
|
||||
struct vmsg {
|
||||
struct queue vm_chain;
|
||||
@ -222,9 +205,6 @@ vcfsattach(n)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* These functions are written for NetBSD.
|
||||
*/
|
||||
int
|
||||
vc_nb_open(dev, flag, mode, p)
|
||||
dev_t dev;
|
||||
@ -289,14 +269,6 @@ vc_nb_close (dev, flag, mode, p)
|
||||
if (mi->mi_rootvp) {
|
||||
/* Let unmount know this is for real */
|
||||
VTOC(mi->mi_rootvp)->c_flags |= C_UNMOUNTING;
|
||||
#ifdef NEW_LOCKMGR
|
||||
#ifdef __FreeBSD_version
|
||||
/* dounmount is different ... probably wrong ... */
|
||||
#else
|
||||
if (vfs_busy(mi->mi_vfsp, 0, 0))
|
||||
return (EBUSY);
|
||||
#endif
|
||||
#endif
|
||||
cfs_unmounting(mi->mi_vfsp);
|
||||
err = dounmount(mi->mi_vfsp, flag, p);
|
||||
if (err)
|
||||
@ -523,7 +495,6 @@ vc_nb_ioctl(dev, cmd, addr, flag, p)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NetBSD1_3) || defined(__FreeBSD_version)
|
||||
int
|
||||
vc_nb_poll(dev, events, p)
|
||||
dev_t dev;
|
||||
@ -551,33 +522,6 @@ vc_nb_poll(dev, events, p)
|
||||
|
||||
return(0);
|
||||
}
|
||||
#else
|
||||
int
|
||||
vc_nb_select(dev, flag, p)
|
||||
dev_t dev;
|
||||
int flag;
|
||||
struct proc *p;
|
||||
{
|
||||
register struct vcomm *vcp;
|
||||
|
||||
ENTRY;
|
||||
|
||||
if (minor(dev) >= NVCFS || minor(dev) < 0)
|
||||
return(ENXIO);
|
||||
|
||||
vcp = &cfs_mnttbl[minor(dev)].mi_vcomm;
|
||||
|
||||
if (flag != FREAD)
|
||||
return(0);
|
||||
|
||||
if (!EMPTY(vcp->vc_requests))
|
||||
return(1);
|
||||
|
||||
selrecord(p, &(vcp->vc_selproc));
|
||||
|
||||
return(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Statistics
|
||||
@ -593,7 +537,6 @@ struct cfs_clstat cfs_clstat;
|
||||
* (e.g. kill -9).
|
||||
*/
|
||||
|
||||
/* If you want this to be interruptible, set this to > PZERO */
|
||||
int cfscall_sleep = PZERO - 1;
|
||||
#ifdef CTL_C
|
||||
int cfs_pcatch = PCATCH;
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_subr.c,v 1.11 1998/08/28 18:12:18 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_subr.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -44,6 +46,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfs_subr.c,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.11 1998/08/28 18:12:18 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -202,8 +207,8 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/mount.h>
|
||||
|
||||
@ -212,8 +217,6 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
#include <cfs/cfs_subr.h>
|
||||
#include <cfs/cfsnc.h>
|
||||
|
||||
#if NVCFS
|
||||
|
||||
int cfs_active = 0;
|
||||
int cfs_reuse = 0;
|
||||
int cfs_new = 0;
|
||||
@ -221,11 +224,8 @@ int cfs_new = 0;
|
||||
struct cnode *cfs_freelist = NULL;
|
||||
struct cnode *cfs_cache[CFS_CACHESIZE];
|
||||
|
||||
#define cfshash(fid) \
|
||||
(((fid)->Volume + (fid)->Vnode) & (CFS_CACHESIZE-1))
|
||||
|
||||
#define cfshash(fid) (((fid)->Volume + (fid)->Vnode) & (CFS_CACHESIZE-1))
|
||||
#define CNODE_NEXT(cp) ((cp)->c_next)
|
||||
|
||||
#define ODD(vnode) ((vnode) & 0x1)
|
||||
|
||||
/*
|
||||
@ -690,24 +690,13 @@ int
|
||||
cfs_vmflush(cp)
|
||||
struct cnode *cp;
|
||||
{
|
||||
#if 0
|
||||
/* old code */
|
||||
/* Unset <device, inode> so that page_read doesn't try to use
|
||||
(possibly) invalid cache file. */
|
||||
cp->c_device = 0;
|
||||
cp->c_inode = 0;
|
||||
|
||||
return(inode_uncache_try(VTOI(CTOV(cp))) ? 0 : ETXTBSY);
|
||||
#else /* __NetBSD__ || __FreeBSD__ */
|
||||
return 0;
|
||||
#endif /* __NetBSD__ || __FreeBSD__ */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* kernel-internal debugging switches
|
||||
*/
|
||||
|
||||
void cfs_debugon(void)
|
||||
{
|
||||
cfsdebug = -1;
|
||||
@ -745,6 +734,3 @@ void cfs_debugoff(void)
|
||||
* 13) all <= 3
|
||||
* ...
|
||||
*/
|
||||
|
||||
|
||||
#endif /* NVCFS */
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_subr.h,v 1.4 1998/08/18 17:05:16 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_subr.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
struct cnode *cfs_alloc(void);
|
||||
void cfs_free(struct cnode *cp);
|
||||
@ -41,5 +43,3 @@ void cfs_debugoff(void);
|
||||
int cfs_kill(struct mount *whoIam, enum dc_status dcstat);
|
||||
void cfs_save(struct cnode *cp);
|
||||
void cfs_unsave(struct cnode *cp);
|
||||
|
||||
|
||||
|
@ -1,45 +1,42 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_venus.c,v 1.11 1998/08/28 18:12:20 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_venus.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/select.h>
|
||||
#ifdef __FreeBSD_version
|
||||
#include <sys/ioccom.h>
|
||||
#else
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
/* for CNV_OFLAGS below */
|
||||
#include <sys/fcntl.h>
|
||||
|
||||
#include <cfs/coda.h>
|
||||
@ -342,11 +339,11 @@ venus_access(void *mdp, ViceFid *fid, int mode,
|
||||
/* send the open to venus. */
|
||||
INIT_IN(&inp->ih, CFS_ACCESS, cred, p);
|
||||
inp->VFid = *fid;
|
||||
#ifdef NetBSD1_3
|
||||
inp->flags = mode;
|
||||
#else
|
||||
/* NOTE:
|
||||
* NetBSD and Venus internals use the "data" in the low 3 bits.
|
||||
* Hence, the conversion.
|
||||
*/
|
||||
inp->flags = mode>>6;
|
||||
#endif
|
||||
|
||||
error = cfscall(mdp, Isize, &Osize, (char *)inp);
|
||||
|
||||
@ -437,11 +434,7 @@ venus_create(void *mdp, ViceFid *fid,
|
||||
INIT_IN(&inp->ih, CFS_CREATE, cred, p);
|
||||
inp->VFid = *fid;
|
||||
inp->excl = exclusive ? C_O_EXCL : 0;
|
||||
#ifdef NetBSD1_3
|
||||
inp->mode = mode<<6;
|
||||
#else
|
||||
inp->mode = mode;
|
||||
#endif
|
||||
CNV_V2VV_ATTR(&inp->attr, va);
|
||||
|
||||
inp->name = Isize;
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_venus.h,v 1.4 1998/08/18 17:05:18 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_venus.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
int
|
||||
venus_root(void *mdp,
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_vfsops.c,v 1.11 1998/08/28 18:12:22 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_vfsops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -45,6 +47,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfs_vfsops.c,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.11 1998/08/28 18:12:22 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -173,11 +178,12 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/select.h>
|
||||
|
||||
#include <cfs/coda.h>
|
||||
@ -186,25 +192,14 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
#include <cfs/cfs_venus.h>
|
||||
#include <cfs/cfs_subr.h>
|
||||
#include <cfs/coda_opstats.h>
|
||||
/* for VN_RDEV */
|
||||
|
||||
#include <miscfs/specfs/specdev.h>
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#ifdef __FreeBSD_version
|
||||
MALLOC_DEFINE(M_CFS, "CFS storage", "Various Coda Structures");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int cfsdebug = 0;
|
||||
|
||||
int cfs_vfsop_print_entry = 0;
|
||||
#ifdef __GNUC__
|
||||
#define ENTRY \
|
||||
if(cfs_vfsop_print_entry) myprintf(("Entered %s\n",__FUNCTION__))
|
||||
#else
|
||||
#define ENTRY
|
||||
#endif
|
||||
|
||||
#define ENTRY if(cfs_vfsop_print_entry) myprintf(("Entered %s\n",__FUNCTION__))
|
||||
|
||||
struct vnode *cfs_ctlvp;
|
||||
struct cfs_mntinfo cfs_mnttbl[NVCFS]; /* indexed by minor device number */
|
||||
@ -220,65 +215,7 @@ struct cfs_op_stats cfs_vfsopstats[CFS_VFSOPS_SIZE];
|
||||
|
||||
extern int cfsnc_initialized; /* Set if cache has been initialized */
|
||||
extern int vc_nb_open __P((dev_t, int, int, struct proc *));
|
||||
#ifdef __NetBSD__
|
||||
extern struct cdevsw cdevsw[]; /* For sanity check in cfs_mount */
|
||||
#endif
|
||||
/* NetBSD interface to statfs */
|
||||
|
||||
#if defined(__NetBSD__) && defined(NetBSD1_3) && (NetBSD1_3 >= 5)
|
||||
extern struct vnodeopv_desc cfs_vnodeop_opv_desc;
|
||||
|
||||
struct vnodeopv_desc *cfs_vnodeopv_descs[] = {
|
||||
&cfs_vnodeop_opv_desc,
|
||||
NULL,
|
||||
};
|
||||
|
||||
struct vfsops cfs_vfsops = {
|
||||
MOUNT_CFS,
|
||||
cfs_mount,
|
||||
cfs_start,
|
||||
cfs_unmount,
|
||||
cfs_root,
|
||||
cfs_quotactl,
|
||||
cfs_nb_statfs,
|
||||
cfs_sync,
|
||||
cfs_vget,
|
||||
(int (*) (struct mount *, struct fid *, struct mbuf *, struct vnode **,
|
||||
int *, struct ucred **))
|
||||
eopnotsupp,
|
||||
(int (*) (struct vnode *, struct fid *)) eopnotsupp,
|
||||
cfs_init,
|
||||
#if (NetBSD1_3 >= 7)
|
||||
cfs_sysctl,
|
||||
#endif
|
||||
(int (*)(void)) eopnotsupp,
|
||||
cfs_vnodeopv_descs,
|
||||
0
|
||||
};
|
||||
#elif defined(__NetBSD__)
|
||||
struct vfsops cfs_vfsops = {
|
||||
MOUNT_CFS,
|
||||
cfs_mount,
|
||||
cfs_start,
|
||||
cfs_unmount,
|
||||
cfs_root,
|
||||
cfs_quotactl,
|
||||
cfs_nb_statfs,
|
||||
cfs_sync,
|
||||
cfs_vget,
|
||||
(int (*) (struct mount *, struct fid *, struct mbuf *, struct vnode **,
|
||||
int *, struct ucred **))
|
||||
eopnotsupp,
|
||||
(int (*) (struct vnode *, struct fid *)) eopnotsupp,
|
||||
cfs_init,
|
||||
#ifdef NetBSD1_3
|
||||
(int (*)(void)) eopnotsupp,
|
||||
#endif
|
||||
0
|
||||
};
|
||||
|
||||
#elif defined(__FreeBSD__)
|
||||
#ifdef __FreeBSD_version
|
||||
struct vfsops cfs_vfsops = {
|
||||
cfs_mount,
|
||||
cfs_start,
|
||||
@ -295,29 +232,7 @@ struct vfsops cfs_vfsops = {
|
||||
cfs_init,
|
||||
};
|
||||
|
||||
#else
|
||||
struct vfsops cfs_vfsops = {
|
||||
cfs_mount,
|
||||
cfs_start,
|
||||
cfs_unmount,
|
||||
cfs_root,
|
||||
cfs_quotactl,
|
||||
cfs_nb_statfs,
|
||||
cfs_sync,
|
||||
cfs_vget,
|
||||
(int (*) (struct mount *, struct fid *, struct mbuf *, struct vnode **,
|
||||
int *, struct ucred **))
|
||||
eopnotsupp,
|
||||
(int (*) (struct vnode *, struct fid *)) eopnotsupp,
|
||||
cfs_init,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include <sys/kernel.h>
|
||||
VFS_SET(cfs_vfsops, cfs, MOUNT_CFS, VFCF_NETWORK);
|
||||
#endif
|
||||
|
||||
int
|
||||
cfs_vfsopstats_init(void)
|
||||
@ -335,7 +250,6 @@ cfs_vfsopstats_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* cfs mount vfsop
|
||||
* Set up mount info record and attach it to vfs struct.
|
||||
@ -344,13 +258,8 @@ cfs_vfsopstats_init(void)
|
||||
int
|
||||
cfs_mount(vfsp, path, data, ndp, p)
|
||||
struct mount *vfsp; /* Allocated and initialized by mount(2) */
|
||||
#ifdef NetBSD1_3
|
||||
const char *path; /* path covered: ignored by the fs-layer */
|
||||
void *data; /* Need to define a data type for this in netbsd? */
|
||||
#else
|
||||
char *path; /* path covered: ignored by the fs-layer */
|
||||
caddr_t data; /* Need to define a data type for this in netbsd? */
|
||||
#endif
|
||||
struct nameidata *ndp; /* Clobber this to lookup the device name */
|
||||
struct proc *p; /* The ever-famous proc pointer */
|
||||
{
|
||||
@ -399,11 +308,7 @@ cfs_mount(vfsp, path, data, ndp, p)
|
||||
/*
|
||||
* See if the device table matches our expectations.
|
||||
*/
|
||||
#ifdef __NetBSD__
|
||||
if (cdevsw[major(dev)].d_open != vc_nb_open)
|
||||
#elif defined(__FreeBSD__)
|
||||
if (cdevsw[major(dev)]->d_open != vc_nb_open)
|
||||
#endif
|
||||
{
|
||||
MARK_INT_FAIL(CFS_MOUNT_STATS);
|
||||
return(ENXIO);
|
||||
@ -426,19 +331,8 @@ cfs_mount(vfsp, path, data, ndp, p)
|
||||
|
||||
/* No initialization (here) of mi_vcomm! */
|
||||
vfsp->mnt_data = (qaddr_t)mi;
|
||||
#ifdef __NetBSD__
|
||||
vfsp->mnt_stat.f_fsid.val[0] = 0;
|
||||
vfsp->mnt_stat.f_fsid.val[1] = makefstype(MOUNT_CFS);
|
||||
#elif defined(__FreeBSD__) && defined(__FreeBSD_version)
|
||||
|
||||
vfs_getnewfsid (vfsp);
|
||||
|
||||
#elif defined(__FreeBSD__)
|
||||
/* Seems a bit overkill, since usualy /coda is the only mount point
|
||||
* for cfs.
|
||||
*/
|
||||
getnewfsid (vfsp, MOUNT_CFS);
|
||||
#endif
|
||||
mi->mi_vfsp = vfsp;
|
||||
|
||||
/*
|
||||
@ -471,13 +365,12 @@ cfs_mount(vfsp, path, data, ndp, p)
|
||||
|
||||
/* set filesystem block size */
|
||||
vfsp->mnt_stat.f_bsize = 8192; /* XXX -JJK */
|
||||
#ifdef __FreeBSD__
|
||||
|
||||
/* Set f_iosize. XXX -- inamura@isl.ntt.co.jp.
|
||||
For vnode_pager_haspage() references. The value should be obtained
|
||||
from underlying UFS. */
|
||||
/* Checked UFS. iosize is set as 8192 */
|
||||
vfsp->mnt_stat.f_iosize = 8192;
|
||||
#endif
|
||||
|
||||
/* error is currently guaranteed to be zero, but in case some
|
||||
code changes... */
|
||||
@ -526,27 +419,10 @@ cfs_unmount(vfsp, mntflags, p)
|
||||
#endif
|
||||
vrele(mi->mi_rootvp);
|
||||
|
||||
#ifdef NetBSD1_3
|
||||
active = cfs_kill(vfsp, NOT_DOWNCALL);
|
||||
|
||||
#if defined(__NetBSD__) && defined(NetBSD1_3) && (NetBSD1_3 >= 7)
|
||||
if (1)
|
||||
#else
|
||||
if ((error = vfs_busy(mi->mi_vfsp)) == 0)
|
||||
#endif
|
||||
{
|
||||
error = vflush(mi->mi_vfsp, NULLVP, FORCECLOSE);
|
||||
printf("cfs_unmount: active = %d, vflush active %d\n", active, error);
|
||||
error = 0;
|
||||
} else {
|
||||
printf("cfs_unmount: busy\n");
|
||||
}
|
||||
#else /* FreeBSD I guess */
|
||||
active = cfs_kill(vfsp, NOT_DOWNCALL);
|
||||
error = vflush(mi->mi_vfsp, NULLVP, FORCECLOSE);
|
||||
printf("cfs_unmount: active = %d, vflush active %d\n", active, error);
|
||||
error = 0;
|
||||
#endif
|
||||
/* I'm going to take this out to allow lookups to go through. I'm
|
||||
* not sure it's important anyway. -- DCS 2/2/94
|
||||
*/
|
||||
@ -591,8 +467,12 @@ cfs_root(vfsp, vpp)
|
||||
{ /* Found valid root. */
|
||||
*vpp = mi->mi_rootvp;
|
||||
/* On Mach, this is vref. On NetBSD, VOP_LOCK */
|
||||
#if 1
|
||||
vref(*vpp);
|
||||
VOP_X_LOCK(*vpp, LK_EXCLUSIVE);
|
||||
vn_lock(*vpp, LK_EXCLUSIVE, p);
|
||||
#else
|
||||
vget(*vpp, LK_EXCLUSIVE, p);
|
||||
#endif
|
||||
MARK_INT_SAT(CFS_ROOT_STATS);
|
||||
return(0);
|
||||
}
|
||||
@ -610,8 +490,13 @@ cfs_root(vfsp, vpp)
|
||||
cfs_save(VTOC(mi->mi_rootvp));
|
||||
|
||||
*vpp = mi->mi_rootvp;
|
||||
#if 1
|
||||
vref(*vpp);
|
||||
VOP_X_LOCK(*vpp, LK_EXCLUSIVE);
|
||||
vn_lock(*vpp, LK_EXCLUSIVE, p);
|
||||
#else
|
||||
vget(*vpp, LK_EXCLUSIVE, p);
|
||||
#endif
|
||||
|
||||
MARK_INT_SAT(CFS_ROOT_STATS);
|
||||
goto exit;
|
||||
} else if (error == ENODEV) {
|
||||
@ -625,8 +510,13 @@ cfs_root(vfsp, vpp)
|
||||
* will fail.
|
||||
*/
|
||||
*vpp = mi->mi_rootvp;
|
||||
#if 1
|
||||
vref(*vpp);
|
||||
VOP_X_LOCK(*vpp, LK_EXCLUSIVE);
|
||||
vn_lock(*vpp, LK_EXCLUSIVE, p);
|
||||
#else
|
||||
vget(*vpp, LK_EXCLUSIVE, p);
|
||||
#endif
|
||||
|
||||
MARK_INT_FAIL(CFS_ROOT_STATS);
|
||||
error = 0;
|
||||
goto exit;
|
||||
@ -636,6 +526,7 @@ cfs_root(vfsp, vpp)
|
||||
|
||||
goto exit;
|
||||
}
|
||||
|
||||
exit:
|
||||
return(error);
|
||||
}
|
||||
@ -674,11 +565,7 @@ cfs_nb_statfs(vfsp, sbp, p)
|
||||
#define NB_SFS_SIZ 0x895440
|
||||
*/
|
||||
/* Note: Normal fs's have a bsize of 0x400 == 1024 */
|
||||
#ifdef __NetBSD__
|
||||
sbp->f_type = 0;
|
||||
#elif defined(__FreeBSD__)
|
||||
sbp->f_type = MOUNT_CFS;
|
||||
#endif
|
||||
sbp->f_bsize = 8192; /* XXX */
|
||||
sbp->f_iosize = 8192; /* XXX */
|
||||
#define NB_SFS_SIZ 0x8AB75D
|
||||
@ -688,9 +575,6 @@ cfs_nb_statfs(vfsp, sbp, p)
|
||||
sbp->f_files = NB_SFS_SIZ;
|
||||
sbp->f_ffree = NB_SFS_SIZ;
|
||||
bcopy((caddr_t)&(vfsp->mnt_stat.f_fsid), (caddr_t)&(sbp->f_fsid), sizeof (fsid_t));
|
||||
#ifdef __NetBSD__
|
||||
strncpy(sbp->f_fstypename, MOUNT_CFS, MFSNAMELEN-1);
|
||||
#endif
|
||||
strcpy(sbp->f_mntonname, "/coda");
|
||||
strcpy(sbp->f_mntfromname, "CFS");
|
||||
/* MARK_INT_SAT(CFS_STATFS_STATS); */
|
||||
@ -780,57 +664,12 @@ cfs_vptofh(vnp, fidp)
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
#ifdef __NetBSD__
|
||||
void
|
||||
cfs_init(void)
|
||||
{
|
||||
ENTRY;
|
||||
}
|
||||
#elif defined(__FreeBSD__)
|
||||
#ifdef __FreeBSD_version
|
||||
int
|
||||
cfs_init(struct vfsconf *vfsp)
|
||||
{
|
||||
ENTRY;
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int
|
||||
cfs_init(void)
|
||||
{
|
||||
ENTRY;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__NetBSD__) && defined(NetBSD1_3) && (NetBSD1_3 >= 7)
|
||||
int
|
||||
cfs_sysctl(name, namelen, oldp, oldlp, newp, newl, p)
|
||||
int *name;
|
||||
u_int namelen;
|
||||
void *oldp;
|
||||
size_t *oldlp;
|
||||
void *newp;
|
||||
size_t newl;
|
||||
struct proc *p;
|
||||
{
|
||||
|
||||
/* all sysctl names at this level are terminal */
|
||||
if (namelen != 1)
|
||||
return (ENOTDIR); /* overloaded */
|
||||
|
||||
switch (name[0]) {
|
||||
/*
|
||||
case FFS_CLUSTERREAD:
|
||||
return (sysctl_int(oldp, oldlp, newp, newl, &doclusterread));
|
||||
*/
|
||||
default:
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* To allow for greater ease of use, some vnodes may be orphaned when
|
||||
@ -873,11 +712,7 @@ struct mount *devtomp(dev)
|
||||
|
||||
for (mp = mountlist.cqh_first; mp != (void*)&mountlist; mp = nmp) {
|
||||
nmp = mp->mnt_list.cqe_next;
|
||||
if (
|
||||
#ifdef __NetBSD__
|
||||
(!strcmp(mp->mnt_op->vfs_name, MOUNT_UFS)) &&
|
||||
#endif
|
||||
((VFSTOUFS(mp))->um_dev == (dev_t) dev)) {
|
||||
if (((VFSTOUFS(mp))->um_dev == (dev_t) dev)) {
|
||||
/* mount corresponds to UFS and the device matches one we want */
|
||||
return(mp);
|
||||
}
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_vfsops.h,v 1.9 1998/08/28 18:12:22 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_vfsops.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* cfid structure:
|
||||
@ -41,17 +43,11 @@ struct cfid {
|
||||
ViceFid cfid_fid;
|
||||
};
|
||||
|
||||
|
||||
struct mount;
|
||||
|
||||
int cfs_vfsopstats_init(void);
|
||||
#ifdef NetBSD1_3
|
||||
int cfs_mount(struct mount *, const char *, void *, struct nameidata *,
|
||||
struct proc *);
|
||||
#else
|
||||
int cfs_mount(struct mount *, char *, caddr_t, struct nameidata *,
|
||||
struct proc *);
|
||||
#endif
|
||||
int cfs_start(struct mount *, int, struct proc *);
|
||||
int cfs_unmount(struct mount *, int, struct proc *);
|
||||
int cfs_root(struct mount *, struct vnode **);
|
||||
@ -62,17 +58,6 @@ int cfs_vget(struct mount *, ino_t, struct vnode **);
|
||||
int cfs_fhtovp(struct mount *, struct fid *, struct mbuf *, struct vnode **,
|
||||
int *, struct ucred **);
|
||||
int cfs_vptofh(struct vnode *, struct fid *);
|
||||
#ifdef __NetBSD__
|
||||
void cfs_init(void);
|
||||
#elif defined(__FreeBSD__)
|
||||
#ifdef __FreeBSD_version
|
||||
int cfs_init(struct vfsconf *vfsp);
|
||||
#else
|
||||
int cfs_init(void);
|
||||
#endif
|
||||
#endif
|
||||
#if defined(__NetBSD__) && defined(NetBSD1_3) && (NetBSD1_3 >= 7)
|
||||
int cfs_sysctl(int *, u_int, void *, size_t *, void *, size_t,
|
||||
struct proc *);
|
||||
#endif
|
||||
|
||||
int getNewVnode(struct vnode **vpp);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_vnodeops.h,v 1.7 1998/08/28 18:12:24 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_vnodeops.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -46,6 +48,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfs_vnodeops.h,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.7 1998/08/28 18:12:24 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -87,7 +92,6 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* NetBSD interfaces to the vnodeops */
|
||||
int cfs_open __P((void *));
|
||||
int cfs_close __P((void *));
|
||||
@ -117,22 +121,15 @@ int cfs_reclaim __P((void *));
|
||||
int cfs_lock __P((void *));
|
||||
int cfs_unlock __P((void *));
|
||||
int cfs_islocked __P((void *));
|
||||
int nbsd_vop_error __P((void *));
|
||||
int nbsd_vop_nop __P((void *));
|
||||
#ifdef __FreeBSD__
|
||||
int fbsd_vnotsup __P((void *ap));
|
||||
#ifdef __FreeBSD_version
|
||||
int cfs_vop_error __P((void *));
|
||||
int cfs_vop_nop __P((void *));
|
||||
int cfs_fbsd_getpages __P((void *));
|
||||
int cfs_fbsd_putpages __P((void *));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int (**cfs_vnodeop_p)(void *);
|
||||
|
||||
int cfs_rdwr(struct vnode *vp, struct uio *uiop, enum uio_rw rw,
|
||||
int ioflag, struct ucred *cred, struct proc *p);
|
||||
|
||||
|
||||
|
||||
int cfs_grab_vnode(dev_t dev, ino_t ino, struct vnode **vpp);
|
||||
void print_vattr(struct vattr *attr);
|
||||
void print_cred(struct ucred *cred);
|
||||
|
@ -14,7 +14,6 @@ aic7xxx_{seq,reg}.h optional ahc device-driver \
|
||||
clean "aic7xxx_seq.h aic7xxx_reg.h" \
|
||||
dependency "$S/dev/aic7xxx/aic7xxx.{reg,seq} $S/scsi/scsi_message.h aicasm"
|
||||
cfs/cfs_namecache.c optional vcfs
|
||||
cfs/cfs_nbsd.c optional vcfs
|
||||
cfs/cfs_fbsd.c optional vcfs
|
||||
cfs/cfs_psdev.c optional vcfs
|
||||
cfs/cfs_subr.c optional vcfs
|
||||
|
@ -15,8 +15,8 @@ to experiment with.
|
||||
|
||||
To get more information on Coda, I would like to refer people to
|
||||
http://www.coda.cs.cmu.edu
|
||||
There is a wealth of documents, papers, theses there. There is also a
|
||||
good introduction to the Coda File System in
|
||||
There is a wealth of documents, papers, and theses there. There is
|
||||
also a good introduction to the Coda File System in
|
||||
http://www.coda.cs.cmu.edu/ljpaper/lj.html
|
||||
|
||||
Coda was originally developed as an academic prototype/testbed. It is
|
||||
@ -45,11 +45,11 @@ The relevant sources, binaries, and docs can be found in
|
||||
ftp://ftp.coda.cs.cmu.edu/pub/coda/
|
||||
|
||||
We intend to come out with new Coda releases often, not daily. We
|
||||
don't wish to slight any OS/platform not mentioned above. We are just
|
||||
don't want to slight any OS/platform not mentioned above. We are just
|
||||
limited in our resources as to what we can support internally. We
|
||||
will be happy to integrate OpenBSD support as well as other OS
|
||||
support. Also, adding platform support is relatively easy and we can
|
||||
discuss this. The only problem is that Coda has a light weight
|
||||
support. Also, adding platform support should be relatively easy and
|
||||
we can discuss this. The only difficulty is that Coda has a light weight
|
||||
process package. It does some manipulations in assembler which would
|
||||
have to be redone for a different platform.
|
||||
|
||||
|
@ -1,12 +1,17 @@
|
||||
OOPS:
|
||||
FreeBSD does not fsync!!!
|
||||
|
||||
Near term:
|
||||
Existing VOP_LOCKS's should proabably be
|
||||
vn_lock since that is what they were in -stable.
|
||||
Fix bug in executing/mapping new files.
|
||||
cfs_mount bug: interaction with cfs_inactive no cfs_unsave.
|
||||
vref/vn_lock == vget except no VXWANT which may be on.
|
||||
Review locks: vn_lock/VOP_UNLOCK/lockmgr ...
|
||||
|
||||
Medium term:
|
||||
Add missing VFS methods.
|
||||
Do performance profile.
|
||||
Tune hash algorithm used in cfs_namecache.
|
||||
Tune hash algorithm used in cfs_subr.
|
||||
|
||||
Eventually:
|
||||
Use standard queue macros.
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cnode.h,v 1.10 1998/08/28 18:12:25 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cnode.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -45,6 +47,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cnode.h,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.10 1998/08/28 18:12:25 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -144,45 +149,11 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
#define _CNODE_H_
|
||||
|
||||
#include <sys/vnode.h>
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
|
||||
/* for the prototype of DELAY() */
|
||||
#include <sys/lock.h>
|
||||
#include <machine/clock.h>
|
||||
|
||||
#ifdef __FreeBSD_version
|
||||
/* You would think that <sys/param.h> or something would include this */
|
||||
#include <sys/lock.h>
|
||||
|
||||
MALLOC_DECLARE(M_CFS);
|
||||
|
||||
#else
|
||||
|
||||
/* yuck yuck yuck */
|
||||
#define vref(x) cvref(x)
|
||||
extern void cvref(struct vnode *vp);
|
||||
/* yuck yuck yuck */
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__NetBSD__) && defined(NetBSD1_3) && (NetBSD1_3 >= 7)
|
||||
#define NEW_LOCKMGR(l, f, i) lockmgr(l, f, i)
|
||||
#define VOP_X_LOCK(vn, fl) vn_lock(vn, fl)
|
||||
#define VOP_X_UNLOCK(vn, fl) VOP_UNLOCK(vn, fl)
|
||||
|
||||
#elif defined(__FreeBSD_version)
|
||||
#define NEW_LOCKMGR(l, f, i) lockmgr(l, f, i, curproc)
|
||||
#define VOP_X_LOCK(vn, fl) vn_lock(vn, fl, curproc)
|
||||
#define VOP_X_UNLOCK(vn, fl) VOP_UNLOCK(vn, fl, curproc)
|
||||
|
||||
/* NetBSD 1.3 & FreeBSD 2.2.x */
|
||||
#else
|
||||
#undef NEW_LOCKMGR
|
||||
#define VOP_X_LOCK(vn, fl) VOP_LOCK(vn)
|
||||
#define VOP_X_UNLOCK(vn, fl) VOP_UNLOCK(vn)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* tmp below since we need struct queue
|
||||
*/
|
||||
@ -232,9 +203,7 @@ struct cnode {
|
||||
struct vnode *c_vnode;
|
||||
u_short c_flags; /* flags (see below) */
|
||||
ViceFid c_fid; /* file handle */
|
||||
#ifdef NEW_LOCKMGR
|
||||
struct lock c_lock; /* new lock protocol */
|
||||
#endif
|
||||
struct vnode *c_ovp; /* open vnode pointer */
|
||||
u_short c_ocount; /* count of openers */
|
||||
u_short c_owrite; /* count of open for write */
|
||||
@ -332,10 +301,6 @@ int cfs_vnodeopstats_init(void);
|
||||
/* cfs_vfsops.h */
|
||||
struct mount *devtomp(dev_t dev);
|
||||
|
||||
#if !(defined NetBSD1_3) && !defined(__FreeBSD_version)
|
||||
#define __RCSID(x) static char *rcsid = x
|
||||
#endif
|
||||
|
||||
/* sigh */
|
||||
#define CFS_RDWR ((u_long) 31)
|
||||
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/coda.h,v 1.10 1998/08/28 18:12:26 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/coda.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
@ -38,8 +40,6 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
#ifndef _CFS_HEADER_
|
||||
#define _CFS_HEADER_
|
||||
|
||||
|
||||
|
||||
/* Catch new _KERNEL defn for NetBSD */
|
||||
#ifdef __NetBSD__
|
||||
#include <sys/types.h>
|
||||
|
@ -1,53 +1,56 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_fbsd.c,v 1.6 1998/08/28 18:12:11 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_fbsd.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/ucred.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/conf.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vnode_pager.h>
|
||||
|
||||
#include <cfs/coda.h>
|
||||
#include <cfs/cnode.h>
|
||||
#include <cfs/cfs_vnodeops.h>
|
||||
|
||||
#ifdef DEVFS
|
||||
#include <sys/devfsext.h>
|
||||
#endif
|
||||
#include <sys/conf.h>
|
||||
|
||||
#include <sys/vnode.h>
|
||||
#include <cfs/coda.h>
|
||||
#include <cfs/cnode.h>
|
||||
#include <cfs/cfs_vnodeops.h>
|
||||
|
||||
/*
|
||||
From: "Jordan K. Hubbard" <jkh@time.cdrom.com>
|
||||
@ -63,7 +66,6 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
|
||||
#define VC_DEV_NO 93
|
||||
|
||||
#ifdef __FreeBSD_version
|
||||
/* Type of device methods. */
|
||||
extern d_open_t vc_nb_open;
|
||||
extern d_close_t vc_nb_close;
|
||||
@ -76,33 +78,8 @@ static struct cdevsw vccdevsw =
|
||||
{
|
||||
vc_nb_open, vc_nb_close, vc_nb_read, vc_nb_write, /*93*/
|
||||
vc_nb_ioctl, nostop, nullreset, nodevtotty,
|
||||
vc_nb_poll, nommap, NULL, "Coda", NULL, -1 };
|
||||
#else
|
||||
/* Type of device methods. */
|
||||
#define D_OPEN_T d_open_t
|
||||
#define D_CLOSE_T d_close_t
|
||||
#define D_RDWR_T d_rdwr_t
|
||||
#define D_READ_T d_read_t
|
||||
#define D_WRITE_T d_write_t
|
||||
#define D_IOCTL_T d_ioctl_t
|
||||
#define D_SELECT_T d_select_t
|
||||
|
||||
/* rvb why */
|
||||
D_OPEN_T vc_nb_open; /* was is defined in cfs_FreeBSD.h */
|
||||
D_CLOSE_T vc_nb_close;
|
||||
D_READ_T vc_nb_read;
|
||||
D_WRITE_T vc_nb_write;
|
||||
D_IOCTL_T vc_nb_ioctl;
|
||||
D_SELECT_T vc_nb_select;
|
||||
|
||||
static struct cdevsw vccdevsw =
|
||||
{
|
||||
vc_nb_open, vc_nb_close, vc_nb_read, vc_nb_write,
|
||||
vc_nb_ioctl, nostop, nullreset, nodevtotty,
|
||||
vc_nb_select, nommap, NULL, "Coda", NULL, -1 };
|
||||
|
||||
PSEUDO_SET(vcattach, vc);
|
||||
#endif
|
||||
vc_nb_poll, nommap, NULL, "Coda", NULL, -1
|
||||
};
|
||||
|
||||
void vcattach __P((void));
|
||||
static dev_t vccdev;
|
||||
@ -125,21 +102,9 @@ vcattach(void)
|
||||
VCDEBUG("cfs: vccdevsw entry installed at %d.\n", major(vccdev));
|
||||
}
|
||||
|
||||
void
|
||||
cvref(vp)
|
||||
struct vnode *vp;
|
||||
{
|
||||
if (vp->v_usecount <= 0)
|
||||
panic("vref used where vget required");
|
||||
|
||||
vp->v_usecount++;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __FreeBSD_version
|
||||
static vc_devsw_installed = 0;
|
||||
|
||||
static void vc_drvinit __P((void *unused));
|
||||
|
||||
static void
|
||||
vc_drvinit(void *unused)
|
||||
{
|
||||
@ -238,4 +203,3 @@ cfs_fbsd_putpages(v)
|
||||
|
||||
|
||||
SYSINIT(vccdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+VC_DEV_NO,vc_drvinit,NULL)
|
||||
#endif
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfsio.h,v 1.5 1998/08/18 17:05:23 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfsio.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -45,6 +47,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfsio.h,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.5 1998/08/18 17:05:23 rvb
|
||||
* Don't use __RCSID now
|
||||
*
|
||||
@ -106,20 +111,11 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
|
||||
/* Define ioctl commands for vcioctl, /dev/cfs */
|
||||
|
||||
#ifdef __STDC__
|
||||
#define CFSRESIZE _IOW('c', 1, struct cfs_resize ) /* Resize CFS NameCache */
|
||||
#define CFSSTATS _IO('c', 2) /* Collect stats */
|
||||
#define CFSPRINT _IO('c', 3) /* Print Cache */
|
||||
#define CFSTEST _IO('c', 4) /* Print Cache */
|
||||
#else /* sys/ioctl.h puts the quotes on */
|
||||
#define CFSRESIZE _IOW(c, 1, struct cfs_resize ) /* Resize CFS NameCache */
|
||||
#define CFSSTATS _IO(c, 2) /* Collect stats */
|
||||
#define CFSPRINT _IO(c, 3) /* Print Cache */
|
||||
|
||||
#define CFSTEST _IO(c, 4) /* Print Cache */
|
||||
#endif __STDC__
|
||||
|
||||
|
||||
struct cfs_resize { int hashsize, heapsize; };
|
||||
|
||||
#endif !_CFSIO_H_
|
||||
#endif
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfsk.h,v 1.9 1998/08/18 17:05:23 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfsk.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/* Macros to manipulate the queue */
|
||||
#ifndef INIT_QUEUE
|
||||
@ -61,4 +63,4 @@ do { \
|
||||
(el).back->forw = (el).forw; \
|
||||
} while (0)
|
||||
|
||||
#endif INIT_QUEUE
|
||||
#endif
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_namecache.c,v 1.11 1998/08/28 18:12:16 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_namecache.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -45,6 +47,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfs_namecache.c,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.11 1998/08/28 18:12:16 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -206,32 +211,25 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
#include <sys/param.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/ucred.h>
|
||||
#include <sys/select.h>
|
||||
|
||||
#ifndef insque
|
||||
#include <sys/systm.h>
|
||||
#endif /* insque */
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vm_object.h>
|
||||
|
||||
#include <cfs/coda.h>
|
||||
#include <cfs/cnode.h>
|
||||
#include <cfs/cfsnc.h>
|
||||
|
||||
#if defined(__NetBSD__) || defined(__FreeBSD__)
|
||||
#ifndef insque
|
||||
#include <sys/systm.h>
|
||||
#endif /* insque */
|
||||
#endif /* __NetBSD__ || defined(__FreeBSD__) */
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vm_object.h>
|
||||
#ifdef __FreeBSD_version
|
||||
#include <sys/ucred.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Declaration of the name cache data structure.
|
||||
*/
|
||||
|
||||
int cfsnc_use = 1; /* Indicate use of CFS Name Cache */
|
||||
|
||||
int cfsnc_size = CFSNC_CACHESIZE; /* size of the cache */
|
||||
int cfsnc_hashsize = CFSNC_HASHSIZE; /* size of the primary hash */
|
||||
|
||||
@ -246,16 +244,12 @@ struct cfsnc_statistics cfsnc_stat; /* Keep various stats */
|
||||
*/
|
||||
int cfsnc_debug = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Entry points for the CFS Name Cache
|
||||
*/
|
||||
static struct cfscache *
|
||||
cfsnc_find(struct cnode *dcp, const char *name, int namelen,
|
||||
static struct cfscache *cfsnc_find(struct cnode *dcp, const char *name, int namelen,
|
||||
struct ucred *cred, int hash);
|
||||
static void
|
||||
cfsnc_remove(struct cfscache *cncp, enum dc_status dcstat);
|
||||
|
||||
static void cfsnc_remove(struct cfscache *cncp, enum dc_status dcstat);
|
||||
|
||||
/*
|
||||
* Initialize the cache, the LRU structure and the Hash structure(s)
|
||||
@ -657,7 +651,7 @@ cfsnc_zapfile(dcp, name, namelen)
|
||||
|
||||
while (cncp) {
|
||||
cfsnchash[hash].length--; /* Used for tuning */
|
||||
/* 1.3 */
|
||||
|
||||
cfsnc_remove(cncp, NOT_DOWNCALL);
|
||||
cncp = cfsnc_find(dcp, name, namelen, 0, hash);
|
||||
}
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfsnc.h,v 1.8 1998/08/28 18:12:25 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfsnc.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -45,6 +47,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfsnc.h,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.8 1998/08/28 18:12:25 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -270,4 +275,4 @@ struct cfsnc_statistics {
|
||||
#define CFSNC_PRINTCFSNC ((u_long) 12)
|
||||
#define CFSNC_PRINTSTATS ((u_long) 13)
|
||||
|
||||
#endif /* _CFSNC_HEADER_ */
|
||||
#endif
|
||||
|
@ -1,34 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/coda_opstats.h,v 1.5 1998/08/18 17:05:25 rvb Exp $ */
|
||||
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/coda_opstats.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* operation stats: what the minicache can intercept that
|
||||
@ -102,12 +103,10 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
#define CFS_READDIR_STATS 19
|
||||
#define CFS_VNODEOPS_SIZE 20
|
||||
|
||||
|
||||
/*
|
||||
* I propose the following structres:
|
||||
*/
|
||||
|
||||
|
||||
struct cfs_op_stats {
|
||||
int opcode; /* vfs opcode */
|
||||
long entries; /* number of times call attempted */
|
||||
@ -118,7 +117,6 @@ struct cfs_op_stats {
|
||||
/* (do we need that?) */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* With each call to the minicache, we'll bump the counters whenver
|
||||
* a call is satisfied internally (through the cache or through a
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/pioctl.h,v 1.7 1998/08/28 18:12:26 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/pioctl.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -41,6 +43,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: pioctl.h,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.7 1998/08/28 18:12:26 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -108,11 +113,8 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
are no input or output parameters
|
||||
*/
|
||||
|
||||
#ifdef __STDC__
|
||||
#define _VICEIOCTL(id) ((unsigned int ) _IOW('V', id, struct ViceIoctl))
|
||||
#else
|
||||
#define _VICEIOCTL(id) ((unsigned int ) _IOW(V, id, struct ViceIoctl))
|
||||
#endif
|
||||
|
||||
/* Use this macro to define up to 256 vice ioctl's. These ioctl's
|
||||
all potentially have in/out parameters--this depends upon the
|
||||
values in the ViceIoctl structure. This structure is itself passed
|
||||
@ -121,4 +123,4 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
|
||||
#define _VALIDVICEIOCTL(com) (com >= _VICEIOCTL(0) && com <= _VICEIOCTL(255))
|
||||
|
||||
#endif _SYS_PIOCTL_H_
|
||||
#endif
|
||||
|
@ -1,35 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_psdev.c,v 1.9 1998/08/28 18:12:17 rvb Exp $ */
|
||||
|
||||
#define CTL_C
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_psdev.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -43,20 +43,19 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
* University. Contributers include David Steere, James Kistler, and
|
||||
* M. Satyanarayanan. */
|
||||
|
||||
/* ************************************************** */
|
||||
/* These routines define the psuedo device for communication between
|
||||
/*
|
||||
* These routines define the psuedo device for communication between
|
||||
* Coda's Venus and Minicache in Mach 2.6. They used to be in cfs_subr.c,
|
||||
* but I moved them to make it easier to port the Minicache without
|
||||
* porting coda. -- DCS 10/12/94
|
||||
*/
|
||||
|
||||
/*
|
||||
* Renamed to cfs_psdev: pseudo-device driver.
|
||||
*/
|
||||
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfs_psdev.c,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.9 1998/08/28 18:12:17 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -153,40 +152,28 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
extern int cfsnc_initialized; /* Set if cache has been initialized */
|
||||
|
||||
#include <vcfs.h>
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/file.h>
|
||||
#ifdef __FreeBSD_version
|
||||
#include <sys/ioccom.h>
|
||||
#else
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef NetBSD1_3
|
||||
#include <sys/poll.h>
|
||||
#endif
|
||||
#ifdef __FreeBSD_version
|
||||
#include <sys/poll.h>
|
||||
#else
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
#include <sys/conf.h>
|
||||
|
||||
#include <cfs/coda.h>
|
||||
#include <cfs/cnode.h>
|
||||
#include <cfs/cfsnc.h>
|
||||
#include <cfs/cfsio.h>
|
||||
|
||||
#define CTL_C
|
||||
|
||||
int cfs_psdev_print_entry = 0;
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define ENTRY \
|
||||
if(cfs_psdev_print_entry) myprintf(("Entered %s\n",__FUNCTION__))
|
||||
#else
|
||||
#define ENTRY
|
||||
#endif
|
||||
#define ENTRY if(cfs_psdev_print_entry) myprintf(("Entered %s\n",__FUNCTION__))
|
||||
|
||||
void vcfsattach(int n);
|
||||
int vc_nb_open(dev_t dev, int flag, int mode, struct proc *p);
|
||||
@ -194,11 +181,7 @@ int vc_nb_close (dev_t dev, int flag, int mode, struct proc *p);
|
||||
int vc_nb_read(dev_t dev, struct uio *uiop, int flag);
|
||||
int vc_nb_write(dev_t dev, struct uio *uiop, int flag);
|
||||
int vc_nb_ioctl(dev_t dev, int cmd, caddr_t addr, int flag, struct proc *p);
|
||||
#if defined(NetBSD1_3) || defined(__FreeBSD_version)
|
||||
int vc_nb_poll(dev_t dev, int events, struct proc *p);
|
||||
#else
|
||||
int vc_nb_select(dev_t dev, int flag, struct proc *p);
|
||||
#endif
|
||||
|
||||
struct vmsg {
|
||||
struct queue vm_chain;
|
||||
@ -222,9 +205,6 @@ vcfsattach(n)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* These functions are written for NetBSD.
|
||||
*/
|
||||
int
|
||||
vc_nb_open(dev, flag, mode, p)
|
||||
dev_t dev;
|
||||
@ -289,14 +269,6 @@ vc_nb_close (dev, flag, mode, p)
|
||||
if (mi->mi_rootvp) {
|
||||
/* Let unmount know this is for real */
|
||||
VTOC(mi->mi_rootvp)->c_flags |= C_UNMOUNTING;
|
||||
#ifdef NEW_LOCKMGR
|
||||
#ifdef __FreeBSD_version
|
||||
/* dounmount is different ... probably wrong ... */
|
||||
#else
|
||||
if (vfs_busy(mi->mi_vfsp, 0, 0))
|
||||
return (EBUSY);
|
||||
#endif
|
||||
#endif
|
||||
cfs_unmounting(mi->mi_vfsp);
|
||||
err = dounmount(mi->mi_vfsp, flag, p);
|
||||
if (err)
|
||||
@ -523,7 +495,6 @@ vc_nb_ioctl(dev, cmd, addr, flag, p)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NetBSD1_3) || defined(__FreeBSD_version)
|
||||
int
|
||||
vc_nb_poll(dev, events, p)
|
||||
dev_t dev;
|
||||
@ -551,33 +522,6 @@ vc_nb_poll(dev, events, p)
|
||||
|
||||
return(0);
|
||||
}
|
||||
#else
|
||||
int
|
||||
vc_nb_select(dev, flag, p)
|
||||
dev_t dev;
|
||||
int flag;
|
||||
struct proc *p;
|
||||
{
|
||||
register struct vcomm *vcp;
|
||||
|
||||
ENTRY;
|
||||
|
||||
if (minor(dev) >= NVCFS || minor(dev) < 0)
|
||||
return(ENXIO);
|
||||
|
||||
vcp = &cfs_mnttbl[minor(dev)].mi_vcomm;
|
||||
|
||||
if (flag != FREAD)
|
||||
return(0);
|
||||
|
||||
if (!EMPTY(vcp->vc_requests))
|
||||
return(1);
|
||||
|
||||
selrecord(p, &(vcp->vc_selproc));
|
||||
|
||||
return(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Statistics
|
||||
@ -593,7 +537,6 @@ struct cfs_clstat cfs_clstat;
|
||||
* (e.g. kill -9).
|
||||
*/
|
||||
|
||||
/* If you want this to be interruptible, set this to > PZERO */
|
||||
int cfscall_sleep = PZERO - 1;
|
||||
#ifdef CTL_C
|
||||
int cfs_pcatch = PCATCH;
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_subr.c,v 1.11 1998/08/28 18:12:18 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_subr.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -44,6 +46,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfs_subr.c,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.11 1998/08/28 18:12:18 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -202,8 +207,8 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/mount.h>
|
||||
|
||||
@ -212,8 +217,6 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
#include <cfs/cfs_subr.h>
|
||||
#include <cfs/cfsnc.h>
|
||||
|
||||
#if NVCFS
|
||||
|
||||
int cfs_active = 0;
|
||||
int cfs_reuse = 0;
|
||||
int cfs_new = 0;
|
||||
@ -221,11 +224,8 @@ int cfs_new = 0;
|
||||
struct cnode *cfs_freelist = NULL;
|
||||
struct cnode *cfs_cache[CFS_CACHESIZE];
|
||||
|
||||
#define cfshash(fid) \
|
||||
(((fid)->Volume + (fid)->Vnode) & (CFS_CACHESIZE-1))
|
||||
|
||||
#define cfshash(fid) (((fid)->Volume + (fid)->Vnode) & (CFS_CACHESIZE-1))
|
||||
#define CNODE_NEXT(cp) ((cp)->c_next)
|
||||
|
||||
#define ODD(vnode) ((vnode) & 0x1)
|
||||
|
||||
/*
|
||||
@ -690,24 +690,13 @@ int
|
||||
cfs_vmflush(cp)
|
||||
struct cnode *cp;
|
||||
{
|
||||
#if 0
|
||||
/* old code */
|
||||
/* Unset <device, inode> so that page_read doesn't try to use
|
||||
(possibly) invalid cache file. */
|
||||
cp->c_device = 0;
|
||||
cp->c_inode = 0;
|
||||
|
||||
return(inode_uncache_try(VTOI(CTOV(cp))) ? 0 : ETXTBSY);
|
||||
#else /* __NetBSD__ || __FreeBSD__ */
|
||||
return 0;
|
||||
#endif /* __NetBSD__ || __FreeBSD__ */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* kernel-internal debugging switches
|
||||
*/
|
||||
|
||||
void cfs_debugon(void)
|
||||
{
|
||||
cfsdebug = -1;
|
||||
@ -745,6 +734,3 @@ void cfs_debugoff(void)
|
||||
* 13) all <= 3
|
||||
* ...
|
||||
*/
|
||||
|
||||
|
||||
#endif /* NVCFS */
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_subr.h,v 1.4 1998/08/18 17:05:16 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_subr.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
struct cnode *cfs_alloc(void);
|
||||
void cfs_free(struct cnode *cp);
|
||||
@ -41,5 +43,3 @@ void cfs_debugoff(void);
|
||||
int cfs_kill(struct mount *whoIam, enum dc_status dcstat);
|
||||
void cfs_save(struct cnode *cp);
|
||||
void cfs_unsave(struct cnode *cp);
|
||||
|
||||
|
||||
|
@ -1,45 +1,42 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_venus.c,v 1.11 1998/08/28 18:12:20 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_venus.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/select.h>
|
||||
#ifdef __FreeBSD_version
|
||||
#include <sys/ioccom.h>
|
||||
#else
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
/* for CNV_OFLAGS below */
|
||||
#include <sys/fcntl.h>
|
||||
|
||||
#include <cfs/coda.h>
|
||||
@ -342,11 +339,11 @@ venus_access(void *mdp, ViceFid *fid, int mode,
|
||||
/* send the open to venus. */
|
||||
INIT_IN(&inp->ih, CFS_ACCESS, cred, p);
|
||||
inp->VFid = *fid;
|
||||
#ifdef NetBSD1_3
|
||||
inp->flags = mode;
|
||||
#else
|
||||
/* NOTE:
|
||||
* NetBSD and Venus internals use the "data" in the low 3 bits.
|
||||
* Hence, the conversion.
|
||||
*/
|
||||
inp->flags = mode>>6;
|
||||
#endif
|
||||
|
||||
error = cfscall(mdp, Isize, &Osize, (char *)inp);
|
||||
|
||||
@ -437,11 +434,7 @@ venus_create(void *mdp, ViceFid *fid,
|
||||
INIT_IN(&inp->ih, CFS_CREATE, cred, p);
|
||||
inp->VFid = *fid;
|
||||
inp->excl = exclusive ? C_O_EXCL : 0;
|
||||
#ifdef NetBSD1_3
|
||||
inp->mode = mode<<6;
|
||||
#else
|
||||
inp->mode = mode;
|
||||
#endif
|
||||
CNV_V2VV_ATTR(&inp->attr, va);
|
||||
|
||||
inp->name = Isize;
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_venus.h,v 1.4 1998/08/18 17:05:18 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_venus.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
int
|
||||
venus_root(void *mdp,
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_vfsops.c,v 1.11 1998/08/28 18:12:22 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_vfsops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -45,6 +47,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfs_vfsops.c,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.11 1998/08/28 18:12:22 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -173,11 +178,12 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/select.h>
|
||||
|
||||
#include <cfs/coda.h>
|
||||
@ -186,25 +192,14 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
#include <cfs/cfs_venus.h>
|
||||
#include <cfs/cfs_subr.h>
|
||||
#include <cfs/coda_opstats.h>
|
||||
/* for VN_RDEV */
|
||||
|
||||
#include <miscfs/specfs/specdev.h>
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#ifdef __FreeBSD_version
|
||||
MALLOC_DEFINE(M_CFS, "CFS storage", "Various Coda Structures");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int cfsdebug = 0;
|
||||
|
||||
int cfs_vfsop_print_entry = 0;
|
||||
#ifdef __GNUC__
|
||||
#define ENTRY \
|
||||
if(cfs_vfsop_print_entry) myprintf(("Entered %s\n",__FUNCTION__))
|
||||
#else
|
||||
#define ENTRY
|
||||
#endif
|
||||
|
||||
#define ENTRY if(cfs_vfsop_print_entry) myprintf(("Entered %s\n",__FUNCTION__))
|
||||
|
||||
struct vnode *cfs_ctlvp;
|
||||
struct cfs_mntinfo cfs_mnttbl[NVCFS]; /* indexed by minor device number */
|
||||
@ -220,65 +215,7 @@ struct cfs_op_stats cfs_vfsopstats[CFS_VFSOPS_SIZE];
|
||||
|
||||
extern int cfsnc_initialized; /* Set if cache has been initialized */
|
||||
extern int vc_nb_open __P((dev_t, int, int, struct proc *));
|
||||
#ifdef __NetBSD__
|
||||
extern struct cdevsw cdevsw[]; /* For sanity check in cfs_mount */
|
||||
#endif
|
||||
/* NetBSD interface to statfs */
|
||||
|
||||
#if defined(__NetBSD__) && defined(NetBSD1_3) && (NetBSD1_3 >= 5)
|
||||
extern struct vnodeopv_desc cfs_vnodeop_opv_desc;
|
||||
|
||||
struct vnodeopv_desc *cfs_vnodeopv_descs[] = {
|
||||
&cfs_vnodeop_opv_desc,
|
||||
NULL,
|
||||
};
|
||||
|
||||
struct vfsops cfs_vfsops = {
|
||||
MOUNT_CFS,
|
||||
cfs_mount,
|
||||
cfs_start,
|
||||
cfs_unmount,
|
||||
cfs_root,
|
||||
cfs_quotactl,
|
||||
cfs_nb_statfs,
|
||||
cfs_sync,
|
||||
cfs_vget,
|
||||
(int (*) (struct mount *, struct fid *, struct mbuf *, struct vnode **,
|
||||
int *, struct ucred **))
|
||||
eopnotsupp,
|
||||
(int (*) (struct vnode *, struct fid *)) eopnotsupp,
|
||||
cfs_init,
|
||||
#if (NetBSD1_3 >= 7)
|
||||
cfs_sysctl,
|
||||
#endif
|
||||
(int (*)(void)) eopnotsupp,
|
||||
cfs_vnodeopv_descs,
|
||||
0
|
||||
};
|
||||
#elif defined(__NetBSD__)
|
||||
struct vfsops cfs_vfsops = {
|
||||
MOUNT_CFS,
|
||||
cfs_mount,
|
||||
cfs_start,
|
||||
cfs_unmount,
|
||||
cfs_root,
|
||||
cfs_quotactl,
|
||||
cfs_nb_statfs,
|
||||
cfs_sync,
|
||||
cfs_vget,
|
||||
(int (*) (struct mount *, struct fid *, struct mbuf *, struct vnode **,
|
||||
int *, struct ucred **))
|
||||
eopnotsupp,
|
||||
(int (*) (struct vnode *, struct fid *)) eopnotsupp,
|
||||
cfs_init,
|
||||
#ifdef NetBSD1_3
|
||||
(int (*)(void)) eopnotsupp,
|
||||
#endif
|
||||
0
|
||||
};
|
||||
|
||||
#elif defined(__FreeBSD__)
|
||||
#ifdef __FreeBSD_version
|
||||
struct vfsops cfs_vfsops = {
|
||||
cfs_mount,
|
||||
cfs_start,
|
||||
@ -295,29 +232,7 @@ struct vfsops cfs_vfsops = {
|
||||
cfs_init,
|
||||
};
|
||||
|
||||
#else
|
||||
struct vfsops cfs_vfsops = {
|
||||
cfs_mount,
|
||||
cfs_start,
|
||||
cfs_unmount,
|
||||
cfs_root,
|
||||
cfs_quotactl,
|
||||
cfs_nb_statfs,
|
||||
cfs_sync,
|
||||
cfs_vget,
|
||||
(int (*) (struct mount *, struct fid *, struct mbuf *, struct vnode **,
|
||||
int *, struct ucred **))
|
||||
eopnotsupp,
|
||||
(int (*) (struct vnode *, struct fid *)) eopnotsupp,
|
||||
cfs_init,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include <sys/kernel.h>
|
||||
VFS_SET(cfs_vfsops, cfs, MOUNT_CFS, VFCF_NETWORK);
|
||||
#endif
|
||||
|
||||
int
|
||||
cfs_vfsopstats_init(void)
|
||||
@ -335,7 +250,6 @@ cfs_vfsopstats_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* cfs mount vfsop
|
||||
* Set up mount info record and attach it to vfs struct.
|
||||
@ -344,13 +258,8 @@ cfs_vfsopstats_init(void)
|
||||
int
|
||||
cfs_mount(vfsp, path, data, ndp, p)
|
||||
struct mount *vfsp; /* Allocated and initialized by mount(2) */
|
||||
#ifdef NetBSD1_3
|
||||
const char *path; /* path covered: ignored by the fs-layer */
|
||||
void *data; /* Need to define a data type for this in netbsd? */
|
||||
#else
|
||||
char *path; /* path covered: ignored by the fs-layer */
|
||||
caddr_t data; /* Need to define a data type for this in netbsd? */
|
||||
#endif
|
||||
struct nameidata *ndp; /* Clobber this to lookup the device name */
|
||||
struct proc *p; /* The ever-famous proc pointer */
|
||||
{
|
||||
@ -399,11 +308,7 @@ cfs_mount(vfsp, path, data, ndp, p)
|
||||
/*
|
||||
* See if the device table matches our expectations.
|
||||
*/
|
||||
#ifdef __NetBSD__
|
||||
if (cdevsw[major(dev)].d_open != vc_nb_open)
|
||||
#elif defined(__FreeBSD__)
|
||||
if (cdevsw[major(dev)]->d_open != vc_nb_open)
|
||||
#endif
|
||||
{
|
||||
MARK_INT_FAIL(CFS_MOUNT_STATS);
|
||||
return(ENXIO);
|
||||
@ -426,19 +331,8 @@ cfs_mount(vfsp, path, data, ndp, p)
|
||||
|
||||
/* No initialization (here) of mi_vcomm! */
|
||||
vfsp->mnt_data = (qaddr_t)mi;
|
||||
#ifdef __NetBSD__
|
||||
vfsp->mnt_stat.f_fsid.val[0] = 0;
|
||||
vfsp->mnt_stat.f_fsid.val[1] = makefstype(MOUNT_CFS);
|
||||
#elif defined(__FreeBSD__) && defined(__FreeBSD_version)
|
||||
|
||||
vfs_getnewfsid (vfsp);
|
||||
|
||||
#elif defined(__FreeBSD__)
|
||||
/* Seems a bit overkill, since usualy /coda is the only mount point
|
||||
* for cfs.
|
||||
*/
|
||||
getnewfsid (vfsp, MOUNT_CFS);
|
||||
#endif
|
||||
mi->mi_vfsp = vfsp;
|
||||
|
||||
/*
|
||||
@ -471,13 +365,12 @@ cfs_mount(vfsp, path, data, ndp, p)
|
||||
|
||||
/* set filesystem block size */
|
||||
vfsp->mnt_stat.f_bsize = 8192; /* XXX -JJK */
|
||||
#ifdef __FreeBSD__
|
||||
|
||||
/* Set f_iosize. XXX -- inamura@isl.ntt.co.jp.
|
||||
For vnode_pager_haspage() references. The value should be obtained
|
||||
from underlying UFS. */
|
||||
/* Checked UFS. iosize is set as 8192 */
|
||||
vfsp->mnt_stat.f_iosize = 8192;
|
||||
#endif
|
||||
|
||||
/* error is currently guaranteed to be zero, but in case some
|
||||
code changes... */
|
||||
@ -526,27 +419,10 @@ cfs_unmount(vfsp, mntflags, p)
|
||||
#endif
|
||||
vrele(mi->mi_rootvp);
|
||||
|
||||
#ifdef NetBSD1_3
|
||||
active = cfs_kill(vfsp, NOT_DOWNCALL);
|
||||
|
||||
#if defined(__NetBSD__) && defined(NetBSD1_3) && (NetBSD1_3 >= 7)
|
||||
if (1)
|
||||
#else
|
||||
if ((error = vfs_busy(mi->mi_vfsp)) == 0)
|
||||
#endif
|
||||
{
|
||||
error = vflush(mi->mi_vfsp, NULLVP, FORCECLOSE);
|
||||
printf("cfs_unmount: active = %d, vflush active %d\n", active, error);
|
||||
error = 0;
|
||||
} else {
|
||||
printf("cfs_unmount: busy\n");
|
||||
}
|
||||
#else /* FreeBSD I guess */
|
||||
active = cfs_kill(vfsp, NOT_DOWNCALL);
|
||||
error = vflush(mi->mi_vfsp, NULLVP, FORCECLOSE);
|
||||
printf("cfs_unmount: active = %d, vflush active %d\n", active, error);
|
||||
error = 0;
|
||||
#endif
|
||||
/* I'm going to take this out to allow lookups to go through. I'm
|
||||
* not sure it's important anyway. -- DCS 2/2/94
|
||||
*/
|
||||
@ -591,8 +467,12 @@ cfs_root(vfsp, vpp)
|
||||
{ /* Found valid root. */
|
||||
*vpp = mi->mi_rootvp;
|
||||
/* On Mach, this is vref. On NetBSD, VOP_LOCK */
|
||||
#if 1
|
||||
vref(*vpp);
|
||||
VOP_X_LOCK(*vpp, LK_EXCLUSIVE);
|
||||
vn_lock(*vpp, LK_EXCLUSIVE, p);
|
||||
#else
|
||||
vget(*vpp, LK_EXCLUSIVE, p);
|
||||
#endif
|
||||
MARK_INT_SAT(CFS_ROOT_STATS);
|
||||
return(0);
|
||||
}
|
||||
@ -610,8 +490,13 @@ cfs_root(vfsp, vpp)
|
||||
cfs_save(VTOC(mi->mi_rootvp));
|
||||
|
||||
*vpp = mi->mi_rootvp;
|
||||
#if 1
|
||||
vref(*vpp);
|
||||
VOP_X_LOCK(*vpp, LK_EXCLUSIVE);
|
||||
vn_lock(*vpp, LK_EXCLUSIVE, p);
|
||||
#else
|
||||
vget(*vpp, LK_EXCLUSIVE, p);
|
||||
#endif
|
||||
|
||||
MARK_INT_SAT(CFS_ROOT_STATS);
|
||||
goto exit;
|
||||
} else if (error == ENODEV) {
|
||||
@ -625,8 +510,13 @@ cfs_root(vfsp, vpp)
|
||||
* will fail.
|
||||
*/
|
||||
*vpp = mi->mi_rootvp;
|
||||
#if 1
|
||||
vref(*vpp);
|
||||
VOP_X_LOCK(*vpp, LK_EXCLUSIVE);
|
||||
vn_lock(*vpp, LK_EXCLUSIVE, p);
|
||||
#else
|
||||
vget(*vpp, LK_EXCLUSIVE, p);
|
||||
#endif
|
||||
|
||||
MARK_INT_FAIL(CFS_ROOT_STATS);
|
||||
error = 0;
|
||||
goto exit;
|
||||
@ -636,6 +526,7 @@ cfs_root(vfsp, vpp)
|
||||
|
||||
goto exit;
|
||||
}
|
||||
|
||||
exit:
|
||||
return(error);
|
||||
}
|
||||
@ -674,11 +565,7 @@ cfs_nb_statfs(vfsp, sbp, p)
|
||||
#define NB_SFS_SIZ 0x895440
|
||||
*/
|
||||
/* Note: Normal fs's have a bsize of 0x400 == 1024 */
|
||||
#ifdef __NetBSD__
|
||||
sbp->f_type = 0;
|
||||
#elif defined(__FreeBSD__)
|
||||
sbp->f_type = MOUNT_CFS;
|
||||
#endif
|
||||
sbp->f_bsize = 8192; /* XXX */
|
||||
sbp->f_iosize = 8192; /* XXX */
|
||||
#define NB_SFS_SIZ 0x8AB75D
|
||||
@ -688,9 +575,6 @@ cfs_nb_statfs(vfsp, sbp, p)
|
||||
sbp->f_files = NB_SFS_SIZ;
|
||||
sbp->f_ffree = NB_SFS_SIZ;
|
||||
bcopy((caddr_t)&(vfsp->mnt_stat.f_fsid), (caddr_t)&(sbp->f_fsid), sizeof (fsid_t));
|
||||
#ifdef __NetBSD__
|
||||
strncpy(sbp->f_fstypename, MOUNT_CFS, MFSNAMELEN-1);
|
||||
#endif
|
||||
strcpy(sbp->f_mntonname, "/coda");
|
||||
strcpy(sbp->f_mntfromname, "CFS");
|
||||
/* MARK_INT_SAT(CFS_STATFS_STATS); */
|
||||
@ -780,57 +664,12 @@ cfs_vptofh(vnp, fidp)
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
#ifdef __NetBSD__
|
||||
void
|
||||
cfs_init(void)
|
||||
{
|
||||
ENTRY;
|
||||
}
|
||||
#elif defined(__FreeBSD__)
|
||||
#ifdef __FreeBSD_version
|
||||
int
|
||||
cfs_init(struct vfsconf *vfsp)
|
||||
{
|
||||
ENTRY;
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int
|
||||
cfs_init(void)
|
||||
{
|
||||
ENTRY;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__NetBSD__) && defined(NetBSD1_3) && (NetBSD1_3 >= 7)
|
||||
int
|
||||
cfs_sysctl(name, namelen, oldp, oldlp, newp, newl, p)
|
||||
int *name;
|
||||
u_int namelen;
|
||||
void *oldp;
|
||||
size_t *oldlp;
|
||||
void *newp;
|
||||
size_t newl;
|
||||
struct proc *p;
|
||||
{
|
||||
|
||||
/* all sysctl names at this level are terminal */
|
||||
if (namelen != 1)
|
||||
return (ENOTDIR); /* overloaded */
|
||||
|
||||
switch (name[0]) {
|
||||
/*
|
||||
case FFS_CLUSTERREAD:
|
||||
return (sysctl_int(oldp, oldlp, newp, newl, &doclusterread));
|
||||
*/
|
||||
default:
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* To allow for greater ease of use, some vnodes may be orphaned when
|
||||
@ -873,11 +712,7 @@ struct mount *devtomp(dev)
|
||||
|
||||
for (mp = mountlist.cqh_first; mp != (void*)&mountlist; mp = nmp) {
|
||||
nmp = mp->mnt_list.cqe_next;
|
||||
if (
|
||||
#ifdef __NetBSD__
|
||||
(!strcmp(mp->mnt_op->vfs_name, MOUNT_UFS)) &&
|
||||
#endif
|
||||
((VFSTOUFS(mp))->um_dev == (dev_t) dev)) {
|
||||
if (((VFSTOUFS(mp))->um_dev == (dev_t) dev)) {
|
||||
/* mount corresponds to UFS and the device matches one we want */
|
||||
return(mp);
|
||||
}
|
||||
|
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_vfsops.h,v 1.9 1998/08/28 18:12:22 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_vfsops.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* cfid structure:
|
||||
@ -41,17 +43,11 @@ struct cfid {
|
||||
ViceFid cfid_fid;
|
||||
};
|
||||
|
||||
|
||||
struct mount;
|
||||
|
||||
int cfs_vfsopstats_init(void);
|
||||
#ifdef NetBSD1_3
|
||||
int cfs_mount(struct mount *, const char *, void *, struct nameidata *,
|
||||
struct proc *);
|
||||
#else
|
||||
int cfs_mount(struct mount *, char *, caddr_t, struct nameidata *,
|
||||
struct proc *);
|
||||
#endif
|
||||
int cfs_start(struct mount *, int, struct proc *);
|
||||
int cfs_unmount(struct mount *, int, struct proc *);
|
||||
int cfs_root(struct mount *, struct vnode **);
|
||||
@ -62,17 +58,6 @@ int cfs_vget(struct mount *, ino_t, struct vnode **);
|
||||
int cfs_fhtovp(struct mount *, struct fid *, struct mbuf *, struct vnode **,
|
||||
int *, struct ucred **);
|
||||
int cfs_vptofh(struct vnode *, struct fid *);
|
||||
#ifdef __NetBSD__
|
||||
void cfs_init(void);
|
||||
#elif defined(__FreeBSD__)
|
||||
#ifdef __FreeBSD_version
|
||||
int cfs_init(struct vfsconf *vfsp);
|
||||
#else
|
||||
int cfs_init(void);
|
||||
#endif
|
||||
#endif
|
||||
#if defined(__NetBSD__) && defined(NetBSD1_3) && (NetBSD1_3 >= 7)
|
||||
int cfs_sysctl(int *, u_int, void *, size_t *, void *, size_t,
|
||||
struct proc *);
|
||||
#endif
|
||||
|
||||
int getNewVnode(struct vnode **vpp);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,33 +1,35 @@
|
||||
/*
|
||||
|
||||
Coda: an Experimental Distributed File System
|
||||
Release 3.1
|
||||
|
||||
Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation is hereby granted, provided that both the copyright
|
||||
notice and this permission notice appear in all copies of the
|
||||
software, derivative works or modified versions, and any portions
|
||||
thereof, and that both notices appear in supporting documentation, and
|
||||
that credit is given to Carnegie Mellon University in all documents
|
||||
and publicity pertaining to direct or indirect use of this code or its
|
||||
derivatives.
|
||||
|
||||
CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
ANY DERIVATIVE WORK.
|
||||
|
||||
Carnegie Mellon encourages users of this software to return any
|
||||
improvements or extensions that they make, and to grant Carnegie
|
||||
Mellon the rights to redistribute these changes without encumbrance.
|
||||
*/
|
||||
|
||||
/* $Header: /afs/cs/project/coda-src/cvs/coda/kernel-src/vfs/freebsd/cfs/cfs_vnodeops.h,v 1.7 1998/08/28 18:12:24 rvb Exp $ */
|
||||
*
|
||||
* Coda: an Experimental Distributed File System
|
||||
* Release 3.1
|
||||
*
|
||||
* Copyright (c) 1987-1998 Carnegie Mellon University
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation, and
|
||||
* that credit is given to Carnegie Mellon University in all documents
|
||||
* and publicity pertaining to direct or indirect use of this code or its
|
||||
* derivatives.
|
||||
*
|
||||
* CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
|
||||
* SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
|
||||
* FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
|
||||
* DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
|
||||
* RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
|
||||
* ANY DERIVATIVE WORK.
|
||||
*
|
||||
* Carnegie Mellon encourages users of this software to return any
|
||||
* improvements or extensions that they make, and to grant Carnegie
|
||||
* Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
* @(#) src/sys/cfs/cfs_vnodeops.h,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
|
||||
* $Id: $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
@ -46,6 +48,9 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log: cfs_vnodeops.h,v $
|
||||
* Revision 1.1.1.1 1998/08/29 21:14:52 rvb
|
||||
* Very Preliminary Coda
|
||||
*
|
||||
* Revision 1.7 1998/08/28 18:12:24 rvb
|
||||
* Now it also works on FreeBSD -current. This code will be
|
||||
* committed to the FreeBSD -current and NetBSD -current
|
||||
@ -87,7 +92,6 @@ Mellon the rights to redistribute these changes without encumbrance.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* NetBSD interfaces to the vnodeops */
|
||||
int cfs_open __P((void *));
|
||||
int cfs_close __P((void *));
|
||||
@ -117,22 +121,15 @@ int cfs_reclaim __P((void *));
|
||||
int cfs_lock __P((void *));
|
||||
int cfs_unlock __P((void *));
|
||||
int cfs_islocked __P((void *));
|
||||
int nbsd_vop_error __P((void *));
|
||||
int nbsd_vop_nop __P((void *));
|
||||
#ifdef __FreeBSD__
|
||||
int fbsd_vnotsup __P((void *ap));
|
||||
#ifdef __FreeBSD_version
|
||||
int cfs_vop_error __P((void *));
|
||||
int cfs_vop_nop __P((void *));
|
||||
int cfs_fbsd_getpages __P((void *));
|
||||
int cfs_fbsd_putpages __P((void *));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int (**cfs_vnodeop_p)(void *);
|
||||
|
||||
int cfs_rdwr(struct vnode *vp, struct uio *uiop, enum uio_rw rw,
|
||||
int ioflag, struct ucred *cred, struct proc *p);
|
||||
|
||||
|
||||
|
||||
int cfs_grab_vnode(dev_t dev, ino_t ino, struct vnode **vpp);
|
||||
void print_vattr(struct vattr *attr);
|
||||
void print_cred(struct ucred *cred);
|
||||
|
Loading…
Reference in New Issue
Block a user