miscfs prototype changes
This commit is contained in:
parent
273fa18bff
commit
631ccba638
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: dead_vnops.c,v 1.13 1995/04/10 00:48:46 mycroft Exp $ */
|
||||
/* $NetBSD: dead_vnops.c,v 1.14 1996/02/09 22:39:56 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -42,73 +42,78 @@
|
||||
#include <sys/errno.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/proc.h>
|
||||
|
||||
/*
|
||||
* Prototypes for dead operations on vnodes.
|
||||
*/
|
||||
int dead_badop(),
|
||||
dead_ebadf();
|
||||
int dead_lookup __P((struct vop_lookup_args *));
|
||||
#define dead_create ((int (*) __P((struct vop_create_args *)))dead_badop)
|
||||
#define dead_mknod ((int (*) __P((struct vop_mknod_args *)))dead_badop)
|
||||
int dead_open __P((struct vop_open_args *));
|
||||
#define dead_close ((int (*) __P((struct vop_close_args *)))nullop)
|
||||
#define dead_access ((int (*) __P((struct vop_access_args *)))dead_ebadf)
|
||||
#define dead_getattr ((int (*) __P((struct vop_getattr_args *)))dead_ebadf)
|
||||
#define dead_setattr ((int (*) __P((struct vop_setattr_args *)))dead_ebadf)
|
||||
int dead_read __P((struct vop_read_args *));
|
||||
int dead_write __P((struct vop_write_args *));
|
||||
int dead_ioctl __P((struct vop_ioctl_args *));
|
||||
int dead_select __P((struct vop_select_args *));
|
||||
#define dead_mmap ((int (*) __P((struct vop_mmap_args *)))dead_badop)
|
||||
#define dead_fsync ((int (*) __P((struct vop_fsync_args *)))nullop)
|
||||
#define dead_seek ((int (*) __P((struct vop_seek_args *)))nullop)
|
||||
#define dead_remove ((int (*) __P((struct vop_remove_args *)))dead_badop)
|
||||
#define dead_link ((int (*) __P((struct vop_link_args *)))dead_badop)
|
||||
#define dead_rename ((int (*) __P((struct vop_rename_args *)))dead_badop)
|
||||
#define dead_mkdir ((int (*) __P((struct vop_mkdir_args *)))dead_badop)
|
||||
#define dead_rmdir ((int (*) __P((struct vop_rmdir_args *)))dead_badop)
|
||||
#define dead_symlink ((int (*) __P((struct vop_symlink_args *)))dead_badop)
|
||||
#define dead_readdir ((int (*) __P((struct vop_readdir_args *)))dead_ebadf)
|
||||
#define dead_readlink ((int (*) __P((struct vop_readlink_args *)))dead_ebadf)
|
||||
#define dead_abortop ((int (*) __P((struct vop_abortop_args *)))dead_badop)
|
||||
#define dead_inactive ((int (*) __P((struct vop_inactive_args *)))nullop)
|
||||
#define dead_reclaim ((int (*) __P((struct vop_reclaim_args *)))nullop)
|
||||
int dead_lock __P((struct vop_lock_args *));
|
||||
#define dead_unlock ((int (*) __P((struct vop_unlock_args *)))nullop)
|
||||
int dead_bmap __P((struct vop_bmap_args *));
|
||||
int dead_strategy __P((struct vop_strategy_args *));
|
||||
int dead_print __P((struct vop_print_args *));
|
||||
#define dead_islocked ((int (*) __P((struct vop_islocked_args *)))nullop)
|
||||
#define dead_pathconf ((int (*) __P((struct vop_pathconf_args *)))dead_ebadf)
|
||||
#define dead_advlock ((int (*) __P((struct vop_advlock_args *)))dead_ebadf)
|
||||
#define dead_blkatoff ((int (*) __P((struct vop_blkatoff_args *)))dead_badop)
|
||||
#define dead_valloc ((int (*) __P((struct vop_valloc_args *)))dead_badop)
|
||||
#define dead_vfree ((int (*) __P((struct vop_vfree_args *)))dead_badop)
|
||||
#define dead_truncate ((int (*) __P((struct vop_truncate_args *)))nullop)
|
||||
#define dead_update ((int (*) __P((struct vop_update_args *)))nullop)
|
||||
#define dead_bwrite ((int (*) __P((struct vop_bwrite_args *)))nullop)
|
||||
int dead_badop __P((void *));
|
||||
int dead_ebadf __P((void *));
|
||||
int dead_nullop __P((void *));
|
||||
int dead_lookup __P((void *));
|
||||
#define dead_create dead_badop
|
||||
#define dead_mknod dead_badop
|
||||
int dead_open __P((void *));
|
||||
#define dead_close nullop
|
||||
#define dead_access dead_ebadf
|
||||
#define dead_getattr dead_ebadf
|
||||
#define dead_setattr dead_ebadf
|
||||
int dead_read __P((void *));
|
||||
int dead_write __P((void *));
|
||||
int dead_ioctl __P((void *));
|
||||
int dead_select __P((void *));
|
||||
#define dead_mmap dead_badop
|
||||
#define dead_fsync nullop
|
||||
#define dead_seek nullop
|
||||
#define dead_remove dead_badop
|
||||
#define dead_link dead_badop
|
||||
#define dead_rename dead_badop
|
||||
#define dead_mkdir dead_badop
|
||||
#define dead_rmdir dead_badop
|
||||
#define dead_symlink dead_badop
|
||||
#define dead_readdir dead_ebadf
|
||||
#define dead_readlink dead_ebadf
|
||||
#define dead_abortop dead_badop
|
||||
#define dead_inactive nullop
|
||||
#define dead_reclaim nullop
|
||||
int dead_lock __P((void *));
|
||||
#define dead_unlock nullop
|
||||
int dead_bmap __P((void *));
|
||||
int dead_strategy __P((void *));
|
||||
int dead_print __P((void *));
|
||||
#define dead_islocked nullop
|
||||
#define dead_pathconf dead_ebadf
|
||||
#define dead_advlock dead_ebadf
|
||||
#define dead_blkatoff dead_badop
|
||||
#define dead_valloc dead_badop
|
||||
#define dead_vfree dead_badop
|
||||
#define dead_truncate nullop
|
||||
#define dead_update nullop
|
||||
#define dead_bwrite nullop
|
||||
|
||||
int chkvnlock __P((struct vnode *));
|
||||
|
||||
int (**dead_vnodeop_p) __P((void *));
|
||||
|
||||
int (**dead_vnodeop_p)();
|
||||
struct vnodeopv_entry_desc dead_vnodeop_entries[] = {
|
||||
{ &vop_default_desc, vn_default_error },
|
||||
{ &vop_lookup_desc, dead_lookup }, /* lookup */
|
||||
{ &vop_create_desc, dead_create }, /* create */
|
||||
{ &vop_mknod_desc, dead_mknod }, /* mknod */
|
||||
{ &vop_open_desc, dead_open }, /* open */
|
||||
{ &vop_open_desc, dead_open }, /* open */
|
||||
{ &vop_close_desc, dead_close }, /* close */
|
||||
{ &vop_access_desc, dead_access }, /* access */
|
||||
{ &vop_getattr_desc, dead_getattr }, /* getattr */
|
||||
{ &vop_setattr_desc, dead_setattr }, /* setattr */
|
||||
{ &vop_read_desc, dead_read }, /* read */
|
||||
{ &vop_read_desc, dead_read }, /* read */
|
||||
{ &vop_write_desc, dead_write }, /* write */
|
||||
{ &vop_ioctl_desc, dead_ioctl }, /* ioctl */
|
||||
{ &vop_select_desc, dead_select }, /* select */
|
||||
{ &vop_mmap_desc, dead_mmap }, /* mmap */
|
||||
{ &vop_mmap_desc, dead_mmap }, /* mmap */
|
||||
{ &vop_fsync_desc, dead_fsync }, /* fsync */
|
||||
{ &vop_seek_desc, dead_seek }, /* seek */
|
||||
{ &vop_seek_desc, dead_seek }, /* seek */
|
||||
{ &vop_remove_desc, dead_remove }, /* remove */
|
||||
{ &vop_link_desc, dead_link }, /* link */
|
||||
{ &vop_link_desc, dead_link }, /* link */
|
||||
{ &vop_rename_desc, dead_rename }, /* rename */
|
||||
{ &vop_mkdir_desc, dead_mkdir }, /* mkdir */
|
||||
{ &vop_rmdir_desc, dead_rmdir }, /* rmdir */
|
||||
@ -118,9 +123,9 @@ struct vnodeopv_entry_desc dead_vnodeop_entries[] = {
|
||||
{ &vop_abortop_desc, dead_abortop }, /* abortop */
|
||||
{ &vop_inactive_desc, dead_inactive }, /* inactive */
|
||||
{ &vop_reclaim_desc, dead_reclaim }, /* reclaim */
|
||||
{ &vop_lock_desc, dead_lock }, /* lock */
|
||||
{ &vop_lock_desc, dead_lock }, /* lock */
|
||||
{ &vop_unlock_desc, dead_unlock }, /* unlock */
|
||||
{ &vop_bmap_desc, dead_bmap }, /* bmap */
|
||||
{ &vop_bmap_desc, dead_bmap }, /* bmap */
|
||||
{ &vop_strategy_desc, dead_strategy }, /* strategy */
|
||||
{ &vop_print_desc, dead_print }, /* print */
|
||||
{ &vop_islocked_desc, dead_islocked }, /* islocked */
|
||||
@ -132,7 +137,7 @@ struct vnodeopv_entry_desc dead_vnodeop_entries[] = {
|
||||
{ &vop_truncate_desc, dead_truncate }, /* truncate */
|
||||
{ &vop_update_desc, dead_update }, /* update */
|
||||
{ &vop_bwrite_desc, dead_bwrite }, /* bwrite */
|
||||
{ (struct vnodeop_desc*)NULL, (int(*)())NULL }
|
||||
{ (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL }
|
||||
};
|
||||
struct vnodeopv_desc dead_vnodeop_opv_desc =
|
||||
{ &dead_vnodeop_p, dead_vnodeop_entries };
|
||||
@ -142,13 +147,14 @@ struct vnodeopv_desc dead_vnodeop_opv_desc =
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
int
|
||||
dead_lookup(ap)
|
||||
dead_lookup(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_lookup_args /* {
|
||||
struct vnode * a_dvp;
|
||||
struct vnode ** a_vpp;
|
||||
struct componentname * a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
*ap->a_vpp = NULL;
|
||||
return (ENOTDIR);
|
||||
@ -158,13 +164,9 @@ dead_lookup(ap)
|
||||
* Open always fails as if device did not exist.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
dead_open(ap)
|
||||
struct vop_open_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_mode;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
int
|
||||
dead_open(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (ENXIO);
|
||||
@ -174,14 +176,16 @@ dead_open(ap)
|
||||
* Vnode op for read
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
dead_read(ap)
|
||||
int
|
||||
dead_read(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_read_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
int a_ioflag;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
if (chkvnlock(ap->a_vp))
|
||||
panic("dead_read: lock");
|
||||
@ -197,14 +201,16 @@ dead_read(ap)
|
||||
* Vnode op for write
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
dead_write(ap)
|
||||
int
|
||||
dead_write(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_write_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
int a_ioflag;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
if (chkvnlock(ap->a_vp))
|
||||
panic("dead_write: lock");
|
||||
@ -215,7 +221,10 @@ dead_write(ap)
|
||||
* Device ioctl operation.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
dead_ioctl(ap)
|
||||
int
|
||||
dead_ioctl(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_ioctl_args /* {
|
||||
struct vnode *a_vp;
|
||||
u_long a_command;
|
||||
@ -223,8 +232,7 @@ dead_ioctl(ap)
|
||||
int a_fflag;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
if (!chkvnlock(ap->a_vp))
|
||||
return (EBADF);
|
||||
@ -232,16 +240,10 @@ dead_ioctl(ap)
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
dead_select(ap)
|
||||
struct vop_select_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_which;
|
||||
int a_fflags;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
int
|
||||
dead_select(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
/*
|
||||
* Let the user find out that the descriptor is gone.
|
||||
*/
|
||||
@ -251,12 +253,14 @@ dead_select(ap)
|
||||
/*
|
||||
* Just call the device strategy routine
|
||||
*/
|
||||
dead_strategy(ap)
|
||||
struct vop_strategy_args /* {
|
||||
struct buf *a_bp;
|
||||
} */ *ap;
|
||||
int
|
||||
dead_strategy(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
struct vop_strategy_args /* {
|
||||
struct buf *a_bp;
|
||||
} */ *ap = v;
|
||||
if (ap->a_bp->b_vp == NULL || !chkvnlock(ap->a_bp->b_vp)) {
|
||||
ap->a_bp->b_flags |= B_ERROR;
|
||||
biodone(ap->a_bp);
|
||||
@ -268,11 +272,13 @@ dead_strategy(ap)
|
||||
/*
|
||||
* Wait until the vnode has finished changing state.
|
||||
*/
|
||||
dead_lock(ap)
|
||||
int
|
||||
dead_lock(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_lock_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
if (!chkvnlock(ap->a_vp))
|
||||
return (0);
|
||||
@ -282,15 +288,17 @@ dead_lock(ap)
|
||||
/*
|
||||
* Wait until the vnode has finished changing state.
|
||||
*/
|
||||
dead_bmap(ap)
|
||||
int
|
||||
dead_bmap(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_bmap_args /* {
|
||||
struct vnode *a_vp;
|
||||
daddr_t a_bn;
|
||||
struct vnode **a_vpp;
|
||||
daddr_t *a_bnp;
|
||||
int *a_runp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
if (!chkvnlock(ap->a_vp))
|
||||
return (EIO);
|
||||
@ -301,19 +309,21 @@ dead_bmap(ap)
|
||||
* Print out the contents of a dead vnode.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
dead_print(ap)
|
||||
struct vop_print_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
int
|
||||
dead_print(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
printf("tag VT_NON, dead vnode\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Empty vnode failed operation
|
||||
*/
|
||||
dead_ebadf()
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
dead_ebadf(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (EBADF);
|
||||
@ -322,7 +332,10 @@ dead_ebadf()
|
||||
/*
|
||||
* Empty vnode bad operation
|
||||
*/
|
||||
dead_badop()
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
dead_badop(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
panic("dead_badop called");
|
||||
@ -332,7 +345,10 @@ dead_badop()
|
||||
/*
|
||||
* Empty vnode null operation
|
||||
*/
|
||||
dead_nullop()
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
dead_nullop(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (0);
|
||||
@ -342,6 +358,7 @@ dead_nullop()
|
||||
* We have to wait during times when the vnode is
|
||||
* in a state of change.
|
||||
*/
|
||||
int
|
||||
chkvnlock(vp)
|
||||
register struct vnode *vp;
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fdesc.h,v 1.8 1995/03/29 22:08:11 briggs Exp $ */
|
||||
/* $NetBSD: fdesc.h,v 1.9 1996/02/09 22:40:03 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -75,9 +75,9 @@ struct fdescnode {
|
||||
#define VTOFDESC(vp) ((struct fdescnode *)(vp)->v_data)
|
||||
|
||||
extern dev_t devctty;
|
||||
extern int fdesc_init __P((void));
|
||||
extern void fdesc_init __P((void));
|
||||
extern int fdesc_root __P((struct mount *, struct vnode **));
|
||||
extern int fdesc_allocvp __P((fdntype, int, struct mount *, struct vnode **));
|
||||
extern int (**fdesc_vnodeop_p)();
|
||||
extern int (**fdesc_vnodeop_p) __P((void *));
|
||||
extern struct vfsops fdesc_vfsops;
|
||||
#endif /* _KERNEL */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fdesc_vfsops.c,v 1.20 1995/06/18 14:47:22 cgd Exp $ */
|
||||
/* $NetBSD: fdesc_vfsops.c,v 1.21 1996/02/09 22:40:07 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -57,6 +57,20 @@
|
||||
#include <sys/malloc.h>
|
||||
#include <miscfs/fdesc/fdesc.h>
|
||||
|
||||
int fdesc_mount __P((struct mount *, char *, caddr_t,
|
||||
struct nameidata *, struct proc *));
|
||||
int fdesc_start __P((struct mount *, int, struct proc *));
|
||||
int fdesc_unmount __P((struct mount *, int, struct proc *));
|
||||
int fdesc_root __P((struct mount *, struct vnode **));
|
||||
int fdesc_quotactl __P((struct mount *, int, uid_t, caddr_t,
|
||||
struct proc *));
|
||||
int fdesc_statfs __P((struct mount *, struct statfs *, struct proc *));
|
||||
int fdesc_sync __P((struct mount *, int, struct ucred *, struct proc *));
|
||||
int fdesc_vget __P((struct mount *, ino_t, struct vnode **));
|
||||
int fdesc_fhtovp __P((struct mount *, struct fid *, struct mbuf *,
|
||||
struct vnode **, int *, struct ucred **));
|
||||
int fdesc_vptofh __P((struct vnode *, struct fid *));
|
||||
|
||||
/*
|
||||
* Mount the per-process file descriptors (/dev/fd)
|
||||
*/
|
||||
@ -133,7 +147,7 @@ fdesc_unmount(mp, mntflags, p)
|
||||
*/
|
||||
if (rootvp->v_usecount > 1)
|
||||
return (EBUSY);
|
||||
if (error = vflush(mp, rootvp, flags))
|
||||
if ((error = vflush(mp, rootvp, flags)) != 0)
|
||||
return (error);
|
||||
|
||||
/*
|
||||
@ -236,10 +250,13 @@ fdesc_statfs(mp, sbp, p)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
fdesc_sync(mp, waitfor)
|
||||
fdesc_sync(mp, waitfor, uc, p)
|
||||
struct mount *mp;
|
||||
int waitfor;
|
||||
struct ucred *uc;
|
||||
struct proc *p;
|
||||
{
|
||||
|
||||
return (0);
|
||||
@ -259,22 +276,27 @@ fdesc_vget(mp, ino, vpp)
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
fdesc_fhtovp(mp, fhp, setgen, vpp)
|
||||
fdesc_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp)
|
||||
struct mount *mp;
|
||||
struct fid *fhp;
|
||||
int setgen;
|
||||
struct mbuf *nam;
|
||||
struct vnode **vpp;
|
||||
int *exflagsp;
|
||||
struct ucred **credanonp;
|
||||
{
|
||||
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
fdesc_vptofh(vp, fhp)
|
||||
struct vnode *vp;
|
||||
struct fid *fhp;
|
||||
{
|
||||
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fdesc_vnops.c,v 1.29 1996/02/09 14:45:46 mycroft Exp $ */
|
||||
/* $NetBSD: fdesc_vnops.c,v 1.30 1996/02/09 22:40:10 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -51,6 +51,7 @@
|
||||
#include <sys/proc.h>
|
||||
#include <sys/kernel.h> /* boottime */
|
||||
#include <sys/resourcevar.h>
|
||||
#include <sys/socketvar.h>
|
||||
#include <sys/filedesc.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/malloc.h>
|
||||
@ -60,6 +61,7 @@
|
||||
#include <sys/namei.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/dirent.h>
|
||||
#include <sys/tty.h>
|
||||
#include <miscfs/fdesc/fdesc.h>
|
||||
|
||||
#define cttyvp(p) ((p)->p_flag & P_CONTROLT ? (p)->p_session->s_ttyvp : NULL)
|
||||
@ -81,9 +83,105 @@ FD_STDIN, FD_STDOUT, FD_STDERR must be a sequence n, n+1, n+2
|
||||
LIST_HEAD(fdhashhead, fdescnode) *fdhashtbl;
|
||||
u_long fdhash;
|
||||
|
||||
int fdesc_enotsupp __P((void *));
|
||||
int fdesc_abortop __P((void *));
|
||||
int fdesc_badop __P((void *));
|
||||
int fdesc_nullop __P((void *));
|
||||
int fdesc_lookup __P((void *));
|
||||
#define fdesc_create fdesc_enotsupp
|
||||
#define fdesc_mknod fdesc_enotsupp
|
||||
int fdesc_open __P((void *));
|
||||
#define fdesc_close nullop
|
||||
#define fdesc_access nullop
|
||||
int fdesc_getattr __P((void *));
|
||||
int fdesc_setattr __P((void *));
|
||||
int fdesc_read __P((void *));
|
||||
int fdesc_write __P((void *));
|
||||
int fdesc_ioctl __P((void *));
|
||||
int fdesc_select __P((void *));
|
||||
#define fdesc_mmap fdesc_enotsupp
|
||||
#define fdesc_fsync nullop
|
||||
#define fdesc_seek nullop
|
||||
#define fdesc_remove fdesc_enotsupp
|
||||
#define fdesc_rename fdesc_enotsupp
|
||||
#define fdesc_mkdir fdesc_enotsupp
|
||||
#define fdesc_rmdir fdesc_enotsupp
|
||||
int fdesc_link __P((void *));
|
||||
int fdesc_symlink __P((void *));
|
||||
int fdesc_readdir __P((void *));
|
||||
int fdesc_readlink __P((void *));
|
||||
int fdesc_inactive __P((void *));
|
||||
int fdesc_reclaim __P((void *));
|
||||
#define fdesc_lock nullop
|
||||
#define fdesc_unlock nullop
|
||||
#define fdesc_bmap fdesc_badop
|
||||
#define fdesc_strategy fdesc_badop
|
||||
int fdesc_print __P((void *));
|
||||
#define fdesc_islocked nullop
|
||||
int fdesc_pathconf __P((void *));
|
||||
#define fdesc_advlock fdesc_enotsupp
|
||||
#define fdesc_blkatoff fdesc_enotsupp
|
||||
#define fdesc_valloc fdesc_enotsupp
|
||||
int fdesc_vfree __P((void *));
|
||||
#define fdesc_truncate fdesc_enotsupp
|
||||
#define fdesc_update fdesc_enotsupp
|
||||
#define fdesc_bwrite fdesc_enotsupp
|
||||
|
||||
static int fdesc_attr __P((int, struct vattr *, struct ucred *, struct proc *));
|
||||
|
||||
int (**fdesc_vnodeop_p) __P((void *));
|
||||
struct vnodeopv_entry_desc fdesc_vnodeop_entries[] = {
|
||||
{ &vop_default_desc, vn_default_error },
|
||||
{ &vop_lookup_desc, fdesc_lookup }, /* lookup */
|
||||
{ &vop_create_desc, fdesc_create }, /* create */
|
||||
{ &vop_mknod_desc, fdesc_mknod }, /* mknod */
|
||||
{ &vop_open_desc, fdesc_open }, /* open */
|
||||
{ &vop_close_desc, fdesc_close }, /* close */
|
||||
{ &vop_access_desc, fdesc_access }, /* access */
|
||||
{ &vop_getattr_desc, fdesc_getattr }, /* getattr */
|
||||
{ &vop_setattr_desc, fdesc_setattr }, /* setattr */
|
||||
{ &vop_read_desc, fdesc_read }, /* read */
|
||||
{ &vop_write_desc, fdesc_write }, /* write */
|
||||
{ &vop_ioctl_desc, fdesc_ioctl }, /* ioctl */
|
||||
{ &vop_select_desc, fdesc_select }, /* select */
|
||||
{ &vop_mmap_desc, fdesc_mmap }, /* mmap */
|
||||
{ &vop_fsync_desc, fdesc_fsync }, /* fsync */
|
||||
{ &vop_seek_desc, fdesc_seek }, /* seek */
|
||||
{ &vop_remove_desc, fdesc_remove }, /* remove */
|
||||
{ &vop_link_desc, fdesc_link }, /* link */
|
||||
{ &vop_rename_desc, fdesc_rename }, /* rename */
|
||||
{ &vop_mkdir_desc, fdesc_mkdir }, /* mkdir */
|
||||
{ &vop_rmdir_desc, fdesc_rmdir }, /* rmdir */
|
||||
{ &vop_symlink_desc, fdesc_symlink }, /* symlink */
|
||||
{ &vop_readdir_desc, fdesc_readdir }, /* readdir */
|
||||
{ &vop_readlink_desc, fdesc_readlink }, /* readlink */
|
||||
{ &vop_abortop_desc, fdesc_abortop }, /* abortop */
|
||||
{ &vop_inactive_desc, fdesc_inactive }, /* inactive */
|
||||
{ &vop_reclaim_desc, fdesc_reclaim }, /* reclaim */
|
||||
{ &vop_lock_desc, fdesc_lock }, /* lock */
|
||||
{ &vop_unlock_desc, fdesc_unlock }, /* unlock */
|
||||
{ &vop_bmap_desc, fdesc_bmap }, /* bmap */
|
||||
{ &vop_strategy_desc, fdesc_strategy }, /* strategy */
|
||||
{ &vop_print_desc, fdesc_print }, /* print */
|
||||
{ &vop_islocked_desc, fdesc_islocked }, /* islocked */
|
||||
{ &vop_pathconf_desc, fdesc_pathconf }, /* pathconf */
|
||||
{ &vop_advlock_desc, fdesc_advlock }, /* advlock */
|
||||
{ &vop_blkatoff_desc, fdesc_blkatoff }, /* blkatoff */
|
||||
{ &vop_valloc_desc, fdesc_valloc }, /* valloc */
|
||||
{ &vop_vfree_desc, fdesc_vfree }, /* vfree */
|
||||
{ &vop_truncate_desc, fdesc_truncate }, /* truncate */
|
||||
{ &vop_update_desc, fdesc_update }, /* update */
|
||||
{ &vop_bwrite_desc, fdesc_bwrite }, /* bwrite */
|
||||
{ (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL }
|
||||
};
|
||||
|
||||
struct vnodeopv_desc fdesc_vnodeop_opv_desc =
|
||||
{ &fdesc_vnodeop_p, fdesc_vnodeop_entries };
|
||||
|
||||
/*
|
||||
* Initialise cache headers
|
||||
*/
|
||||
void
|
||||
fdesc_init()
|
||||
{
|
||||
|
||||
@ -152,19 +250,20 @@ out:;
|
||||
* ndp is the name to locate in that directory...
|
||||
*/
|
||||
int
|
||||
fdesc_lookup(ap)
|
||||
fdesc_lookup(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_lookup_args /* {
|
||||
struct vnode * a_dvp;
|
||||
struct vnode ** a_vpp;
|
||||
struct componentname * a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct vnode **vpp = ap->a_vpp;
|
||||
struct vnode *dvp = ap->a_dvp;
|
||||
char *pname;
|
||||
struct proc *p;
|
||||
int nfiles;
|
||||
unsigned fd;
|
||||
unsigned fd = 0;
|
||||
int error;
|
||||
struct vnode *fvp;
|
||||
char *ln;
|
||||
@ -287,14 +386,15 @@ bad:;
|
||||
}
|
||||
|
||||
int
|
||||
fdesc_open(ap)
|
||||
fdesc_open(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_open_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_mode;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
|
||||
switch (VTOFDESC(vp)->fd_type) {
|
||||
@ -312,6 +412,10 @@ fdesc_open(ap)
|
||||
|
||||
case Fctty:
|
||||
return (cttyopen(devctty, ap->a_mode, 0, ap->a_p));
|
||||
case Froot:
|
||||
case Fdevfd:
|
||||
case Flink:
|
||||
break;
|
||||
}
|
||||
|
||||
return (0);
|
||||
@ -376,14 +480,15 @@ fdesc_attr(fd, vap, cred, p)
|
||||
}
|
||||
|
||||
int
|
||||
fdesc_getattr(ap)
|
||||
fdesc_getattr(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_getattr_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct vattr *a_vap;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct vattr *vap = ap->a_vap;
|
||||
unsigned fd;
|
||||
@ -398,23 +503,27 @@ fdesc_getattr(ap)
|
||||
vattr_null(vap);
|
||||
vap->va_fileid = VTOFDESC(vp)->fd_ix;
|
||||
|
||||
#define R_ALL (S_IRUSR|S_IRGRP|S_IROTH)
|
||||
#define W_ALL (S_IWUSR|S_IWGRP|S_IWOTH)
|
||||
#define X_ALL (S_IXUSR|S_IXGRP|S_IXOTH)
|
||||
|
||||
switch (VTOFDESC(vp)->fd_type) {
|
||||
case Flink:
|
||||
vap->va_mode = S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH;
|
||||
vap->va_mode = R_ALL|X_ALL;
|
||||
vap->va_type = VLNK;
|
||||
vap->va_nlink = 1;
|
||||
vap->va_size = strlen(VTOFDESC(vp)->fd_link);
|
||||
break;
|
||||
|
||||
case Fctty:
|
||||
vap->va_mode = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH;
|
||||
vap->va_mode = R_ALL|W_ALL;
|
||||
vap->va_type = VFIFO;
|
||||
vap->va_nlink = 1;
|
||||
vap->va_size = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
vap->va_mode = S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH;
|
||||
vap->va_mode = R_ALL|X_ALL;
|
||||
vap->va_type = VDIR;
|
||||
vap->va_nlink = 2;
|
||||
vap->va_size = DEV_BSIZE;
|
||||
@ -451,14 +560,15 @@ fdesc_getattr(ap)
|
||||
}
|
||||
|
||||
int
|
||||
fdesc_setattr(ap)
|
||||
fdesc_setattr(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_setattr_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct vattr *a_vap;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct filedesc *fdp = ap->a_p->p_fd;
|
||||
struct file *fp;
|
||||
unsigned fd;
|
||||
@ -523,7 +633,9 @@ struct fdesc_target {
|
||||
static int nfdesc_targets = sizeof(fdesc_targets) / sizeof(fdesc_targets[0]);
|
||||
|
||||
int
|
||||
fdesc_readdir(ap)
|
||||
fdesc_readdir(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_readdir_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
@ -531,8 +643,7 @@ fdesc_readdir(ap)
|
||||
int *a_eofflag;
|
||||
u_long *a_cookies;
|
||||
int a_ncookies;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct uio *uio = ap->a_uio;
|
||||
struct dirent d;
|
||||
struct filedesc *fdp;
|
||||
@ -547,6 +658,9 @@ fdesc_readdir(ap)
|
||||
|
||||
case Fdesc:
|
||||
return (ENOTDIR);
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
fdp = uio->uio_procp->p_fd;
|
||||
@ -587,7 +701,7 @@ fdesc_readdir(ap)
|
||||
bcopy(ft->ft_name, d.d_name, ft->ft_namlen + 1);
|
||||
d.d_type = ft->ft_type;
|
||||
|
||||
if (error = uiomove((caddr_t)&d, UIO_MX, uio))
|
||||
if ((error = uiomove((caddr_t)&d, UIO_MX, uio)) != 0)
|
||||
break;
|
||||
if (ncookies-- > 0)
|
||||
*cookies++ = i + 1;
|
||||
@ -614,7 +728,7 @@ fdesc_readdir(ap)
|
||||
break;
|
||||
}
|
||||
|
||||
if (error = uiomove((caddr_t)&d, UIO_MX, uio))
|
||||
if ((error = uiomove((caddr_t)&d, UIO_MX, uio)) != 0)
|
||||
break;
|
||||
if (ncookies-- > 0)
|
||||
*cookies++ = i + 1;
|
||||
@ -626,13 +740,14 @@ fdesc_readdir(ap)
|
||||
}
|
||||
|
||||
int
|
||||
fdesc_readlink(ap)
|
||||
fdesc_readlink(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_readlink_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
int error;
|
||||
|
||||
@ -650,14 +765,15 @@ fdesc_readlink(ap)
|
||||
}
|
||||
|
||||
int
|
||||
fdesc_read(ap)
|
||||
fdesc_read(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_read_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
int a_ioflag;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
int error = EOPNOTSUPP;
|
||||
|
||||
switch (VTOFDESC(ap->a_vp)->fd_type) {
|
||||
@ -674,14 +790,15 @@ fdesc_read(ap)
|
||||
}
|
||||
|
||||
int
|
||||
fdesc_write(ap)
|
||||
fdesc_write(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_write_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
int a_ioflag;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
int error = EOPNOTSUPP;
|
||||
|
||||
switch (VTOFDESC(ap->a_vp)->fd_type) {
|
||||
@ -698,7 +815,9 @@ fdesc_write(ap)
|
||||
}
|
||||
|
||||
int
|
||||
fdesc_ioctl(ap)
|
||||
fdesc_ioctl(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_ioctl_args /* {
|
||||
struct vnode *a_vp;
|
||||
u_long a_command;
|
||||
@ -706,14 +825,13 @@ fdesc_ioctl(ap)
|
||||
int a_fflag;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
int error = EOPNOTSUPP;
|
||||
|
||||
switch (VTOFDESC(ap->a_vp)->fd_type) {
|
||||
case Fctty:
|
||||
error = cttyioctl(devctty, ap->a_command, ap->a_data,
|
||||
ap->a_fflag, ap->a_p);
|
||||
ap->a_fflag, ap->a_p);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -725,15 +843,16 @@ fdesc_ioctl(ap)
|
||||
}
|
||||
|
||||
int
|
||||
fdesc_select(ap)
|
||||
fdesc_select(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_select_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_which;
|
||||
int a_fflags;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
int error = EOPNOTSUPP;
|
||||
|
||||
switch (VTOFDESC(ap->a_vp)->fd_type) {
|
||||
@ -750,11 +869,12 @@ fdesc_select(ap)
|
||||
}
|
||||
|
||||
int
|
||||
fdesc_inactive(ap)
|
||||
fdesc_inactive(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_inactive_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
|
||||
/*
|
||||
@ -766,11 +886,12 @@ fdesc_inactive(ap)
|
||||
}
|
||||
|
||||
int
|
||||
fdesc_reclaim(ap)
|
||||
fdesc_reclaim(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_reclaim_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct fdescnode *fd = VTOFDESC(vp);
|
||||
|
||||
@ -784,13 +905,15 @@ fdesc_reclaim(ap)
|
||||
/*
|
||||
* Return POSIX pathconf information applicable to special devices.
|
||||
*/
|
||||
fdesc_pathconf(ap)
|
||||
int
|
||||
fdesc_pathconf(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_pathconf_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_name;
|
||||
register_t *a_retval;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
switch (ap->a_name) {
|
||||
case _PC_LINK_MAX:
|
||||
@ -822,37 +945,29 @@ fdesc_pathconf(ap)
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
int
|
||||
fdesc_print(ap)
|
||||
struct vop_print_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
fdesc_print(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
printf("tag VT_NON, fdesc vnode\n");
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*void*/
|
||||
int
|
||||
fdesc_vfree(ap)
|
||||
struct vop_vfree_args /* {
|
||||
struct vnode *a_pvp;
|
||||
ino_t a_ino;
|
||||
int a_mode;
|
||||
} */ *ap;
|
||||
fdesc_vfree(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
fdesc_link(ap)
|
||||
fdesc_link(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_link_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode *a_vp;
|
||||
struct componentname *a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
VOP_ABORTOP(ap->a_dvp, ap->a_cnp);
|
||||
vput(ap->a_dvp);
|
||||
@ -860,15 +975,16 @@ fdesc_link(ap)
|
||||
}
|
||||
|
||||
int
|
||||
fdesc_symlink(ap)
|
||||
fdesc_symlink(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_symlink_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode **a_vpp;
|
||||
struct componentname *a_cnp;
|
||||
struct vattr *a_vap;
|
||||
char *a_target;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
VOP_ABORTOP(ap->a_dvp, ap->a_cnp);
|
||||
vput(ap->a_dvp);
|
||||
@ -876,12 +992,13 @@ fdesc_symlink(ap)
|
||||
}
|
||||
|
||||
int
|
||||
fdesc_abortop(ap)
|
||||
fdesc_abortop(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_abortop_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct componentname *a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF)
|
||||
FREE(ap->a_cnp->cn_pnbuf, M_NAMEI);
|
||||
@ -891,8 +1008,10 @@ fdesc_abortop(ap)
|
||||
/*
|
||||
* /dev/fd vnode unsupported operation
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
fdesc_enotsupp()
|
||||
fdesc_enotsupp(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (EOPNOTSUPP);
|
||||
@ -901,8 +1020,10 @@ fdesc_enotsupp()
|
||||
/*
|
||||
* /dev/fd "should never get here" operation
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
fdesc_badop()
|
||||
fdesc_badop(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
panic("fdesc: bad op");
|
||||
@ -912,87 +1033,11 @@ fdesc_badop()
|
||||
/*
|
||||
* /dev/fd vnode null operation
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
fdesc_nullop()
|
||||
fdesc_nullop(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
#define fdesc_create ((int (*) __P((struct vop_create_args *)))fdesc_enotsupp)
|
||||
#define fdesc_mknod ((int (*) __P((struct vop_mknod_args *)))fdesc_enotsupp)
|
||||
#define fdesc_close ((int (*) __P((struct vop_close_args *)))nullop)
|
||||
#define fdesc_access ((int (*) __P((struct vop_access_args *)))nullop)
|
||||
#define fdesc_mmap ((int (*) __P((struct vop_mmap_args *)))fdesc_enotsupp)
|
||||
#define fdesc_fsync ((int (*) __P((struct vop_fsync_args *)))nullop)
|
||||
#define fdesc_seek ((int (*) __P((struct vop_seek_args *)))nullop)
|
||||
#define fdesc_remove ((int (*) __P((struct vop_remove_args *)))fdesc_enotsupp)
|
||||
#define fdesc_rename ((int (*) __P((struct vop_rename_args *)))fdesc_enotsupp)
|
||||
#define fdesc_mkdir ((int (*) __P((struct vop_mkdir_args *)))fdesc_enotsupp)
|
||||
#define fdesc_rmdir ((int (*) __P((struct vop_rmdir_args *)))fdesc_enotsupp)
|
||||
#define fdesc_lock ((int (*) __P((struct vop_lock_args *)))nullop)
|
||||
#define fdesc_unlock ((int (*) __P((struct vop_unlock_args *)))nullop)
|
||||
#define fdesc_bmap ((int (*) __P((struct vop_bmap_args *)))fdesc_badop)
|
||||
#define fdesc_strategy ((int (*) __P((struct vop_strategy_args *)))fdesc_badop)
|
||||
#define fdesc_islocked ((int (*) __P((struct vop_islocked_args *)))nullop)
|
||||
#define fdesc_advlock ((int (*) __P((struct vop_advlock_args *)))fdesc_enotsupp)
|
||||
#define fdesc_blkatoff \
|
||||
((int (*) __P((struct vop_blkatoff_args *)))fdesc_enotsupp)
|
||||
#define fdesc_vget ((int (*) __P((struct vop_vget_args *)))fdesc_enotsupp)
|
||||
#define fdesc_valloc ((int(*) __P(( \
|
||||
struct vnode *pvp, \
|
||||
int mode, \
|
||||
struct ucred *cred, \
|
||||
struct vnode **vpp))) fdesc_enotsupp)
|
||||
#define fdesc_truncate \
|
||||
((int (*) __P((struct vop_truncate_args *)))fdesc_enotsupp)
|
||||
#define fdesc_update ((int (*) __P((struct vop_update_args *)))fdesc_enotsupp)
|
||||
#define fdesc_bwrite ((int (*) __P((struct vop_bwrite_args *)))fdesc_enotsupp)
|
||||
|
||||
int (**fdesc_vnodeop_p)();
|
||||
struct vnodeopv_entry_desc fdesc_vnodeop_entries[] = {
|
||||
{ &vop_default_desc, vn_default_error },
|
||||
{ &vop_lookup_desc, fdesc_lookup }, /* lookup */
|
||||
{ &vop_create_desc, fdesc_create }, /* create */
|
||||
{ &vop_mknod_desc, fdesc_mknod }, /* mknod */
|
||||
{ &vop_open_desc, fdesc_open }, /* open */
|
||||
{ &vop_close_desc, fdesc_close }, /* close */
|
||||
{ &vop_access_desc, fdesc_access }, /* access */
|
||||
{ &vop_getattr_desc, fdesc_getattr }, /* getattr */
|
||||
{ &vop_setattr_desc, fdesc_setattr }, /* setattr */
|
||||
{ &vop_read_desc, fdesc_read }, /* read */
|
||||
{ &vop_write_desc, fdesc_write }, /* write */
|
||||
{ &vop_ioctl_desc, fdesc_ioctl }, /* ioctl */
|
||||
{ &vop_select_desc, fdesc_select }, /* select */
|
||||
{ &vop_mmap_desc, fdesc_mmap }, /* mmap */
|
||||
{ &vop_fsync_desc, fdesc_fsync }, /* fsync */
|
||||
{ &vop_seek_desc, fdesc_seek }, /* seek */
|
||||
{ &vop_remove_desc, fdesc_remove }, /* remove */
|
||||
{ &vop_link_desc, fdesc_link }, /* link */
|
||||
{ &vop_rename_desc, fdesc_rename }, /* rename */
|
||||
{ &vop_mkdir_desc, fdesc_mkdir }, /* mkdir */
|
||||
{ &vop_rmdir_desc, fdesc_rmdir }, /* rmdir */
|
||||
{ &vop_symlink_desc, fdesc_symlink }, /* symlink */
|
||||
{ &vop_readdir_desc, fdesc_readdir }, /* readdir */
|
||||
{ &vop_readlink_desc, fdesc_readlink }, /* readlink */
|
||||
{ &vop_abortop_desc, fdesc_abortop }, /* abortop */
|
||||
{ &vop_inactive_desc, fdesc_inactive }, /* inactive */
|
||||
{ &vop_reclaim_desc, fdesc_reclaim }, /* reclaim */
|
||||
{ &vop_lock_desc, fdesc_lock }, /* lock */
|
||||
{ &vop_unlock_desc, fdesc_unlock }, /* unlock */
|
||||
{ &vop_bmap_desc, fdesc_bmap }, /* bmap */
|
||||
{ &vop_strategy_desc, fdesc_strategy }, /* strategy */
|
||||
{ &vop_print_desc, fdesc_print }, /* print */
|
||||
{ &vop_islocked_desc, fdesc_islocked }, /* islocked */
|
||||
{ &vop_pathconf_desc, fdesc_pathconf }, /* pathconf */
|
||||
{ &vop_advlock_desc, fdesc_advlock }, /* advlock */
|
||||
{ &vop_blkatoff_desc, fdesc_blkatoff }, /* blkatoff */
|
||||
{ &vop_valloc_desc, fdesc_valloc }, /* valloc */
|
||||
{ &vop_vfree_desc, fdesc_vfree }, /* vfree */
|
||||
{ &vop_truncate_desc, fdesc_truncate }, /* truncate */
|
||||
{ &vop_update_desc, fdesc_update }, /* update */
|
||||
{ &vop_bwrite_desc, fdesc_bwrite }, /* bwrite */
|
||||
{ (struct vnodeop_desc*)NULL, (int(*)())NULL }
|
||||
};
|
||||
struct vnodeopv_desc fdesc_vnodeop_opv_desc =
|
||||
{ &fdesc_vnodeop_p, fdesc_vnodeop_entries };
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fifo.h,v 1.9 1994/12/13 20:14:38 mycroft Exp $ */
|
||||
/* $NetBSD: fifo.h,v 1.10 1996/02/09 22:40:15 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991, 1993
|
||||
@ -34,55 +34,59 @@
|
||||
*
|
||||
* @(#)fifo.h 8.3 (Berkeley) 8/10/94
|
||||
*/
|
||||
|
||||
#ifdef FIFO
|
||||
|
||||
/*
|
||||
* Prototypes for fifo operations on vnodes.
|
||||
*/
|
||||
int fifo_badop(),
|
||||
fifo_ebadf();
|
||||
int fifo_badop __P((void *));
|
||||
int fifo_ebadf __P((void *));
|
||||
|
||||
int fifo_lookup __P((void *));
|
||||
#define fifo_create fifo_badop
|
||||
#define fifo_mknod fifo_badop
|
||||
int fifo_open __P((void *));
|
||||
int fifo_close __P((void *));
|
||||
#define fifo_access fifo_ebadf
|
||||
#define fifo_getattr fifo_ebadf
|
||||
#define fifo_setattr fifo_ebadf
|
||||
int fifo_read __P((void *));
|
||||
int fifo_write __P((void *));
|
||||
#define fifo_lease_check nullop
|
||||
int fifo_ioctl __P((void *));
|
||||
int fifo_select __P((void *));
|
||||
#define fifo_mmap fifo_badop
|
||||
#define fifo_fsync nullop
|
||||
#define fifo_seek fifo_badop
|
||||
#define fifo_remove fifo_badop
|
||||
#define fifo_link fifo_badop
|
||||
#define fifo_rename fifo_badop
|
||||
#define fifo_mkdir fifo_badop
|
||||
#define fifo_rmdir fifo_badop
|
||||
#define fifo_symlink fifo_badop
|
||||
#define fifo_readdir fifo_badop
|
||||
#define fifo_readlink fifo_badop
|
||||
#define fifo_abortop fifo_badop
|
||||
#define fifo_inactive nullop
|
||||
#define fifo_reclaim nullop
|
||||
int fifo_lock __P((void *));
|
||||
int fifo_unlock __P((void *));
|
||||
int fifo_bmap __P((void *));
|
||||
#define fifo_strategy fifo_badop
|
||||
int fifo_print __P((void *));
|
||||
#define fifo_islocked nullop
|
||||
int fifo_pathconf __P((void *));
|
||||
int fifo_advlock __P((void *));
|
||||
#define fifo_blkatoff fifo_badop
|
||||
#define fifo_valloc fifo_badop
|
||||
#define fifo_reallocblks fifo_badop
|
||||
#define fifo_vfree fifo_badop
|
||||
#define fifo_truncate nullop
|
||||
#define fifo_update nullop
|
||||
#define fifo_bwrite nullop
|
||||
|
||||
void fifo_printinfo __P((struct vnode *));
|
||||
|
||||
extern int (**fifo_vnodeop_p) __P((void *));
|
||||
|
||||
int fifo_lookup __P((struct vop_lookup_args *));
|
||||
#define fifo_create ((int (*) __P((struct vop_create_args *)))fifo_badop)
|
||||
#define fifo_mknod ((int (*) __P((struct vop_mknod_args *)))fifo_badop)
|
||||
int fifo_open __P((struct vop_open_args *));
|
||||
int fifo_close __P((struct vop_close_args *));
|
||||
#define fifo_access ((int (*) __P((struct vop_access_args *)))fifo_ebadf)
|
||||
#define fifo_getattr ((int (*) __P((struct vop_getattr_args *)))fifo_ebadf)
|
||||
#define fifo_setattr ((int (*) __P((struct vop_setattr_args *)))fifo_ebadf)
|
||||
int fifo_read __P((struct vop_read_args *));
|
||||
int fifo_write __P((struct vop_write_args *));
|
||||
#define fifo_lease_check ((int (*) __P((struct vop_lease_args *)))nullop)
|
||||
int fifo_ioctl __P((struct vop_ioctl_args *));
|
||||
int fifo_select __P((struct vop_select_args *));
|
||||
#define fifo_mmap ((int (*) __P((struct vop_mmap_args *)))fifo_badop)
|
||||
#define fifo_fsync ((int (*) __P((struct vop_fsync_args *)))nullop)
|
||||
#define fifo_seek ((int (*) __P((struct vop_seek_args *)))fifo_badop)
|
||||
#define fifo_remove ((int (*) __P((struct vop_remove_args *)))fifo_badop)
|
||||
#define fifo_link ((int (*) __P((struct vop_link_args *)))fifo_badop)
|
||||
#define fifo_rename ((int (*) __P((struct vop_rename_args *)))fifo_badop)
|
||||
#define fifo_mkdir ((int (*) __P((struct vop_mkdir_args *)))fifo_badop)
|
||||
#define fifo_rmdir ((int (*) __P((struct vop_rmdir_args *)))fifo_badop)
|
||||
#define fifo_symlink ((int (*) __P((struct vop_symlink_args *)))fifo_badop)
|
||||
#define fifo_readdir ((int (*) __P((struct vop_readdir_args *)))fifo_badop)
|
||||
#define fifo_readlink ((int (*) __P((struct vop_readlink_args *)))fifo_badop)
|
||||
#define fifo_abortop ((int (*) __P((struct vop_abortop_args *)))fifo_badop)
|
||||
#define fifo_inactive ((int (*) __P((struct vop_inactive_args *)))nullop)
|
||||
#define fifo_reclaim ((int (*) __P((struct vop_reclaim_args *)))nullop)
|
||||
int fifo_lock __P((struct vop_lock_args *));
|
||||
int fifo_unlock __P((struct vop_unlock_args *));
|
||||
int fifo_bmap __P((struct vop_bmap_args *));
|
||||
#define fifo_strategy ((int (*) __P((struct vop_strategy_args *)))fifo_badop)
|
||||
int fifo_print __P((struct vop_print_args *));
|
||||
#define fifo_islocked ((int (*) __P((struct vop_islocked_args *)))nullop)
|
||||
int fifo_pathconf __P((struct vop_pathconf_args *));
|
||||
int fifo_advlock __P((struct vop_advlock_args *));
|
||||
#define fifo_blkatoff ((int (*) __P((struct vop_blkatoff_args *)))fifo_badop)
|
||||
#define fifo_valloc ((int (*) __P((struct vop_valloc_args *)))fifo_badop)
|
||||
#define fifo_reallocblks \
|
||||
((int (*) __P((struct vop_reallocblks_args *)))fifo_badop)
|
||||
#define fifo_vfree ((int (*) __P((struct vop_vfree_args *)))fifo_badop)
|
||||
#define fifo_truncate ((int (*) __P((struct vop_truncate_args *)))nullop)
|
||||
#define fifo_update ((int (*) __P((struct vop_update_args *)))nullop)
|
||||
#define fifo_bwrite ((int (*) __P((struct vop_bwrite_args *)))nullop)
|
||||
#endif /* FIFO */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fifo_vnops.c,v 1.16 1995/04/14 23:30:14 mycroft Exp $ */
|
||||
/* $NetBSD: fifo_vnops.c,v 1.17 1996/02/09 22:40:16 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1990, 1993
|
||||
@ -48,6 +48,7 @@
|
||||
#include <sys/file.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/un.h>
|
||||
#include <miscfs/fifofs/fifo.h>
|
||||
|
||||
/*
|
||||
@ -61,7 +62,7 @@ struct fifoinfo {
|
||||
long fi_writers;
|
||||
};
|
||||
|
||||
int (**fifo_vnodeop_p)();
|
||||
int (**fifo_vnodeop_p) __P((void *));
|
||||
struct vnodeopv_entry_desc fifo_vnodeop_entries[] = {
|
||||
{ &vop_default_desc, vn_default_error },
|
||||
{ &vop_lookup_desc, fifo_lookup }, /* lookup */
|
||||
@ -105,7 +106,7 @@ struct vnodeopv_entry_desc fifo_vnodeop_entries[] = {
|
||||
{ &vop_truncate_desc, fifo_truncate }, /* truncate */
|
||||
{ &vop_update_desc, fifo_update }, /* update */
|
||||
{ &vop_bwrite_desc, fifo_bwrite }, /* bwrite */
|
||||
{ (struct vnodeop_desc*)NULL, (int(*)())NULL }
|
||||
{ (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL }
|
||||
};
|
||||
struct vnodeopv_desc fifo_vnodeop_opv_desc =
|
||||
{ &fifo_vnodeop_p, fifo_vnodeop_entries };
|
||||
@ -114,13 +115,15 @@ struct vnodeopv_desc fifo_vnodeop_opv_desc =
|
||||
* Trivial lookup routine that always fails.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
fifo_lookup(ap)
|
||||
int
|
||||
fifo_lookup(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_lookup_args /* {
|
||||
struct vnode * a_dvp;
|
||||
struct vnode ** a_vpp;
|
||||
struct componentname * a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
*ap->a_vpp = NULL;
|
||||
return (ENOTDIR);
|
||||
@ -131,14 +134,16 @@ fifo_lookup(ap)
|
||||
* to find an active instance of a fifo.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
fifo_open(ap)
|
||||
int
|
||||
fifo_open(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_open_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_mode;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
register struct vnode *vp = ap->a_vp;
|
||||
register struct fifoinfo *fip;
|
||||
struct socket *rso, *wso;
|
||||
@ -148,20 +153,20 @@ fifo_open(ap)
|
||||
if ((fip = vp->v_fifoinfo) == NULL) {
|
||||
MALLOC(fip, struct fifoinfo *, sizeof(*fip), M_VNODE, M_WAITOK);
|
||||
vp->v_fifoinfo = fip;
|
||||
if (error = socreate(AF_LOCAL, &rso, SOCK_STREAM, 0)) {
|
||||
if ((error = socreate(AF_LOCAL, &rso, SOCK_STREAM, 0)) != 0) {
|
||||
free(fip, M_VNODE);
|
||||
vp->v_fifoinfo = NULL;
|
||||
return (error);
|
||||
}
|
||||
fip->fi_readsock = rso;
|
||||
if (error = socreate(AF_LOCAL, &wso, SOCK_STREAM, 0)) {
|
||||
if ((error = socreate(AF_LOCAL, &wso, SOCK_STREAM, 0)) != 0) {
|
||||
(void)soclose(rso);
|
||||
free(fip, M_VNODE);
|
||||
vp->v_fifoinfo = NULL;
|
||||
return (error);
|
||||
}
|
||||
fip->fi_writesock = wso;
|
||||
if (error = unp_connect2(wso, rso)) {
|
||||
if ((error = unp_connect2(wso, rso)) != 0) {
|
||||
(void)soclose(wso);
|
||||
(void)soclose(rso);
|
||||
free(fip, M_VNODE);
|
||||
@ -226,14 +231,16 @@ bad:
|
||||
* Vnode op for read
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
fifo_read(ap)
|
||||
int
|
||||
fifo_read(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_read_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
int a_ioflag;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
register struct uio *uio = ap->a_uio;
|
||||
register struct socket *rso = ap->a_vp->v_fifoinfo->fi_readsock;
|
||||
int error, startresid;
|
||||
@ -265,14 +272,16 @@ fifo_read(ap)
|
||||
* Vnode op for write
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
fifo_write(ap)
|
||||
int
|
||||
fifo_write(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_write_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
int a_ioflag;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct socket *wso = ap->a_vp->v_fifoinfo->fi_writesock;
|
||||
int error;
|
||||
|
||||
@ -294,7 +303,10 @@ fifo_write(ap)
|
||||
* Device ioctl operation.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
fifo_ioctl(ap)
|
||||
int
|
||||
fifo_ioctl(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_ioctl_args /* {
|
||||
struct vnode *a_vp;
|
||||
u_long a_command;
|
||||
@ -302,8 +314,7 @@ fifo_ioctl(ap)
|
||||
int a_fflag;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct file filetmp;
|
||||
int error;
|
||||
|
||||
@ -325,15 +336,17 @@ fifo_ioctl(ap)
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
fifo_select(ap)
|
||||
int
|
||||
fifo_select(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_select_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_which;
|
||||
int a_fflags;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct file filetmp;
|
||||
int ready;
|
||||
|
||||
@ -355,14 +368,16 @@ fifo_select(ap)
|
||||
/*
|
||||
* This is a noop, simply returning what one has been given.
|
||||
*/
|
||||
fifo_bmap(ap)
|
||||
int
|
||||
fifo_bmap(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_bmap_args /* {
|
||||
struct vnode *a_vp;
|
||||
daddr_t a_bn;
|
||||
struct vnode **a_vpp;
|
||||
daddr_t *a_bnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
if (ap->a_vpp != NULL)
|
||||
*ap->a_vpp = ap->a_vp;
|
||||
@ -375,20 +390,17 @@ fifo_bmap(ap)
|
||||
* At the moment we do not do any locking.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
fifo_lock(ap)
|
||||
struct vop_lock_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
int
|
||||
fifo_lock(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
fifo_unlock(ap)
|
||||
struct vop_unlock_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
int
|
||||
fifo_unlock(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (0);
|
||||
@ -398,14 +410,16 @@ fifo_unlock(ap)
|
||||
* Device close routine
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
fifo_close(ap)
|
||||
int
|
||||
fifo_close(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_close_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_fflag;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
register struct vnode *vp = ap->a_vp;
|
||||
register struct fifoinfo *fip = vp->v_fifoinfo;
|
||||
int error1, error2;
|
||||
@ -432,20 +446,24 @@ fifo_close(ap)
|
||||
/*
|
||||
* Print out the contents of a fifo vnode.
|
||||
*/
|
||||
fifo_print(ap)
|
||||
int
|
||||
fifo_print(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_print_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
printf("tag VT_NON");
|
||||
fifo_printinfo(ap->a_vp);
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Print out internal contents of a fifo vnode.
|
||||
*/
|
||||
void
|
||||
fifo_printinfo(vp)
|
||||
struct vnode *vp;
|
||||
{
|
||||
@ -458,13 +476,15 @@ fifo_printinfo(vp)
|
||||
/*
|
||||
* Return POSIX pathconf information applicable to fifo's.
|
||||
*/
|
||||
fifo_pathconf(ap)
|
||||
int
|
||||
fifo_pathconf(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_pathconf_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_name;
|
||||
register_t *a_retval;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
switch (ap->a_name) {
|
||||
case _PC_LINK_MAX:
|
||||
@ -485,7 +505,10 @@ fifo_pathconf(ap)
|
||||
/*
|
||||
* Fifo failed operation
|
||||
*/
|
||||
fifo_ebadf()
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
fifo_ebadf(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (EBADF);
|
||||
@ -495,23 +518,20 @@ fifo_ebadf()
|
||||
* Fifo advisory byte-level locks.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
fifo_advlock(ap)
|
||||
struct vop_advlock_args /* {
|
||||
struct vnode *a_vp;
|
||||
caddr_t a_id;
|
||||
int a_op;
|
||||
struct flock *a_fl;
|
||||
int a_flags;
|
||||
} */ *ap;
|
||||
int
|
||||
fifo_advlock(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
/*
|
||||
* Fifo bad operation
|
||||
*/
|
||||
fifo_badop()
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
fifo_badop(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
panic("fifo_badop called");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kernfs.h,v 1.9 1995/03/29 22:08:22 briggs Exp $ */
|
||||
/* $NetBSD: kernfs.h,v 1.10 1996/02/09 22:40:21 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -52,7 +52,7 @@ struct kernfs_node {
|
||||
#define VFSTOKERNFS(mp) ((struct kernfs_mount *)((mp)->mnt_data))
|
||||
#define VTOKERN(vp) ((struct kernfs_node *)(vp)->v_data)
|
||||
|
||||
extern int (**kernfs_vnodeop_p)();
|
||||
extern int (**kernfs_vnodeop_p) __P((void *));
|
||||
extern struct vfsops kernfs_vfsops;
|
||||
extern dev_t rrootdev;
|
||||
#endif /* _KERNEL */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kernfs_vfsops.c,v 1.24 1995/06/18 14:47:27 cgd Exp $ */
|
||||
/* $NetBSD: kernfs_vfsops.c,v 1.25 1996/02/09 22:40:22 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -51,15 +51,33 @@
|
||||
#include <sys/mount.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/cpu.h>
|
||||
|
||||
#include <miscfs/specfs/specdev.h>
|
||||
#include <miscfs/kernfs/kernfs.h>
|
||||
|
||||
dev_t rrootdev = NODEV;
|
||||
|
||||
void kernfs_init __P((void));
|
||||
void kernfs_get_rrootdev __P((void));
|
||||
int kernfs_mount __P((struct mount *, char *, caddr_t, struct nameidata *,
|
||||
struct proc *));
|
||||
int kernfs_start __P((struct mount *, int, struct proc *));
|
||||
int kernfs_unmount __P((struct mount *, int, struct proc *));
|
||||
int kernfs_root __P((struct mount *, struct vnode **));
|
||||
int kernfs_statfs __P((struct mount *, struct statfs *, struct proc *));
|
||||
int kernfs_quotactl __P((struct mount *, int, uid_t, caddr_t,
|
||||
struct proc *));
|
||||
int kernfs_sync __P((struct mount *, int, struct ucred *, struct proc *));
|
||||
int kernfs_vget __P((struct mount *, ino_t, struct vnode **));
|
||||
int kernfs_fhtovp __P((struct mount *, struct fid *, struct mbuf *,
|
||||
struct vnode **, int *, struct ucred **));
|
||||
int kernfs_vptofh __P((struct vnode *, struct fid *));
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
kernfs_init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
@ -88,6 +106,7 @@ kernfs_get_rrootdev()
|
||||
/*
|
||||
* Mount the Kernel params filesystem
|
||||
*/
|
||||
int
|
||||
kernfs_mount(mp, path, data, ndp, p)
|
||||
struct mount *mp;
|
||||
char *path;
|
||||
@ -110,7 +129,8 @@ kernfs_mount(mp, path, data, ndp, p)
|
||||
if (mp->mnt_flag & MNT_UPDATE)
|
||||
return (EOPNOTSUPP);
|
||||
|
||||
if (error = getnewvnode(VT_KERNFS, mp, kernfs_vnodeop_p, &rvp))
|
||||
error = getnewvnode(VT_KERNFS, mp, kernfs_vnodeop_p, &rvp);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
MALLOC(fmp, struct kernfs_mount *, sizeof(struct kernfs_mount),
|
||||
@ -137,6 +157,7 @@ kernfs_mount(mp, path, data, ndp, p)
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
kernfs_start(mp, flags, p)
|
||||
struct mount *mp;
|
||||
int flags;
|
||||
@ -146,6 +167,7 @@ kernfs_start(mp, flags, p)
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
kernfs_unmount(mp, mntflags, p)
|
||||
struct mount *mp;
|
||||
int mntflags;
|
||||
@ -177,7 +199,7 @@ kernfs_unmount(mp, mntflags, p)
|
||||
#ifdef KERNFS_DIAGNOSTIC
|
||||
printf("kernfs_unmount: calling vflush\n");
|
||||
#endif
|
||||
if (error = vflush(mp, rootvp, flags))
|
||||
if ((error = vflush(mp, rootvp, flags)) != 0)
|
||||
return (error);
|
||||
|
||||
#ifdef KERNFS_DIAGNOSTIC
|
||||
@ -196,6 +218,7 @@ kernfs_unmount(mp, mntflags, p)
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
kernfs_root(mp, vpp)
|
||||
struct mount *mp;
|
||||
struct vnode **vpp;
|
||||
@ -216,6 +239,7 @@ kernfs_root(mp, vpp)
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
kernfs_quotactl(mp, cmd, uid, arg, p)
|
||||
struct mount *mp;
|
||||
int cmd;
|
||||
@ -227,6 +251,7 @@ kernfs_quotactl(mp, cmd, uid, arg, p)
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
int
|
||||
kernfs_statfs(mp, sbp, p)
|
||||
struct mount *mp;
|
||||
struct statfs *sbp;
|
||||
@ -258,9 +283,13 @@ kernfs_statfs(mp, sbp, p)
|
||||
return (0);
|
||||
}
|
||||
|
||||
kernfs_sync(mp, waitfor)
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
kernfs_sync(mp, waitfor, uc, p)
|
||||
struct mount *mp;
|
||||
int waitfor;
|
||||
struct ucred *uc;
|
||||
struct proc *p;
|
||||
{
|
||||
|
||||
return (0);
|
||||
@ -270,6 +299,7 @@ kernfs_sync(mp, waitfor)
|
||||
* Kernfs flat namespace lookup.
|
||||
* Currently unsupported.
|
||||
*/
|
||||
int
|
||||
kernfs_vget(mp, ino, vpp)
|
||||
struct mount *mp;
|
||||
ino_t ino;
|
||||
@ -279,17 +309,22 @@ kernfs_vget(mp, ino, vpp)
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
|
||||
kernfs_fhtovp(mp, fhp, setgen, vpp)
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
kernfs_fhtovp(mp, fhp, mb, vpp, what, anon)
|
||||
struct mount *mp;
|
||||
struct fid *fhp;
|
||||
int setgen;
|
||||
struct mbuf *mb;
|
||||
struct vnode **vpp;
|
||||
int *what;
|
||||
struct ucred **anon;
|
||||
{
|
||||
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
kernfs_vptofh(vp, fhp)
|
||||
struct vnode *vp;
|
||||
struct fid *fhp;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kernfs_vnops.c,v 1.40 1996/02/09 14:45:48 mycroft Exp $ */
|
||||
/* $NetBSD: kernfs_vnops.c,v 1.41 1996/02/09 22:40:24 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -108,6 +108,101 @@ struct kern_target {
|
||||
};
|
||||
static int nkern_targets = sizeof(kern_targets) / sizeof(kern_targets[0]);
|
||||
|
||||
int kernfs_enotsupp __P((void *));
|
||||
int kernfs_badop __P((void *));
|
||||
int kernfs_nullop __P((void *));
|
||||
int kernfs_lookup __P((void *));
|
||||
#define kernfs_create kernfs_enotsupp
|
||||
#define kernfs_mknod kernfs_enotsupp
|
||||
int kernfs_open __P((void *));
|
||||
#define kernfs_close nullop
|
||||
int kernfs_access __P((void *));
|
||||
int kernfs_getattr __P((void *));
|
||||
int kernfs_setattr __P((void *));
|
||||
int kernfs_read __P((void *));
|
||||
int kernfs_write __P((void *));
|
||||
#define kernfs_ioctl kernfs_enotsupp
|
||||
#define kernfs_select kernfs_enotsupp
|
||||
#define kernfs_mmap kernfs_enotsupp
|
||||
#define kernfs_fsync nullop
|
||||
#define kernfs_seek nullop
|
||||
#define kernfs_remove kernfs_enotsupp
|
||||
int kernfs_link __P((void *));
|
||||
#define kernfs_rename kernfs_enotsupp
|
||||
#define kernfs_mkdir kernfs_enotsupp
|
||||
#define kernfs_rmdir kernfs_enotsupp
|
||||
int kernfs_symlink __P((void *));
|
||||
int kernfs_readdir __P((void *));
|
||||
#define kernfs_readlink kernfs_enotsupp
|
||||
int kernfs_abortop __P((void *));
|
||||
int kernfs_inactive __P((void *));
|
||||
int kernfs_reclaim __P((void *));
|
||||
#define kernfs_lock nullop
|
||||
#define kernfs_unlock nullop
|
||||
#define kernfs_bmap kernfs_badop
|
||||
#define kernfs_strategy kernfs_badop
|
||||
int kernfs_print __P((void *));
|
||||
#define kernfs_islocked nullop
|
||||
int kernfs_pathconf __P((void *));
|
||||
#define kernfs_advlock kernfs_enotsupp
|
||||
#define kernfs_blkatoff kernfs_enotsupp
|
||||
#define kernfs_valloc kernfs_enotsupp
|
||||
int kernfs_vfree __P((void *));
|
||||
#define kernfs_truncate kernfs_enotsupp
|
||||
#define kernfs_update kernfs_enotsupp
|
||||
#define kernfs_bwrite kernfs_enotsupp
|
||||
|
||||
int kernfs_xread __P((struct kern_target *, int, char **, int));
|
||||
int kernfs_xwrite __P((struct kern_target *, char *, int));
|
||||
|
||||
int (**kernfs_vnodeop_p) __P((void *));
|
||||
struct vnodeopv_entry_desc kernfs_vnodeop_entries[] = {
|
||||
{ &vop_default_desc, vn_default_error },
|
||||
{ &vop_lookup_desc, kernfs_lookup }, /* lookup */
|
||||
{ &vop_create_desc, kernfs_create }, /* create */
|
||||
{ &vop_mknod_desc, kernfs_mknod }, /* mknod */
|
||||
{ &vop_open_desc, kernfs_open }, /* open */
|
||||
{ &vop_close_desc, kernfs_close }, /* close */
|
||||
{ &vop_access_desc, kernfs_access }, /* access */
|
||||
{ &vop_getattr_desc, kernfs_getattr }, /* getattr */
|
||||
{ &vop_setattr_desc, kernfs_setattr }, /* setattr */
|
||||
{ &vop_read_desc, kernfs_read }, /* read */
|
||||
{ &vop_write_desc, kernfs_write }, /* write */
|
||||
{ &vop_ioctl_desc, kernfs_ioctl }, /* ioctl */
|
||||
{ &vop_select_desc, kernfs_select }, /* select */
|
||||
{ &vop_mmap_desc, kernfs_mmap }, /* mmap */
|
||||
{ &vop_fsync_desc, kernfs_fsync }, /* fsync */
|
||||
{ &vop_seek_desc, kernfs_seek }, /* seek */
|
||||
{ &vop_remove_desc, kernfs_remove }, /* remove */
|
||||
{ &vop_link_desc, kernfs_link }, /* link */
|
||||
{ &vop_rename_desc, kernfs_rename }, /* rename */
|
||||
{ &vop_mkdir_desc, kernfs_mkdir }, /* mkdir */
|
||||
{ &vop_rmdir_desc, kernfs_rmdir }, /* rmdir */
|
||||
{ &vop_symlink_desc, kernfs_symlink }, /* symlink */
|
||||
{ &vop_readdir_desc, kernfs_readdir }, /* readdir */
|
||||
{ &vop_readlink_desc, kernfs_readlink },/* readlink */
|
||||
{ &vop_abortop_desc, kernfs_abortop }, /* abortop */
|
||||
{ &vop_inactive_desc, kernfs_inactive },/* inactive */
|
||||
{ &vop_reclaim_desc, kernfs_reclaim }, /* reclaim */
|
||||
{ &vop_lock_desc, kernfs_lock }, /* lock */
|
||||
{ &vop_unlock_desc, kernfs_unlock }, /* unlock */
|
||||
{ &vop_bmap_desc, kernfs_bmap }, /* bmap */
|
||||
{ &vop_strategy_desc, kernfs_strategy },/* strategy */
|
||||
{ &vop_print_desc, kernfs_print }, /* print */
|
||||
{ &vop_islocked_desc, kernfs_islocked },/* islocked */
|
||||
{ &vop_pathconf_desc, kernfs_pathconf },/* pathconf */
|
||||
{ &vop_advlock_desc, kernfs_advlock }, /* advlock */
|
||||
{ &vop_blkatoff_desc, kernfs_blkatoff },/* blkatoff */
|
||||
{ &vop_valloc_desc, kernfs_valloc }, /* valloc */
|
||||
{ &vop_vfree_desc, kernfs_vfree }, /* vfree */
|
||||
{ &vop_truncate_desc, kernfs_truncate },/* truncate */
|
||||
{ &vop_update_desc, kernfs_update }, /* update */
|
||||
{ &vop_bwrite_desc, kernfs_bwrite }, /* bwrite */
|
||||
{ (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL }
|
||||
};
|
||||
struct vnodeopv_desc kernfs_vnodeop_opv_desc =
|
||||
{ &kernfs_vnodeop_p, kernfs_vnodeop_entries };
|
||||
|
||||
int
|
||||
kernfs_xread(kt, off, bufp, len)
|
||||
struct kern_target *kt;
|
||||
@ -210,13 +305,15 @@ kernfs_xwrite(kt, buf, len)
|
||||
* vp is the current namei directory
|
||||
* ndp is the name to locate in that directory...
|
||||
*/
|
||||
kernfs_lookup(ap)
|
||||
int
|
||||
kernfs_lookup(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_lookup_args /* {
|
||||
struct vnode * a_dvp;
|
||||
struct vnode ** a_vpp;
|
||||
struct componentname * a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct componentname *cnp = ap->a_cnp;
|
||||
struct vnode **vpp = ap->a_vpp;
|
||||
struct vnode *dvp = ap->a_dvp;
|
||||
@ -279,8 +376,8 @@ found:
|
||||
#ifdef KERNFS_DIAGNOSTIC
|
||||
printf("kernfs_lookup: allocate new vnode\n");
|
||||
#endif
|
||||
if (error = getnewvnode(VT_KERNFS, dvp->v_mount, kernfs_vnodeop_p,
|
||||
&fvp))
|
||||
error = getnewvnode(VT_KERNFS, dvp->v_mount, kernfs_vnodeop_p, &fvp);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
MALLOC(fvp->v_data, void *, sizeof(struct kernfs_node), M_TEMP,
|
||||
@ -295,28 +392,25 @@ found:
|
||||
return (0);
|
||||
}
|
||||
|
||||
kernfs_open(ap)
|
||||
struct vop_open_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_mode;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
kernfs_open(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
/* Only need to check access permissions. */
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
kernfs_access(ap)
|
||||
kernfs_access(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_access_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_mode;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
mode_t fmode =
|
||||
(vp->v_flag & VROOT) ? DIR_MODE : VTOKERN(vp)->kf_kt->kt_mode;
|
||||
@ -324,14 +418,16 @@ kernfs_access(ap)
|
||||
return (vaccess(fmode, (uid_t)0, (gid_t)0, ap->a_mode, ap->a_cred));
|
||||
}
|
||||
|
||||
kernfs_getattr(ap)
|
||||
int
|
||||
kernfs_getattr(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_getattr_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct vattr *a_vap;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct vattr *vap = ap->a_vap;
|
||||
struct timeval tv;
|
||||
@ -386,15 +482,11 @@ kernfs_getattr(ap)
|
||||
return (error);
|
||||
}
|
||||
|
||||
kernfs_setattr(ap)
|
||||
struct vop_setattr_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct vattr *a_vap;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
kernfs_setattr(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
/*
|
||||
* Silently ignore attribute changes.
|
||||
* This allows for open with truncate to have no
|
||||
@ -405,14 +497,15 @@ kernfs_setattr(ap)
|
||||
}
|
||||
|
||||
int
|
||||
kernfs_read(ap)
|
||||
kernfs_read(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_read_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
int a_ioflag;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct uio *uio = ap->a_uio;
|
||||
struct kern_target *kt;
|
||||
@ -436,7 +529,7 @@ kernfs_read(ap)
|
||||
if (buf = strbuf,
|
||||
#endif
|
||||
len = kernfs_xread(kt, off, &buf, sizeof(strbuf))) {
|
||||
if (error = uiomove(buf, len, uio))
|
||||
if ((error = uiomove(buf, len, uio)) != 0)
|
||||
return (error);
|
||||
off += len;
|
||||
}
|
||||
@ -444,14 +537,15 @@ kernfs_read(ap)
|
||||
}
|
||||
|
||||
int
|
||||
kernfs_write(ap)
|
||||
kernfs_write(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_write_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
int a_ioflag;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct uio *uio = ap->a_uio;
|
||||
struct kern_target *kt;
|
||||
@ -467,7 +561,7 @@ kernfs_write(ap)
|
||||
return (EINVAL);
|
||||
|
||||
xlen = min(uio->uio_resid, KSTRING-1);
|
||||
if (error = uiomove(strbuf, xlen, uio))
|
||||
if ((error = uiomove(strbuf, xlen, uio)) != 0)
|
||||
return (error);
|
||||
|
||||
if (uio->uio_resid != 0)
|
||||
@ -478,7 +572,10 @@ kernfs_write(ap)
|
||||
return (kernfs_xwrite(kt, strbuf, xlen));
|
||||
}
|
||||
|
||||
kernfs_readdir(ap)
|
||||
int
|
||||
kernfs_readdir(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_readdir_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
@ -486,8 +583,7 @@ kernfs_readdir(ap)
|
||||
int *a_eofflag;
|
||||
u_long *a_cookies;
|
||||
int a_ncookies;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct uio *uio = ap->a_uio;
|
||||
struct dirent d;
|
||||
struct kern_target *kt;
|
||||
@ -528,7 +624,7 @@ kernfs_readdir(ap)
|
||||
bcopy(kt->kt_name, d.d_name, kt->kt_namlen + 1);
|
||||
d.d_type = kt->kt_type;
|
||||
|
||||
if (error = uiomove((caddr_t)&d, UIO_MX, uio))
|
||||
if ((error = uiomove((caddr_t)&d, UIO_MX, uio)) != 0)
|
||||
break;
|
||||
if (ncookies-- > 0)
|
||||
*cookies++ = i + 1;
|
||||
@ -538,11 +634,13 @@ kernfs_readdir(ap)
|
||||
return (error);
|
||||
}
|
||||
|
||||
kernfs_inactive(ap)
|
||||
int
|
||||
kernfs_inactive(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_inactive_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
|
||||
#ifdef KERNFS_DIAGNOSTIC
|
||||
@ -556,11 +654,13 @@ kernfs_inactive(ap)
|
||||
return (0);
|
||||
}
|
||||
|
||||
kernfs_reclaim(ap)
|
||||
int
|
||||
kernfs_reclaim(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_reclaim_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
|
||||
#ifdef KERNFS_DIAGNOSTIC
|
||||
@ -576,13 +676,15 @@ kernfs_reclaim(ap)
|
||||
/*
|
||||
* Return POSIX pathconf information applicable to special devices.
|
||||
*/
|
||||
kernfs_pathconf(ap)
|
||||
int
|
||||
kernfs_pathconf(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_pathconf_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_name;
|
||||
register_t *a_retval;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
switch (ap->a_name) {
|
||||
case _PC_LINK_MAX:
|
||||
@ -613,36 +715,33 @@ kernfs_pathconf(ap)
|
||||
* Print out the contents of a /dev/fd vnode.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
kernfs_print(ap)
|
||||
struct vop_print_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
int
|
||||
kernfs_print(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
printf("tag VT_KERNFS, kernfs vnode\n");
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*void*/
|
||||
kernfs_vfree(ap)
|
||||
struct vop_vfree_args /* {
|
||||
struct vnode *a_pvp;
|
||||
ino_t a_ino;
|
||||
int a_mode;
|
||||
} */ *ap;
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
kernfs_vfree(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
kernfs_link(ap)
|
||||
kernfs_link(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_link_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode *a_vp;
|
||||
struct componentname *a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
VOP_ABORTOP(ap->a_dvp, ap->a_cnp);
|
||||
vput(ap->a_dvp);
|
||||
@ -650,15 +749,16 @@ kernfs_link(ap)
|
||||
}
|
||||
|
||||
int
|
||||
kernfs_symlink(ap)
|
||||
kernfs_symlink(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_symlink_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode **a_vpp;
|
||||
struct componentname *a_cnp;
|
||||
struct vattr *a_vap;
|
||||
char *a_target;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
VOP_ABORTOP(ap->a_dvp, ap->a_cnp);
|
||||
vput(ap->a_dvp);
|
||||
@ -666,12 +766,13 @@ kernfs_symlink(ap)
|
||||
}
|
||||
|
||||
int
|
||||
kernfs_abortop(ap)
|
||||
kernfs_abortop(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_abortop_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct componentname *a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF)
|
||||
FREE(ap->a_cnp->cn_pnbuf, M_NAMEI);
|
||||
@ -681,7 +782,10 @@ kernfs_abortop(ap)
|
||||
/*
|
||||
* /dev/fd vnode unsupported operation
|
||||
*/
|
||||
kernfs_enotsupp()
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
kernfs_enotsupp(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (EOPNOTSUPP);
|
||||
@ -690,98 +794,25 @@ kernfs_enotsupp()
|
||||
/*
|
||||
* /dev/fd "should never get here" operation
|
||||
*/
|
||||
kernfs_badop()
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
kernfs_badop(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
panic("kernfs: bad op");
|
||||
/* NOTREACHED */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* kernfs vnode null operation
|
||||
*/
|
||||
kernfs_nullop()
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
kernfs_nullop(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
#define kernfs_create ((int (*) __P((struct vop_create_args *)))kernfs_enotsupp)
|
||||
#define kernfs_mknod ((int (*) __P((struct vop_mknod_args *)))kernfs_enotsupp)
|
||||
#define kernfs_close ((int (*) __P((struct vop_close_args *)))nullop)
|
||||
#define kernfs_ioctl ((int (*) __P((struct vop_ioctl_args *)))kernfs_enotsupp)
|
||||
#define kernfs_select ((int (*) __P((struct vop_select_args *)))kernfs_enotsupp)
|
||||
#define kernfs_mmap ((int (*) __P((struct vop_mmap_args *)))kernfs_enotsupp)
|
||||
#define kernfs_fsync ((int (*) __P((struct vop_fsync_args *)))nullop)
|
||||
#define kernfs_seek ((int (*) __P((struct vop_seek_args *)))nullop)
|
||||
#define kernfs_remove ((int (*) __P((struct vop_remove_args *)))kernfs_enotsupp)
|
||||
#define kernfs_rename ((int (*) __P((struct vop_rename_args *)))kernfs_enotsupp)
|
||||
#define kernfs_mkdir ((int (*) __P((struct vop_mkdir_args *)))kernfs_enotsupp)
|
||||
#define kernfs_rmdir ((int (*) __P((struct vop_rmdir_args *)))kernfs_enotsupp)
|
||||
#define kernfs_readlink \
|
||||
((int (*) __P((struct vop_readlink_args *)))kernfs_enotsupp)
|
||||
#define kernfs_lock ((int (*) __P((struct vop_lock_args *)))nullop)
|
||||
#define kernfs_unlock ((int (*) __P((struct vop_unlock_args *)))nullop)
|
||||
#define kernfs_bmap ((int (*) __P((struct vop_bmap_args *)))kernfs_badop)
|
||||
#define kernfs_strategy ((int (*) __P((struct vop_strategy_args *)))kernfs_badop)
|
||||
#define kernfs_islocked ((int (*) __P((struct vop_islocked_args *)))nullop)
|
||||
#define kernfs_advlock ((int (*) __P((struct vop_advlock_args *)))kernfs_enotsupp)
|
||||
#define kernfs_blkatoff \
|
||||
((int (*) __P((struct vop_blkatoff_args *)))kernfs_enotsupp)
|
||||
#define kernfs_valloc ((int(*) __P(( \
|
||||
struct vnode *pvp, \
|
||||
int mode, \
|
||||
struct ucred *cred, \
|
||||
struct vnode **vpp))) kernfs_enotsupp)
|
||||
#define kernfs_truncate \
|
||||
((int (*) __P((struct vop_truncate_args *)))kernfs_enotsupp)
|
||||
#define kernfs_update ((int (*) __P((struct vop_update_args *)))kernfs_enotsupp)
|
||||
#define kernfs_bwrite ((int (*) __P((struct vop_bwrite_args *)))kernfs_enotsupp)
|
||||
|
||||
int (**kernfs_vnodeop_p)();
|
||||
struct vnodeopv_entry_desc kernfs_vnodeop_entries[] = {
|
||||
{ &vop_default_desc, vn_default_error },
|
||||
{ &vop_lookup_desc, kernfs_lookup }, /* lookup */
|
||||
{ &vop_create_desc, kernfs_create }, /* create */
|
||||
{ &vop_mknod_desc, kernfs_mknod }, /* mknod */
|
||||
{ &vop_open_desc, kernfs_open }, /* open */
|
||||
{ &vop_close_desc, kernfs_close }, /* close */
|
||||
{ &vop_access_desc, kernfs_access }, /* access */
|
||||
{ &vop_getattr_desc, kernfs_getattr }, /* getattr */
|
||||
{ &vop_setattr_desc, kernfs_setattr }, /* setattr */
|
||||
{ &vop_read_desc, kernfs_read }, /* read */
|
||||
{ &vop_write_desc, kernfs_write }, /* write */
|
||||
{ &vop_ioctl_desc, kernfs_ioctl }, /* ioctl */
|
||||
{ &vop_select_desc, kernfs_select }, /* select */
|
||||
{ &vop_mmap_desc, kernfs_mmap }, /* mmap */
|
||||
{ &vop_fsync_desc, kernfs_fsync }, /* fsync */
|
||||
{ &vop_seek_desc, kernfs_seek }, /* seek */
|
||||
{ &vop_remove_desc, kernfs_remove }, /* remove */
|
||||
{ &vop_link_desc, kernfs_link }, /* link */
|
||||
{ &vop_rename_desc, kernfs_rename }, /* rename */
|
||||
{ &vop_mkdir_desc, kernfs_mkdir }, /* mkdir */
|
||||
{ &vop_rmdir_desc, kernfs_rmdir }, /* rmdir */
|
||||
{ &vop_symlink_desc, kernfs_symlink }, /* symlink */
|
||||
{ &vop_readdir_desc, kernfs_readdir }, /* readdir */
|
||||
{ &vop_readlink_desc, kernfs_readlink },/* readlink */
|
||||
{ &vop_abortop_desc, kernfs_abortop }, /* abortop */
|
||||
{ &vop_inactive_desc, kernfs_inactive },/* inactive */
|
||||
{ &vop_reclaim_desc, kernfs_reclaim }, /* reclaim */
|
||||
{ &vop_lock_desc, kernfs_lock }, /* lock */
|
||||
{ &vop_unlock_desc, kernfs_unlock }, /* unlock */
|
||||
{ &vop_bmap_desc, kernfs_bmap }, /* bmap */
|
||||
{ &vop_strategy_desc, kernfs_strategy },/* strategy */
|
||||
{ &vop_print_desc, kernfs_print }, /* print */
|
||||
{ &vop_islocked_desc, kernfs_islocked },/* islocked */
|
||||
{ &vop_pathconf_desc, kernfs_pathconf },/* pathconf */
|
||||
{ &vop_advlock_desc, kernfs_advlock }, /* advlock */
|
||||
{ &vop_blkatoff_desc, kernfs_blkatoff },/* blkatoff */
|
||||
{ &vop_valloc_desc, kernfs_valloc }, /* valloc */
|
||||
{ &vop_vfree_desc, kernfs_vfree }, /* vfree */
|
||||
{ &vop_truncate_desc, kernfs_truncate },/* truncate */
|
||||
{ &vop_update_desc, kernfs_update }, /* update */
|
||||
{ &vop_bwrite_desc, kernfs_bwrite }, /* bwrite */
|
||||
{ (struct vnodeop_desc*)NULL, (int(*)())NULL }
|
||||
};
|
||||
struct vnodeopv_desc kernfs_vnodeop_opv_desc =
|
||||
{ &kernfs_vnodeop_p, kernfs_vnodeop_entries };
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: null.h,v 1.4 1995/03/29 22:08:24 briggs Exp $ */
|
||||
/* $NetBSD: null.h,v 1.5 1996/02/09 22:40:26 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -70,6 +70,9 @@ extern struct vnode *null_checkvp __P((struct vnode *vp, char *fil, int lno));
|
||||
#define NULLVPTOLOWERVP(vp) (VTONULL(vp)->null_lowervp)
|
||||
#endif
|
||||
|
||||
extern int (**null_vnodeop_p)();
|
||||
extern int (**null_vnodeop_p) __P((void *));
|
||||
extern struct vfsops null_vfsops;
|
||||
|
||||
void nullfs_init __P((void));
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: null_subr.c,v 1.4 1994/09/20 06:43:00 cgd Exp $ */
|
||||
/* $NetBSD: null_subr.c,v 1.5 1996/02/09 22:40:28 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -66,9 +66,15 @@
|
||||
LIST_HEAD(null_node_hashhead, null_node) *null_node_hashtbl;
|
||||
u_long null_node_hash;
|
||||
|
||||
void nullfs_init __P((void));
|
||||
static struct vnode *
|
||||
null_node_find __P((struct mount *, struct vnode *));
|
||||
static int
|
||||
null_node_alloc __P((struct mount *, struct vnode *, struct vnode **));
|
||||
/*
|
||||
* Initialise cache headers
|
||||
*/
|
||||
void
|
||||
nullfs_init()
|
||||
{
|
||||
|
||||
@ -133,9 +139,9 @@ null_node_alloc(mp, lowervp, vpp)
|
||||
struct null_node *xp;
|
||||
struct vnode *vp, *nvp;
|
||||
int error;
|
||||
extern int (**dead_vnodeop_p)();
|
||||
extern int (**dead_vnodeop_p) __P((void *));
|
||||
|
||||
if (error = getnewvnode(VT_NULL, mp, null_vnodeop_p, &vp))
|
||||
if ((error = getnewvnode(VT_NULL, mp, null_vnodeop_p, &vp)) != 0)
|
||||
return (error);
|
||||
vp->v_type = lowervp->v_type;
|
||||
|
||||
@ -155,7 +161,7 @@ null_node_alloc(mp, lowervp, vpp)
|
||||
* check to see if someone else has beaten us to it.
|
||||
* (We could have slept in MALLOC.)
|
||||
*/
|
||||
if (nvp = null_node_find(lowervp)) {
|
||||
if ((nvp = null_node_find(mp, lowervp)) != NULL) {
|
||||
*vpp = nvp;
|
||||
|
||||
/* free the substructures we've allocated. */
|
||||
@ -234,7 +240,7 @@ null_node_create(mp, lowervp, newvpp)
|
||||
{
|
||||
struct vnode *aliasvp;
|
||||
|
||||
if (aliasvp = null_node_find(mp, lowervp)) {
|
||||
if ((aliasvp = null_node_find(mp, lowervp)) != NULL) {
|
||||
/*
|
||||
* null_node_find has taken another reference
|
||||
* to the alias vnode.
|
||||
@ -256,7 +262,7 @@ null_node_create(mp, lowervp, newvpp)
|
||||
/*
|
||||
* Make new vnode reference the null_node.
|
||||
*/
|
||||
if (error = null_node_alloc(mp, lowervp, &aliasvp))
|
||||
if ((error = null_node_alloc(mp, lowervp, &aliasvp)) != 0)
|
||||
return error;
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: null_vfsops.c,v 1.9 1995/06/18 14:47:32 cgd Exp $ */
|
||||
/* $NetBSD: null_vfsops.c,v 1.10 1996/02/09 22:40:31 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -55,6 +55,19 @@
|
||||
#include <sys/malloc.h>
|
||||
#include <miscfs/nullfs/null.h>
|
||||
|
||||
int nullfs_mount __P((struct mount *, char *, caddr_t,
|
||||
struct nameidata *, struct proc *));
|
||||
int nullfs_start __P((struct mount *, int, struct proc *));
|
||||
int nullfs_unmount __P((struct mount *, int, struct proc *));
|
||||
int nullfs_root __P((struct mount *, struct vnode **));
|
||||
int nullfs_quotactl __P((struct mount *, int, uid_t, caddr_t,
|
||||
struct proc *));
|
||||
int nullfs_statfs __P((struct mount *, struct statfs *, struct proc *));
|
||||
int nullfs_sync __P((struct mount *, int, struct ucred *, struct proc *));
|
||||
int nullfs_vget __P((struct mount *, ino_t, struct vnode **));
|
||||
int nullfs_fhtovp __P((struct mount *, struct fid *, struct mbuf *,
|
||||
struct vnode **, int *, struct ucred **));
|
||||
int nullfs_vptofh __P((struct vnode *, struct fid *));
|
||||
/*
|
||||
* Mount null layer
|
||||
*/
|
||||
@ -88,7 +101,8 @@ nullfs_mount(mp, path, data, ndp, p)
|
||||
/*
|
||||
* Get argument
|
||||
*/
|
||||
if (error = copyin(data, (caddr_t)&args, sizeof(struct null_args)))
|
||||
error = copyin(data, (caddr_t)&args, sizeof(struct null_args));
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
/*
|
||||
@ -96,7 +110,7 @@ nullfs_mount(mp, path, data, ndp, p)
|
||||
*/
|
||||
NDINIT(ndp, LOOKUP, FOLLOW|WANTPARENT|LOCKLEAF,
|
||||
UIO_USERSPACE, args.target, p);
|
||||
if (error = namei(ndp))
|
||||
if ((error = namei(ndp)) != 0)
|
||||
return (error);
|
||||
|
||||
/*
|
||||
@ -210,7 +224,7 @@ nullfs_unmount(mp, mntflags, p)
|
||||
#endif
|
||||
if (nullm_rootvp->v_usecount > 1)
|
||||
return (EBUSY);
|
||||
if (error = vflush(mp, nullm_rootvp, flags))
|
||||
if ((error = vflush(mp, nullm_rootvp, flags)) != 0)
|
||||
return (error);
|
||||
|
||||
#ifdef NULLFS_DIAGNOSTIC
|
||||
@ -355,8 +369,6 @@ nullfs_vptofh(vp, fhp)
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
int nullfs_init __P((void));
|
||||
|
||||
struct vfsops null_vfsops = {
|
||||
MOUNT_NULL,
|
||||
nullfs_mount,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: null_vnops.c,v 1.4 1994/08/19 11:25:37 mycroft Exp $ */
|
||||
/* $NetBSD: null_vnops.c,v 1.5 1996/02/09 22:40:34 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -181,6 +181,13 @@
|
||||
|
||||
int null_bug_bypass = 0; /* for debugging: enables bypass printf'ing */
|
||||
|
||||
int null_bypass __P((void *));
|
||||
int null_getattr __P((void *));
|
||||
int null_inactive __P((void *));
|
||||
int null_reclaim __P((void *));
|
||||
int null_print __P((void *));
|
||||
int null_strategy __P((void *));
|
||||
int null_bwrite __P((void *));
|
||||
/*
|
||||
* This is the 10-Apr-92 bypass routine.
|
||||
* This version has been optimized for speed, throwing away some
|
||||
@ -207,13 +214,13 @@ int null_bug_bypass = 0; /* for debugging: enables bypass printf'ing */
|
||||
* problems on rmdir'ing mount points and renaming?)
|
||||
*/
|
||||
int
|
||||
null_bypass(ap)
|
||||
null_bypass(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_generic_args /* {
|
||||
struct vnodeop_desc *a_desc;
|
||||
<other random data follows, presumably>
|
||||
} */ *ap;
|
||||
{
|
||||
extern int (**null_vnodeop_p)(); /* not extern, really "forward" */
|
||||
} */ *ap = v;
|
||||
register struct vnode **this_vp_p;
|
||||
int error;
|
||||
struct vnode *old_vps[VDESC_MAX_VPS];
|
||||
@ -319,16 +326,17 @@ null_bypass(ap)
|
||||
* We handle getattr only to change the fsid.
|
||||
*/
|
||||
int
|
||||
null_getattr(ap)
|
||||
null_getattr(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_getattr_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct vattr *a_vap;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
int error;
|
||||
if (error = null_bypass(ap))
|
||||
if ((error = null_bypass(ap)) != NULL)
|
||||
return (error);
|
||||
/* Requires that arguments be restored. */
|
||||
ap->a_vap->va_fsid = ap->a_vp->v_mount->mnt_stat.f_fsid.val[0];
|
||||
@ -337,10 +345,8 @@ null_getattr(ap)
|
||||
|
||||
|
||||
int
|
||||
null_inactive(ap)
|
||||
struct vop_inactive_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
null_inactive(v)
|
||||
void *v;
|
||||
{
|
||||
/*
|
||||
* Do nothing (and _don't_ bypass).
|
||||
@ -358,11 +364,12 @@ null_inactive(ap)
|
||||
}
|
||||
|
||||
int
|
||||
null_reclaim(ap)
|
||||
null_reclaim(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_reclaim_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct null_node *xp = VTONULL(vp);
|
||||
struct vnode *lowervp = xp->null_lowervp;
|
||||
@ -382,13 +389,15 @@ null_reclaim(ap)
|
||||
|
||||
|
||||
int
|
||||
null_print(ap)
|
||||
null_print(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_print_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
register struct vnode *vp = ap->a_vp;
|
||||
printf ("\ttag VT_NULLFS, vp=%x, lowervp=%x\n", vp, NULLVPTOLOWERVP(vp));
|
||||
printf ("\ttag VT_NULLFS, vp=%x, lowervp=%x\n", (unsigned int) vp,
|
||||
(unsigned int) NULLVPTOLOWERVP(vp));
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -399,11 +408,12 @@ null_print(ap)
|
||||
* This goes away with a merged VM/buffer cache.
|
||||
*/
|
||||
int
|
||||
null_strategy(ap)
|
||||
null_strategy(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_strategy_args /* {
|
||||
struct buf *a_bp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct buf *bp = ap->a_bp;
|
||||
int error;
|
||||
struct vnode *savedvp;
|
||||
@ -425,11 +435,12 @@ null_strategy(ap)
|
||||
* This goes away with a merged VM/buffer cache.
|
||||
*/
|
||||
int
|
||||
null_bwrite(ap)
|
||||
null_bwrite(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_bwrite_args /* {
|
||||
struct buf *a_bp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct buf *bp = ap->a_bp;
|
||||
int error;
|
||||
struct vnode *savedvp;
|
||||
@ -447,19 +458,19 @@ null_bwrite(ap)
|
||||
/*
|
||||
* Global vfs data structures
|
||||
*/
|
||||
int (**null_vnodeop_p)();
|
||||
int (**null_vnodeop_p) __P((void *));
|
||||
struct vnodeopv_entry_desc null_vnodeop_entries[] = {
|
||||
{ &vop_default_desc, null_bypass },
|
||||
{ &vop_default_desc, null_bypass },
|
||||
|
||||
{ &vop_getattr_desc, null_getattr },
|
||||
{ &vop_inactive_desc, null_inactive },
|
||||
{ &vop_reclaim_desc, null_reclaim },
|
||||
{ &vop_print_desc, null_print },
|
||||
{ &vop_getattr_desc, null_getattr },
|
||||
{ &vop_inactive_desc, null_inactive },
|
||||
{ &vop_reclaim_desc, null_reclaim },
|
||||
{ &vop_print_desc, null_print },
|
||||
|
||||
{ &vop_strategy_desc, null_strategy },
|
||||
{ &vop_bwrite_desc, null_bwrite },
|
||||
{ &vop_strategy_desc, null_strategy },
|
||||
{ &vop_bwrite_desc, null_bwrite },
|
||||
|
||||
{ (struct vnodeop_desc*)NULL, (int(*)())NULL }
|
||||
{ (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL }
|
||||
};
|
||||
struct vnodeopv_desc null_vnodeop_opv_desc =
|
||||
{ &null_vnodeop_p, null_vnodeop_entries };
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: portal.h,v 1.6 1995/06/01 22:44:21 jtc Exp $ */
|
||||
/* $NetBSD: portal.h,v 1.7 1996/02/09 22:40:40 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -69,6 +69,6 @@ struct portalnode {
|
||||
|
||||
#define PORTAL_ROOTFILEID 2
|
||||
|
||||
extern int (**portal_vnodeop_p)();
|
||||
extern int (**portal_vnodeop_p) __P((void *));
|
||||
extern struct vfsops portal_vfsops;
|
||||
#endif /* _KERNEL */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: portal_vfsops.c,v 1.13 1995/06/18 14:47:35 cgd Exp $ */
|
||||
/* $NetBSD: portal_vfsops.c,v 1.14 1996/02/09 22:40:41 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -62,11 +62,24 @@
|
||||
#include <sys/un.h>
|
||||
#include <miscfs/portal/portal.h>
|
||||
|
||||
int
|
||||
void portal_init __P((void));
|
||||
int portal_mount __P((struct mount *, char *, caddr_t,
|
||||
struct nameidata *, struct proc *));
|
||||
int portal_start __P((struct mount *, int, struct proc *));
|
||||
int portal_unmount __P((struct mount *, int, struct proc *));
|
||||
int portal_root __P((struct mount *, struct vnode **));
|
||||
int portal_quotactl __P((struct mount *, int, uid_t, caddr_t,
|
||||
struct proc *));
|
||||
int portal_statfs __P((struct mount *, struct statfs *, struct proc *));
|
||||
int portal_sync __P((struct mount *, int, struct ucred *, struct proc *));
|
||||
int portal_vget __P((struct mount *, ino_t, struct vnode **));
|
||||
int portal_fhtovp __P((struct mount *, struct fid *, struct mbuf *,
|
||||
struct vnode **, int *, struct ucred **));
|
||||
int portal_vptofh __P((struct vnode *, struct fid *));
|
||||
|
||||
void
|
||||
portal_init()
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -94,10 +107,11 @@ portal_mount(mp, path, data, ndp, p)
|
||||
if (mp->mnt_flag & MNT_UPDATE)
|
||||
return (EOPNOTSUPP);
|
||||
|
||||
if (error = copyin(data, (caddr_t) &args, sizeof(struct portal_args)))
|
||||
error = copyin(data, (caddr_t) &args, sizeof(struct portal_args));
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
if (error = getsock(p->p_fd, args.pa_socket, &fp))
|
||||
if ((error = getsock(p->p_fd, args.pa_socket, &fp)) != 0)
|
||||
return (error);
|
||||
so = (struct socket *) fp->f_data;
|
||||
if (so->so_proto->pr_domain->dom_family != AF_UNIX)
|
||||
@ -170,7 +184,7 @@ portal_unmount(mp, mntflags, p)
|
||||
#endif
|
||||
if (rootvp->v_usecount > 1)
|
||||
return (EBUSY);
|
||||
if (error = vflush(mp, rootvp, flags))
|
||||
if ((error = vflush(mp, rootvp, flags)) != 0)
|
||||
return (error);
|
||||
|
||||
/*
|
||||
@ -257,10 +271,13 @@ portal_statfs(mp, sbp, p)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
portal_sync(mp, waitfor)
|
||||
portal_sync(mp, waitfor, uc, p)
|
||||
struct mount *mp;
|
||||
int waitfor;
|
||||
struct ucred *uc;
|
||||
struct proc *p;
|
||||
{
|
||||
|
||||
return (0);
|
||||
@ -277,10 +294,13 @@ portal_vget(mp, ino, vpp)
|
||||
}
|
||||
|
||||
int
|
||||
portal_fhtovp(mp, fhp, vpp)
|
||||
portal_fhtovp(mp, fhp, mb, vpp, what, anon)
|
||||
struct mount *mp;
|
||||
struct fid *fhp;
|
||||
struct mbuf *mb;
|
||||
struct vnode **vpp;
|
||||
int *what;
|
||||
struct ucred **anon;
|
||||
{
|
||||
|
||||
return (EOPNOTSUPP);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: portal_vnops.c,v 1.15 1996/02/09 14:45:50 mycroft Exp $ */
|
||||
/* $NetBSD: portal_vnops.c,v 1.16 1996/02/09 22:40:43 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -62,11 +62,105 @@
|
||||
#include <sys/un.h>
|
||||
#include <sys/unpcb.h>
|
||||
#include <sys/syscallargs.h>
|
||||
|
||||
#include <miscfs/portal/portal.h>
|
||||
|
||||
static int portal_fileid = PORTAL_ROOTFILEID+1;
|
||||
|
||||
static void portal_closefd __P((struct proc *, int));
|
||||
static int portal_connect __P((struct socket *, struct socket *));
|
||||
|
||||
int portal_enotsupp __P((void *));
|
||||
int portal_badop __P((void *));
|
||||
int portal_nullop __P((void *));
|
||||
int portal_lookup __P((void *));
|
||||
#define portal_create portal_enotsupp
|
||||
#define portal_mknod portal_enotsupp
|
||||
int portal_open __P((void *));
|
||||
#define portal_close nullop
|
||||
#define portal_access nullop
|
||||
int portal_getattr __P((void *));
|
||||
int portal_setattr __P((void *));
|
||||
#define portal_read portal_enotsupp
|
||||
#define portal_write portal_enotsupp
|
||||
#define portal_ioctl portal_enotsupp
|
||||
#define portal_select portal_enotsupp
|
||||
#define portal_mmap portal_enotsupp
|
||||
#define portal_fsync nullop
|
||||
#define portal_seek nullop
|
||||
#define portal_remove portal_enotsupp
|
||||
int portal_link __P((void *));
|
||||
#define portal_rename portal_enotsupp
|
||||
#define portal_mkdir portal_enotsupp
|
||||
#define portal_rmdir portal_enotsupp
|
||||
int portal_symlink __P((void *));
|
||||
int portal_readdir __P((void *));
|
||||
#define portal_readlink portal_enotsupp
|
||||
int portal_abortop __P((void *));
|
||||
int portal_inactive __P((void *));
|
||||
int portal_reclaim __P((void *));
|
||||
#define portal_lock nullop
|
||||
#define portal_unlock nullop
|
||||
#define portal_bmap portal_badop
|
||||
#define portal_strategy portal_badop
|
||||
int portal_print __P((void *));
|
||||
#define portal_islocked nullop
|
||||
int portal_pathconf __P((void *));
|
||||
#define portal_advlock portal_enotsupp
|
||||
#define portal_blkatoff portal_enotsupp
|
||||
#define portal_valloc portal_enotsupp
|
||||
int portal_vfree __P((void *));
|
||||
#define portal_truncate portal_enotsupp
|
||||
#define portal_update portal_enotsupp
|
||||
#define portal_bwrite portal_enotsupp
|
||||
|
||||
int (**portal_vnodeop_p) __P((void *));
|
||||
struct vnodeopv_entry_desc portal_vnodeop_entries[] = {
|
||||
{ &vop_default_desc, vn_default_error },
|
||||
{ &vop_lookup_desc, portal_lookup }, /* lookup */
|
||||
{ &vop_create_desc, portal_create }, /* create */
|
||||
{ &vop_mknod_desc, portal_mknod }, /* mknod */
|
||||
{ &vop_open_desc, portal_open }, /* open */
|
||||
{ &vop_close_desc, portal_close }, /* close */
|
||||
{ &vop_access_desc, portal_access }, /* access */
|
||||
{ &vop_getattr_desc, portal_getattr }, /* getattr */
|
||||
{ &vop_setattr_desc, portal_setattr }, /* setattr */
|
||||
{ &vop_read_desc, portal_read }, /* read */
|
||||
{ &vop_write_desc, portal_write }, /* write */
|
||||
{ &vop_ioctl_desc, portal_ioctl }, /* ioctl */
|
||||
{ &vop_select_desc, portal_select }, /* select */
|
||||
{ &vop_mmap_desc, portal_mmap }, /* mmap */
|
||||
{ &vop_fsync_desc, portal_fsync }, /* fsync */
|
||||
{ &vop_seek_desc, portal_seek }, /* seek */
|
||||
{ &vop_remove_desc, portal_remove }, /* remove */
|
||||
{ &vop_link_desc, portal_link }, /* link */
|
||||
{ &vop_rename_desc, portal_rename }, /* rename */
|
||||
{ &vop_mkdir_desc, portal_mkdir }, /* mkdir */
|
||||
{ &vop_rmdir_desc, portal_rmdir }, /* rmdir */
|
||||
{ &vop_symlink_desc, portal_symlink }, /* symlink */
|
||||
{ &vop_readdir_desc, portal_readdir }, /* readdir */
|
||||
{ &vop_readlink_desc, portal_readlink }, /* readlink */
|
||||
{ &vop_abortop_desc, portal_abortop }, /* abortop */
|
||||
{ &vop_inactive_desc, portal_inactive }, /* inactive */
|
||||
{ &vop_reclaim_desc, portal_reclaim }, /* reclaim */
|
||||
{ &vop_lock_desc, portal_lock }, /* lock */
|
||||
{ &vop_unlock_desc, portal_unlock }, /* unlock */
|
||||
{ &vop_bmap_desc, portal_bmap }, /* bmap */
|
||||
{ &vop_strategy_desc, portal_strategy }, /* strategy */
|
||||
{ &vop_print_desc, portal_print }, /* print */
|
||||
{ &vop_islocked_desc, portal_islocked }, /* islocked */
|
||||
{ &vop_pathconf_desc, portal_pathconf }, /* pathconf */
|
||||
{ &vop_advlock_desc, portal_advlock }, /* advlock */
|
||||
{ &vop_blkatoff_desc, portal_blkatoff }, /* blkatoff */
|
||||
{ &vop_valloc_desc, portal_valloc }, /* valloc */
|
||||
{ &vop_vfree_desc, portal_vfree }, /* vfree */
|
||||
{ &vop_truncate_desc, portal_truncate }, /* truncate */
|
||||
{ &vop_update_desc, portal_update }, /* update */
|
||||
{ &vop_bwrite_desc, portal_bwrite }, /* bwrite */
|
||||
{ (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL }
|
||||
};
|
||||
struct vnodeopv_desc portal_vnodeop_opv_desc =
|
||||
{ &portal_vnodeop_p, portal_vnodeop_entries };
|
||||
|
||||
static void
|
||||
portal_closefd(p, fd)
|
||||
struct proc *p;
|
||||
@ -93,13 +187,14 @@ portal_closefd(p, fd)
|
||||
* cnp is the name to locate in that directory...
|
||||
*/
|
||||
int
|
||||
portal_lookup(ap)
|
||||
portal_lookup(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_lookup_args /* {
|
||||
struct vnode * a_dvp;
|
||||
struct vnode ** a_vpp;
|
||||
struct componentname * a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct componentname *cnp = ap->a_cnp;
|
||||
struct vnode **vpp = ap->a_vpp;
|
||||
struct vnode *dvp = ap->a_dvp;
|
||||
@ -188,14 +283,15 @@ portal_connect(so, so2)
|
||||
}
|
||||
|
||||
int
|
||||
portal_open(ap)
|
||||
portal_open(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_open_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_mode;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct socket *so = 0;
|
||||
struct portalnode *pt;
|
||||
struct proc *p = ap->a_p;
|
||||
@ -422,14 +518,15 @@ bad:;
|
||||
}
|
||||
|
||||
int
|
||||
portal_getattr(ap)
|
||||
portal_getattr(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_getattr_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct vattr *a_vap;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct vattr *vap = ap->a_vap;
|
||||
struct timeval tv;
|
||||
@ -470,14 +567,15 @@ portal_getattr(ap)
|
||||
}
|
||||
|
||||
int
|
||||
portal_setattr(ap)
|
||||
portal_setattr(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_setattr_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct vattr *a_vap;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
/*
|
||||
* Can't mess with the root vnode
|
||||
@ -492,34 +590,30 @@ portal_setattr(ap)
|
||||
* Fake readdir, just return empty directory.
|
||||
* It is hard to deal with '.' and '..' so don't bother.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
portal_readdir(ap)
|
||||
struct vop_readdir_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
portal_readdir(v)
|
||||
void *v;
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
portal_inactive(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
portal_inactive(ap)
|
||||
struct vop_inactive_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
portal_reclaim(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
portal_reclaim(ap)
|
||||
struct vop_reclaim_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct portalnode *pt = VTOPORTAL(ap->a_vp);
|
||||
|
||||
if (pt->pt_arg) {
|
||||
@ -535,13 +629,15 @@ portal_reclaim(ap)
|
||||
/*
|
||||
* Return POSIX pathconf information applicable to special devices.
|
||||
*/
|
||||
portal_pathconf(ap)
|
||||
int
|
||||
portal_pathconf(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_pathconf_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_name;
|
||||
register_t *a_retval;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
switch (ap->a_name) {
|
||||
case _PC_LINK_MAX:
|
||||
@ -573,37 +669,31 @@ portal_pathconf(ap)
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
int
|
||||
portal_print(ap)
|
||||
struct vop_print_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
portal_print(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
printf("tag VT_PORTAL, portal vnode\n");
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*void*/
|
||||
/* ARGSUSED */
|
||||
int
|
||||
portal_vfree(ap)
|
||||
struct vop_vfree_args /* {
|
||||
struct vnode *a_pvp;
|
||||
ino_t a_ino;
|
||||
int a_mode;
|
||||
} */ *ap;
|
||||
portal_vfree(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
portal_link(ap)
|
||||
portal_link(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_link_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode *a_vp;
|
||||
struct componentname *a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
VOP_ABORTOP(ap->a_dvp, ap->a_cnp);
|
||||
vput(ap->a_dvp);
|
||||
@ -611,15 +701,16 @@ portal_link(ap)
|
||||
}
|
||||
|
||||
int
|
||||
portal_symlink(ap)
|
||||
portal_symlink(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_symlink_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode **a_vpp;
|
||||
struct componentname *a_cnp;
|
||||
struct vattr *a_vap;
|
||||
char *a_target;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
VOP_ABORTOP(ap->a_dvp, ap->a_cnp);
|
||||
vput(ap->a_dvp);
|
||||
@ -627,12 +718,13 @@ portal_symlink(ap)
|
||||
}
|
||||
|
||||
int
|
||||
portal_abortop(ap)
|
||||
portal_abortop(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_abortop_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct componentname *a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF)
|
||||
FREE(ap->a_cnp->cn_pnbuf, M_NAMEI);
|
||||
@ -642,8 +734,10 @@ portal_abortop(ap)
|
||||
/*
|
||||
* Portal vnode unsupported operation
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
portal_enotsupp()
|
||||
portal_enotsupp(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (EOPNOTSUPP);
|
||||
@ -652,8 +746,10 @@ portal_enotsupp()
|
||||
/*
|
||||
* Portal "should never get here" operation
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
portal_badop()
|
||||
portal_badop(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
panic("portal: bad op");
|
||||
@ -663,94 +759,12 @@ portal_badop()
|
||||
/*
|
||||
* Portal vnode null operation
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
portal_nullop()
|
||||
portal_nullop(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
#define portal_create ((int (*) __P((struct vop_create_args *)))portal_enotsupp)
|
||||
#define portal_mknod ((int (*) __P((struct vop_mknod_args *)))portal_enotsupp)
|
||||
#define portal_close ((int (*) __P((struct vop_close_args *)))nullop)
|
||||
#define portal_access ((int (*) __P((struct vop_access_args *)))nullop)
|
||||
#define portal_read ((int (*) __P((struct vop_read_args *)))portal_enotsupp)
|
||||
#define portal_write ((int (*) __P((struct vop_write_args *)))portal_enotsupp)
|
||||
#define portal_ioctl ((int (*) __P((struct vop_ioctl_args *)))portal_enotsupp)
|
||||
#define portal_select ((int (*) __P((struct vop_select_args *)))portal_enotsupp)
|
||||
#define portal_mmap ((int (*) __P((struct vop_mmap_args *)))portal_enotsupp)
|
||||
#define portal_fsync ((int (*) __P((struct vop_fsync_args *)))nullop)
|
||||
#define portal_seek ((int (*) __P((struct vop_seek_args *)))nullop)
|
||||
#define portal_remove ((int (*) __P((struct vop_remove_args *)))portal_enotsupp)
|
||||
#define portal_rename ((int (*) __P((struct vop_rename_args *)))portal_enotsupp)
|
||||
#define portal_mkdir ((int (*) __P((struct vop_mkdir_args *)))portal_enotsupp)
|
||||
#define portal_rmdir ((int (*) __P((struct vop_rmdir_args *)))portal_enotsupp)
|
||||
#define portal_readlink \
|
||||
((int (*) __P((struct vop_readlink_args *)))portal_enotsupp)
|
||||
#define portal_lock ((int (*) __P((struct vop_lock_args *)))nullop)
|
||||
#define portal_unlock ((int (*) __P((struct vop_unlock_args *)))nullop)
|
||||
#define portal_bmap ((int (*) __P((struct vop_bmap_args *)))portal_badop)
|
||||
#define portal_strategy \
|
||||
((int (*) __P((struct vop_strategy_args *)))portal_badop)
|
||||
#define portal_islocked ((int (*) __P((struct vop_islocked_args *)))nullop)
|
||||
#define portal_advlock \
|
||||
((int (*) __P((struct vop_advlock_args *)))portal_enotsupp)
|
||||
#define portal_blkatoff \
|
||||
((int (*) __P((struct vop_blkatoff_args *)))portal_enotsupp)
|
||||
#define portal_valloc ((int(*) __P(( \
|
||||
struct vnode *pvp, \
|
||||
int mode, \
|
||||
struct ucred *cred, \
|
||||
struct vnode **vpp))) portal_enotsupp)
|
||||
#define portal_truncate \
|
||||
((int (*) __P((struct vop_truncate_args *)))portal_enotsupp)
|
||||
#define portal_update ((int (*) __P((struct vop_update_args *)))portal_enotsupp)
|
||||
#define portal_bwrite ((int (*) __P((struct vop_bwrite_args *)))portal_enotsupp)
|
||||
|
||||
int (**portal_vnodeop_p)();
|
||||
struct vnodeopv_entry_desc portal_vnodeop_entries[] = {
|
||||
{ &vop_default_desc, vn_default_error },
|
||||
{ &vop_lookup_desc, portal_lookup }, /* lookup */
|
||||
{ &vop_create_desc, portal_create }, /* create */
|
||||
{ &vop_mknod_desc, portal_mknod }, /* mknod */
|
||||
{ &vop_open_desc, portal_open }, /* open */
|
||||
{ &vop_close_desc, portal_close }, /* close */
|
||||
{ &vop_access_desc, portal_access }, /* access */
|
||||
{ &vop_getattr_desc, portal_getattr }, /* getattr */
|
||||
{ &vop_setattr_desc, portal_setattr }, /* setattr */
|
||||
{ &vop_read_desc, portal_read }, /* read */
|
||||
{ &vop_write_desc, portal_write }, /* write */
|
||||
{ &vop_ioctl_desc, portal_ioctl }, /* ioctl */
|
||||
{ &vop_select_desc, portal_select }, /* select */
|
||||
{ &vop_mmap_desc, portal_mmap }, /* mmap */
|
||||
{ &vop_fsync_desc, portal_fsync }, /* fsync */
|
||||
{ &vop_seek_desc, portal_seek }, /* seek */
|
||||
{ &vop_remove_desc, portal_remove }, /* remove */
|
||||
{ &vop_link_desc, portal_link }, /* link */
|
||||
{ &vop_rename_desc, portal_rename }, /* rename */
|
||||
{ &vop_mkdir_desc, portal_mkdir }, /* mkdir */
|
||||
{ &vop_rmdir_desc, portal_rmdir }, /* rmdir */
|
||||
{ &vop_symlink_desc, portal_symlink }, /* symlink */
|
||||
{ &vop_readdir_desc, portal_readdir }, /* readdir */
|
||||
{ &vop_readlink_desc, portal_readlink }, /* readlink */
|
||||
{ &vop_abortop_desc, portal_abortop }, /* abortop */
|
||||
{ &vop_inactive_desc, portal_inactive }, /* inactive */
|
||||
{ &vop_reclaim_desc, portal_reclaim }, /* reclaim */
|
||||
{ &vop_lock_desc, portal_lock }, /* lock */
|
||||
{ &vop_unlock_desc, portal_unlock }, /* unlock */
|
||||
{ &vop_bmap_desc, portal_bmap }, /* bmap */
|
||||
{ &vop_strategy_desc, portal_strategy }, /* strategy */
|
||||
{ &vop_print_desc, portal_print }, /* print */
|
||||
{ &vop_islocked_desc, portal_islocked }, /* islocked */
|
||||
{ &vop_pathconf_desc, portal_pathconf }, /* pathconf */
|
||||
{ &vop_advlock_desc, portal_advlock }, /* advlock */
|
||||
{ &vop_blkatoff_desc, portal_blkatoff }, /* blkatoff */
|
||||
{ &vop_valloc_desc, portal_valloc }, /* valloc */
|
||||
{ &vop_vfree_desc, portal_vfree }, /* vfree */
|
||||
{ &vop_truncate_desc, portal_truncate }, /* truncate */
|
||||
{ &vop_update_desc, portal_update }, /* update */
|
||||
{ &vop_bwrite_desc, portal_bwrite }, /* bwrite */
|
||||
{ (struct vnodeop_desc*)NULL, (int(*)())NULL }
|
||||
};
|
||||
struct vnodeopv_desc portal_vnodeop_opv_desc =
|
||||
{ &portal_vnodeop_p, portal_vnodeop_entries };
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: procfs.h,v 1.15 1996/02/09 18:47:48 mycroft Exp $ */
|
||||
/* $NetBSD: procfs.h,v 1.16 1996/02/09 22:40:46 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993 Jan-Simon Pendry
|
||||
@ -121,48 +121,10 @@ int procfs_validregs __P((struct proc *));
|
||||
#define PROCFS_LOCKED 0x01
|
||||
#define PROCFS_WANT 0x02
|
||||
|
||||
extern int (**procfs_vnodeop_p)();
|
||||
extern int (**procfs_vnodeop_p) __P((void *));
|
||||
extern struct vfsops procfs_vfsops;
|
||||
|
||||
/*
|
||||
* Prototypes for procfs vnode ops
|
||||
*/
|
||||
int procfs_badop(); /* varargs */
|
||||
int procfs_rw __P((struct vop_read_args *));
|
||||
int procfs_lookup __P((struct vop_lookup_args *));
|
||||
#define procfs_create ((int (*) __P((struct vop_create_args *))) procfs_badop)
|
||||
#define procfs_mknod ((int (*) __P((struct vop_mknod_args *))) procfs_badop)
|
||||
int procfs_open __P((struct vop_open_args *));
|
||||
int procfs_close __P((struct vop_close_args *));
|
||||
int procfs_access __P((struct vop_access_args *));
|
||||
int procfs_getattr __P((struct vop_getattr_args *));
|
||||
int procfs_setattr __P((struct vop_setattr_args *));
|
||||
#define procfs_read procfs_rw
|
||||
#define procfs_write procfs_rw
|
||||
int procfs_ioctl __P((struct vop_ioctl_args *));
|
||||
#define procfs_select ((int (*) __P((struct vop_select_args *))) procfs_badop)
|
||||
#define procfs_mmap ((int (*) __P((struct vop_mmap_args *))) procfs_badop)
|
||||
#define procfs_fsync ((int (*) __P((struct vop_fsync_args *))) procfs_badop)
|
||||
#define procfs_seek ((int (*) __P((struct vop_seek_args *))) procfs_badop)
|
||||
#define procfs_remove ((int (*) __P((struct vop_remove_args *))) procfs_badop)
|
||||
#define procfs_rename ((int (*) __P((struct vop_rename_args *))) procfs_badop)
|
||||
#define procfs_mkdir ((int (*) __P((struct vop_mkdir_args *))) procfs_badop)
|
||||
#define procfs_rmdir ((int (*) __P((struct vop_rmdir_args *))) procfs_badop)
|
||||
int procfs_readdir __P((struct vop_readdir_args *));
|
||||
int procfs_readlink __P((struct vop_readlink_args *));
|
||||
int procfs_abortop __P((struct vop_abortop_args *));
|
||||
int procfs_inactive __P((struct vop_inactive_args *));
|
||||
int procfs_reclaim __P((struct vop_reclaim_args *));
|
||||
#define procfs_lock ((int (*) __P((struct vop_lock_args *))) nullop)
|
||||
#define procfs_unlock ((int (*) __P((struct vop_unlock_args *))) nullop)
|
||||
int procfs_bmap __P((struct vop_bmap_args *));
|
||||
#define procfs_strategy ((int (*) __P((struct vop_strategy_args *))) procfs_badop)
|
||||
int procfs_print __P((struct vop_print_args *));
|
||||
#define procfs_islocked ((int (*) __P((struct vop_islocked_args *))) nullop)
|
||||
#define procfs_advlock ((int (*) __P((struct vop_advlock_args *))) procfs_badop)
|
||||
#define procfs_blkatoff ((int (*) __P((struct vop_blkatoff_args *))) procfs_badop)
|
||||
#define procfs_valloc ((int (*) __P((struct vop_valloc_args *))) procfs_badop)
|
||||
#define procfs_vfree ((int (*) __P((struct vop_vfree_args *))) nullop)
|
||||
#define procfs_truncate ((int (*) __P((struct vop_truncate_args *))) procfs_badop)
|
||||
#define procfs_update ((int (*) __P((struct vop_update_args *))) nullop)
|
||||
void procfs_init __P((void));
|
||||
int procfs_root __P((struct mount *, struct vnode **));
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: procfs_ctl.c,v 1.13 1995/08/13 09:06:02 mycroft Exp $ */
|
||||
/* $NetBSD: procfs_ctl.c,v 1.14 1996/02/09 22:40:48 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993 Jan-Simon Pendry
|
||||
@ -49,6 +49,7 @@
|
||||
#include <sys/tty.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/resourcevar.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/ptrace.h>
|
||||
#include <miscfs/procfs/procfs.h>
|
||||
|
||||
@ -98,6 +99,8 @@ static vfs_namemap_t signames[] = {
|
||||
{ 0 },
|
||||
};
|
||||
|
||||
static int procfs_control __P((struct proc *, struct proc *, int));
|
||||
|
||||
static int
|
||||
procfs_control(curp, p, op)
|
||||
struct proc *curp;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: procfs_mem.c,v 1.7 1995/01/05 07:10:54 chopps Exp $ */
|
||||
/* $NetBSD: procfs_mem.c,v 1.8 1996/02/09 22:40:50 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993 Jan-Simon Pendry
|
||||
@ -56,6 +56,8 @@
|
||||
#include <vm/vm_kern.h>
|
||||
#include <vm/vm_page.h>
|
||||
|
||||
static int procfs_rwmem __P((struct proc *, struct uio *));
|
||||
|
||||
static int
|
||||
procfs_rwmem(p, uio)
|
||||
struct proc *p;
|
||||
@ -182,7 +184,8 @@ procfs_rwmem(p, uio)
|
||||
* Now do the i/o move.
|
||||
*/
|
||||
if (!error)
|
||||
error = uiomove(kva + page_offset, len, uio);
|
||||
error = uiomove((caddr_t) (kva + page_offset),
|
||||
len, uio);
|
||||
|
||||
vm_map_remove(kernel_map, kva, kva + PAGE_SIZE);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: procfs_subr.c,v 1.13 1994/06/29 06:34:57 cgd Exp $ */
|
||||
/* $NetBSD: procfs_subr.c,v 1.14 1996/02/09 22:40:51 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993 Jan-Simon Pendry
|
||||
@ -51,6 +51,8 @@
|
||||
static struct pfsnode *pfshead;
|
||||
static int pfsvplock;
|
||||
|
||||
int procfs_rw __P((struct vop_read_args *));
|
||||
|
||||
/*
|
||||
* allocate a pfsnode/vnode pair. the vnode is
|
||||
* referenced, but not locked.
|
||||
@ -113,7 +115,7 @@ loop:
|
||||
}
|
||||
pfsvplock |= PROCFS_LOCKED;
|
||||
|
||||
if (error = getnewvnode(VT_PROCFS, mp, procfs_vnodeop_p, vpp))
|
||||
if ((error = getnewvnode(VT_PROCFS, mp, procfs_vnodeop_p, vpp)) != 0)
|
||||
goto out;
|
||||
vp = *vpp;
|
||||
|
||||
@ -281,7 +283,7 @@ vfs_getuserstr(uio, buf, buflenp)
|
||||
return (EMSGSIZE);
|
||||
xlen = uio->uio_resid;
|
||||
|
||||
if (error = uiomove(buf, xlen, uio))
|
||||
if ((error = uiomove(buf, xlen, uio)) != 0)
|
||||
return (error);
|
||||
|
||||
/* allow multiple writes without seeks */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: procfs_vfsops.c,v 1.24 1995/06/18 14:47:39 cgd Exp $ */
|
||||
/* $NetBSD: procfs_vfsops.c,v 1.25 1996/02/09 22:40:53 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993 Jan-Simon Pendry
|
||||
@ -46,6 +46,7 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/syslog.h>
|
||||
@ -55,12 +56,25 @@
|
||||
#include <miscfs/procfs/procfs.h>
|
||||
#include <vm/vm.h> /* for PAGE_SIZE */
|
||||
|
||||
int procfs_mount __P((struct mount *, char *, caddr_t,
|
||||
struct nameidata *, struct proc *));
|
||||
int procfs_start __P((struct mount *, int, struct proc *));
|
||||
int procfs_unmount __P((struct mount *, int, struct proc *));
|
||||
int procfs_quotactl __P((struct mount *, int, uid_t, caddr_t,
|
||||
struct proc *));
|
||||
int procfs_statfs __P((struct mount *, struct statfs *, struct proc *));
|
||||
int procfs_sync __P((struct mount *, int, struct ucred *, struct proc *));
|
||||
int procfs_vget __P((struct mount *, ino_t, struct vnode **));
|
||||
int procfs_fhtovp __P((struct mount *, struct fid *, struct mbuf *,
|
||||
struct vnode **, int *, struct ucred **));
|
||||
int procfs_vptofh __P((struct vnode *, struct fid *));
|
||||
/*
|
||||
* VFS Operations.
|
||||
*
|
||||
* mount system call
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
int
|
||||
procfs_mount(mp, path, data, ndp, p)
|
||||
struct mount *mp;
|
||||
char *path;
|
||||
@ -92,6 +106,7 @@ procfs_mount(mp, path, data, ndp, p)
|
||||
/*
|
||||
* unmount system call
|
||||
*/
|
||||
int
|
||||
procfs_unmount(mp, mntflags, p)
|
||||
struct mount *mp;
|
||||
int mntflags;
|
||||
@ -108,12 +123,13 @@ procfs_unmount(mp, mntflags, p)
|
||||
flags |= FORCECLOSE;
|
||||
}
|
||||
|
||||
if (error = vflush(mp, 0, flags))
|
||||
if ((error = vflush(mp, 0, flags)) != 0)
|
||||
return (error);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
procfs_root(mp, vpp)
|
||||
struct mount *mp;
|
||||
struct vnode **vpp;
|
||||
@ -123,6 +139,7 @@ procfs_root(mp, vpp)
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
procfs_start(mp, flags, p)
|
||||
struct mount *mp;
|
||||
int flags;
|
||||
@ -135,6 +152,7 @@ procfs_start(mp, flags, p)
|
||||
/*
|
||||
* Get file system statistics.
|
||||
*/
|
||||
int
|
||||
procfs_statfs(mp, sbp, p)
|
||||
struct mount *mp;
|
||||
struct statfs *sbp;
|
||||
@ -162,6 +180,8 @@ procfs_statfs(mp, sbp, p)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
procfs_quotactl(mp, cmds, uid, arg, p)
|
||||
struct mount *mp;
|
||||
int cmds;
|
||||
@ -173,14 +193,20 @@ procfs_quotactl(mp, cmds, uid, arg, p)
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
procfs_sync(mp, waitfor)
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
procfs_sync(mp, waitfor, uc, p)
|
||||
struct mount *mp;
|
||||
int waitfor;
|
||||
struct ucred *uc;
|
||||
struct proc *p;
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
procfs_vget(mp, ino, vpp)
|
||||
struct mount *mp;
|
||||
ino_t ino;
|
||||
@ -190,15 +216,22 @@ procfs_vget(mp, ino, vpp)
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
procfs_fhtovp(mp, fhp, vpp)
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
procfs_fhtovp(mp, fhp, mb, vpp, what, anon)
|
||||
struct mount *mp;
|
||||
struct fid *fhp;
|
||||
struct mbuf *mb;
|
||||
struct vnode **vpp;
|
||||
int *what;
|
||||
struct ucred **anon;
|
||||
{
|
||||
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
procfs_vptofh(vp, fhp)
|
||||
struct vnode *vp;
|
||||
struct fid *fhp;
|
||||
@ -207,10 +240,9 @@ procfs_vptofh(vp, fhp)
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
void
|
||||
procfs_init()
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
struct vfsops procfs_vfsops = {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: procfs_vnops.c,v 1.36 1996/02/09 14:45:53 mycroft Exp $ */
|
||||
/* $NetBSD: procfs_vnops.c,v 1.37 1996/02/09 22:40:54 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993 Jan-Simon Pendry
|
||||
@ -94,6 +94,102 @@ static int nproc_targets = sizeof(proc_targets) / sizeof(proc_targets[0]);
|
||||
|
||||
static pid_t atopid __P((const char *, u_int));
|
||||
|
||||
/*
|
||||
* Prototypes for procfs vnode ops
|
||||
*/
|
||||
int procfs_badop __P((void *));
|
||||
int procfs_rw __P((void *));
|
||||
int procfs_lookup __P((void *));
|
||||
#define procfs_create procfs_badop
|
||||
#define procfs_mknod procfs_badop
|
||||
int procfs_open __P((void *));
|
||||
int procfs_close __P((void *));
|
||||
int procfs_access __P((void *));
|
||||
int procfs_getattr __P((void *));
|
||||
int procfs_setattr __P((void *));
|
||||
#define procfs_read procfs_rw
|
||||
#define procfs_write procfs_rw
|
||||
int procfs_ioctl __P((void *));
|
||||
#define procfs_select procfs_badop
|
||||
#define procfs_mmap procfs_badop
|
||||
#define procfs_fsync procfs_badop
|
||||
#define procfs_seek procfs_badop
|
||||
#define procfs_remove procfs_badop
|
||||
int procfs_link __P((void *));
|
||||
#define procfs_rename procfs_badop
|
||||
#define procfs_mkdir procfs_badop
|
||||
#define procfs_rmdir procfs_badop
|
||||
int procfs_symlink __P((void *));
|
||||
int procfs_readdir __P((void *));
|
||||
int procfs_readlink __P((void *));
|
||||
int procfs_abortop __P((void *));
|
||||
int procfs_inactive __P((void *));
|
||||
int procfs_reclaim __P((void *));
|
||||
#define procfs_lock nullop
|
||||
#define procfs_unlock nullop
|
||||
int procfs_bmap __P((void *));
|
||||
#define procfs_strategy procfs_badop
|
||||
int procfs_print __P((void *));
|
||||
int procfs_pathconf __P((void *));
|
||||
#define procfs_islocked nullop
|
||||
#define procfs_advlock procfs_badop
|
||||
#define procfs_blkatoff procfs_badop
|
||||
#define procfs_valloc procfs_badop
|
||||
#define procfs_vfree nullop
|
||||
#define procfs_truncate procfs_badop
|
||||
#define procfs_update nullop
|
||||
|
||||
static pid_t atopid __P((const char *, u_int));
|
||||
|
||||
/*
|
||||
* procfs vnode operations.
|
||||
*/
|
||||
int (**procfs_vnodeop_p) __P((void *));
|
||||
struct vnodeopv_entry_desc procfs_vnodeop_entries[] = {
|
||||
{ &vop_default_desc, vn_default_error },
|
||||
{ &vop_lookup_desc, procfs_lookup }, /* lookup */
|
||||
{ &vop_create_desc, procfs_create }, /* create */
|
||||
{ &vop_mknod_desc, procfs_mknod }, /* mknod */
|
||||
{ &vop_open_desc, procfs_open }, /* open */
|
||||
{ &vop_close_desc, procfs_close }, /* close */
|
||||
{ &vop_access_desc, procfs_access }, /* access */
|
||||
{ &vop_getattr_desc, procfs_getattr }, /* getattr */
|
||||
{ &vop_setattr_desc, procfs_setattr }, /* setattr */
|
||||
{ &vop_read_desc, procfs_read }, /* read */
|
||||
{ &vop_write_desc, procfs_write }, /* write */
|
||||
{ &vop_ioctl_desc, procfs_ioctl }, /* ioctl */
|
||||
{ &vop_select_desc, procfs_select }, /* select */
|
||||
{ &vop_mmap_desc, procfs_mmap }, /* mmap */
|
||||
{ &vop_fsync_desc, procfs_fsync }, /* fsync */
|
||||
{ &vop_seek_desc, procfs_seek }, /* seek */
|
||||
{ &vop_remove_desc, procfs_remove }, /* remove */
|
||||
{ &vop_link_desc, procfs_link }, /* link */
|
||||
{ &vop_rename_desc, procfs_rename }, /* rename */
|
||||
{ &vop_mkdir_desc, procfs_mkdir }, /* mkdir */
|
||||
{ &vop_rmdir_desc, procfs_rmdir }, /* rmdir */
|
||||
{ &vop_symlink_desc, procfs_symlink }, /* symlink */
|
||||
{ &vop_readdir_desc, procfs_readdir }, /* readdir */
|
||||
{ &vop_readlink_desc, procfs_readlink }, /* readlink */
|
||||
{ &vop_abortop_desc, procfs_abortop }, /* abortop */
|
||||
{ &vop_inactive_desc, procfs_inactive }, /* inactive */
|
||||
{ &vop_reclaim_desc, procfs_reclaim }, /* reclaim */
|
||||
{ &vop_lock_desc, procfs_lock }, /* lock */
|
||||
{ &vop_unlock_desc, procfs_unlock }, /* unlock */
|
||||
{ &vop_bmap_desc, procfs_bmap }, /* bmap */
|
||||
{ &vop_strategy_desc, procfs_strategy }, /* strategy */
|
||||
{ &vop_print_desc, procfs_print }, /* print */
|
||||
{ &vop_islocked_desc, procfs_islocked }, /* islocked */
|
||||
{ &vop_pathconf_desc, procfs_pathconf }, /* pathconf */
|
||||
{ &vop_advlock_desc, procfs_advlock }, /* advlock */
|
||||
{ &vop_blkatoff_desc, procfs_blkatoff }, /* blkatoff */
|
||||
{ &vop_valloc_desc, procfs_valloc }, /* valloc */
|
||||
{ &vop_vfree_desc, procfs_vfree }, /* vfree */
|
||||
{ &vop_truncate_desc, procfs_truncate }, /* truncate */
|
||||
{ &vop_update_desc, procfs_update }, /* update */
|
||||
{ (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL }
|
||||
};
|
||||
struct vnodeopv_desc procfs_vnodeop_opv_desc =
|
||||
{ &procfs_vnodeop_p, procfs_vnodeop_entries };
|
||||
/*
|
||||
* set things up for doing i/o on
|
||||
* the pfsnode (vp). (vp) is locked
|
||||
@ -105,14 +201,16 @@ static pid_t atopid __P((const char *, u_int));
|
||||
* is to support exclusive open on process
|
||||
* memory images.
|
||||
*/
|
||||
procfs_open(ap)
|
||||
int
|
||||
procfs_open(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_open_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_mode;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct pfsnode *pfs = VTOPFS(ap->a_vp);
|
||||
|
||||
switch (pfs->pfs_type) {
|
||||
@ -120,8 +218,8 @@ procfs_open(ap)
|
||||
if (PFIND(pfs->pfs_pid) == 0)
|
||||
return (ENOENT); /* was ESRCH, jsp */
|
||||
|
||||
if ((pfs->pfs_flags & FWRITE) && (ap->a_mode & O_EXCL) ||
|
||||
(pfs->pfs_flags & O_EXCL) && (ap->a_mode & FWRITE))
|
||||
if (((pfs->pfs_flags & FWRITE) && (ap->a_mode & O_EXCL)) ||
|
||||
((pfs->pfs_flags & O_EXCL) && (ap->a_mode & FWRITE)))
|
||||
return (EBUSY);
|
||||
|
||||
if (ap->a_mode & FWRITE)
|
||||
@ -143,14 +241,16 @@ procfs_open(ap)
|
||||
* nothing to do for procfs other than undo
|
||||
* any exclusive open flag (see _open above).
|
||||
*/
|
||||
procfs_close(ap)
|
||||
int
|
||||
procfs_close(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_close_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_fflag;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct pfsnode *pfs = VTOPFS(ap->a_vp);
|
||||
|
||||
switch (pfs->pfs_type) {
|
||||
@ -158,6 +258,17 @@ procfs_close(ap)
|
||||
if ((ap->a_fflag & FWRITE) && (pfs->pfs_flags & O_EXCL))
|
||||
pfs->pfs_flags &= ~(FWRITE|O_EXCL);
|
||||
break;
|
||||
case Pctl:
|
||||
case Pstatus:
|
||||
case Pnotepg:
|
||||
case Pnote:
|
||||
case Proot:
|
||||
case Pcurproc:
|
||||
case Pproc:
|
||||
case Pfile:
|
||||
case Pregs:
|
||||
case Pfpregs:
|
||||
break;
|
||||
}
|
||||
|
||||
return (0);
|
||||
@ -167,15 +278,10 @@ procfs_close(ap)
|
||||
* do an ioctl operation on pfsnode (vp).
|
||||
* (vp) is not locked on entry or exit.
|
||||
*/
|
||||
procfs_ioctl(ap)
|
||||
struct vop_ioctl_args /* {
|
||||
struct vnode *a_vp;
|
||||
u_long a_command;
|
||||
caddr_t a_data;
|
||||
int a_fflag;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
procfs_ioctl(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (ENOTTY);
|
||||
@ -191,14 +297,16 @@ procfs_ioctl(ap)
|
||||
* usual no-op bmap, although returning
|
||||
* (EIO) would be a reasonable alternative.
|
||||
*/
|
||||
procfs_bmap(ap)
|
||||
int
|
||||
procfs_bmap(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_bmap_args /* {
|
||||
struct vnode *a_vp;
|
||||
daddr_t a_bn;
|
||||
struct vnode **a_vpp;
|
||||
daddr_t *a_bnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
if (ap->a_vpp != NULL)
|
||||
*ap->a_vpp = ap->a_vp;
|
||||
@ -223,11 +331,13 @@ procfs_bmap(ap)
|
||||
*
|
||||
* (vp) is not locked on entry or exit.
|
||||
*/
|
||||
procfs_inactive(ap)
|
||||
int
|
||||
procfs_inactive(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_inactive_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct pfsnode *pfs = VTOPFS(ap->a_vp);
|
||||
|
||||
if (PFIND(pfs->pfs_pid) == 0)
|
||||
@ -243,11 +353,13 @@ procfs_inactive(ap)
|
||||
* to free any private data and remove the node
|
||||
* from any private lists.
|
||||
*/
|
||||
procfs_reclaim(ap)
|
||||
int
|
||||
procfs_reclaim(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_reclaim_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
return (procfs_freevp(ap->a_vp));
|
||||
}
|
||||
@ -255,13 +367,15 @@ procfs_reclaim(ap)
|
||||
/*
|
||||
* Return POSIX pathconf information applicable to special devices.
|
||||
*/
|
||||
procfs_pathconf(ap)
|
||||
int
|
||||
procfs_pathconf(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_pathconf_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_name;
|
||||
register_t *a_retval;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
switch (ap->a_name) {
|
||||
case _PC_LINK_MAX:
|
||||
@ -293,25 +407,29 @@ procfs_pathconf(ap)
|
||||
* just print a readable description
|
||||
* of (vp).
|
||||
*/
|
||||
procfs_print(ap)
|
||||
int
|
||||
procfs_print(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_print_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct pfsnode *pfs = VTOPFS(ap->a_vp);
|
||||
|
||||
printf("tag VT_PROCFS, type %s, pid %d, mode %x, flags %x\n",
|
||||
printf("tag VT_PROCFS, type %d, pid %d, mode %x, flags %x\n",
|
||||
pfs->pfs_type, pfs->pfs_pid, pfs->pfs_mode, pfs->pfs_flags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
procfs_link(ap)
|
||||
procfs_link(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_link_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode *a_vp;
|
||||
struct componentname *a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
VOP_ABORTOP(ap->a_dvp, ap->a_cnp);
|
||||
vput(ap->a_dvp);
|
||||
@ -319,15 +437,16 @@ procfs_link(ap)
|
||||
}
|
||||
|
||||
int
|
||||
procfs_symlink(ap)
|
||||
procfs_symlink(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_symlink_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode **a_vpp;
|
||||
struct componentname *a_cnp;
|
||||
struct vattr *a_vap;
|
||||
char *a_target;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
VOP_ABORTOP(ap->a_dvp, ap->a_cnp);
|
||||
vput(ap->a_dvp);
|
||||
@ -340,12 +459,14 @@ procfs_symlink(ap)
|
||||
* for undoing any side-effects caused by the lookup.
|
||||
* this will always include freeing the pathname buffer.
|
||||
*/
|
||||
procfs_abortop(ap)
|
||||
int
|
||||
procfs_abortop(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_abortop_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct componentname *a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF)
|
||||
FREE(ap->a_cnp->cn_pnbuf, M_NAMEI);
|
||||
@ -355,7 +476,10 @@ procfs_abortop(ap)
|
||||
/*
|
||||
* generic entry point for unsupported operations
|
||||
*/
|
||||
procfs_badop()
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
procfs_badop(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (EIO);
|
||||
@ -370,14 +494,16 @@ procfs_badop()
|
||||
*
|
||||
* this is relatively minimal for procfs.
|
||||
*/
|
||||
procfs_getattr(ap)
|
||||
int
|
||||
procfs_getattr(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_getattr_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct vattr *a_vap;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct pfsnode *pfs = VTOPFS(ap->a_vp);
|
||||
struct vattr *vap = ap->a_vap;
|
||||
struct proc *procp;
|
||||
@ -443,6 +569,11 @@ procfs_getattr(ap)
|
||||
vap->va_uid = procp->p_ucred->cr_uid;
|
||||
vap->va_gid = procp->p_ucred->cr_gid;
|
||||
break;
|
||||
case Pproc:
|
||||
case Pfile:
|
||||
case Proot:
|
||||
case Pcurproc:
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -519,13 +650,10 @@ procfs_getattr(ap)
|
||||
return (error);
|
||||
}
|
||||
|
||||
procfs_setattr(ap)
|
||||
struct vop_setattr_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct vattr *a_vap;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
procfs_setattr(v)
|
||||
void *v;
|
||||
{
|
||||
/*
|
||||
* just fake out attribute setting
|
||||
@ -548,22 +676,24 @@ procfs_setattr(ap)
|
||||
* but does mean that the i/o entry points need to check
|
||||
* that the operation really does make sense.
|
||||
*/
|
||||
procfs_access(ap)
|
||||
int
|
||||
procfs_access(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_access_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_mode;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct vattr va;
|
||||
int error;
|
||||
|
||||
if (error = VOP_GETATTR(ap->a_vp, &va, ap->a_cred, ap->a_p))
|
||||
if ((error = VOP_GETATTR(ap->a_vp, &va, ap->a_cred, ap->a_p)) != 0)
|
||||
return (error);
|
||||
|
||||
return (vaccess(va.va_mode, va.va_uid, va.va_gid, ap->a_mode,
|
||||
ap->a_cred));
|
||||
ap->a_cred));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -575,13 +705,15 @@ procfs_access(ap)
|
||||
* filesystem doesn't do any locking of its own. otherwise
|
||||
* read and inwardly digest ufs_lookup().
|
||||
*/
|
||||
procfs_lookup(ap)
|
||||
int
|
||||
procfs_lookup(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_lookup_args /* {
|
||||
struct vnode * a_dvp;
|
||||
struct vnode ** a_vpp;
|
||||
struct componentname * a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct componentname *cnp = ap->a_cnp;
|
||||
struct vnode **vpp = ap->a_vpp;
|
||||
struct vnode *dvp = ap->a_dvp;
|
||||
@ -680,7 +812,10 @@ procfs_validfile(p)
|
||||
*
|
||||
* this should just be done through read()
|
||||
*/
|
||||
procfs_readdir(ap)
|
||||
int
|
||||
procfs_readdir(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_readdir_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
@ -688,8 +823,7 @@ procfs_readdir(ap)
|
||||
int *a_eofflag;
|
||||
u_long *a_cookies;
|
||||
int a_ncookies;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct uio *uio = ap->a_uio;
|
||||
struct dirent d;
|
||||
struct pfsnode *pfs;
|
||||
@ -734,7 +868,7 @@ procfs_readdir(ap)
|
||||
bcopy(pt->pt_name, d.d_name, pt->pt_namlen + 1);
|
||||
d.d_type = pt->pt_type;
|
||||
|
||||
if (error = uiomove((caddr_t)&d, UIO_MX, uio))
|
||||
if ((error = uiomove((caddr_t)&d, UIO_MX, uio)) != 0)
|
||||
break;
|
||||
if (ncookies-- > 0)
|
||||
*cookies++ = i + 1;
|
||||
@ -761,7 +895,9 @@ procfs_readdir(ap)
|
||||
|
||||
if (pcnt > 3)
|
||||
pcnt = 3;
|
||||
#ifdef PROCFS_ZOMBIE
|
||||
again:
|
||||
#endif
|
||||
for (; p && uio->uio_resid >= UIO_MX; i++, pcnt++) {
|
||||
switch (i) {
|
||||
case 0: /* `.' */
|
||||
@ -795,7 +931,7 @@ procfs_readdir(ap)
|
||||
break;
|
||||
}
|
||||
|
||||
if (error = uiomove((caddr_t)&d, UIO_MX, uio))
|
||||
if ((error = uiomove((caddr_t)&d, UIO_MX, uio)) != 0)
|
||||
break;
|
||||
if (ncookies-- > 0)
|
||||
*cookies++ = i + 1;
|
||||
@ -826,10 +962,11 @@ procfs_readdir(ap)
|
||||
/*
|
||||
* readlink reads the link of `curproc'
|
||||
*/
|
||||
procfs_readlink(ap)
|
||||
struct vop_readlink_args *ap;
|
||||
int
|
||||
procfs_readlink(v)
|
||||
void *v;
|
||||
{
|
||||
struct uio *uio = ap->a_uio;
|
||||
struct vop_readlink_args *ap = v;
|
||||
char buf[16]; /* should be enough */
|
||||
int len;
|
||||
|
||||
@ -862,53 +999,3 @@ atopid(b, len)
|
||||
|
||||
return (p);
|
||||
}
|
||||
|
||||
/*
|
||||
* procfs vnode operations.
|
||||
*/
|
||||
int (**procfs_vnodeop_p)();
|
||||
struct vnodeopv_entry_desc procfs_vnodeop_entries[] = {
|
||||
{ &vop_default_desc, vn_default_error },
|
||||
{ &vop_lookup_desc, procfs_lookup }, /* lookup */
|
||||
{ &vop_create_desc, procfs_create }, /* create */
|
||||
{ &vop_mknod_desc, procfs_mknod }, /* mknod */
|
||||
{ &vop_open_desc, procfs_open }, /* open */
|
||||
{ &vop_close_desc, procfs_close }, /* close */
|
||||
{ &vop_access_desc, procfs_access }, /* access */
|
||||
{ &vop_getattr_desc, procfs_getattr }, /* getattr */
|
||||
{ &vop_setattr_desc, procfs_setattr }, /* setattr */
|
||||
{ &vop_read_desc, procfs_read }, /* read */
|
||||
{ &vop_write_desc, procfs_write }, /* write */
|
||||
{ &vop_ioctl_desc, procfs_ioctl }, /* ioctl */
|
||||
{ &vop_select_desc, procfs_select }, /* select */
|
||||
{ &vop_mmap_desc, procfs_mmap }, /* mmap */
|
||||
{ &vop_fsync_desc, procfs_fsync }, /* fsync */
|
||||
{ &vop_seek_desc, procfs_seek }, /* seek */
|
||||
{ &vop_remove_desc, procfs_remove }, /* remove */
|
||||
{ &vop_link_desc, procfs_link }, /* link */
|
||||
{ &vop_rename_desc, procfs_rename }, /* rename */
|
||||
{ &vop_mkdir_desc, procfs_mkdir }, /* mkdir */
|
||||
{ &vop_rmdir_desc, procfs_rmdir }, /* rmdir */
|
||||
{ &vop_symlink_desc, procfs_symlink }, /* symlink */
|
||||
{ &vop_readdir_desc, procfs_readdir }, /* readdir */
|
||||
{ &vop_readlink_desc, procfs_readlink }, /* readlink */
|
||||
{ &vop_abortop_desc, procfs_abortop }, /* abortop */
|
||||
{ &vop_inactive_desc, procfs_inactive }, /* inactive */
|
||||
{ &vop_reclaim_desc, procfs_reclaim }, /* reclaim */
|
||||
{ &vop_lock_desc, procfs_lock }, /* lock */
|
||||
{ &vop_unlock_desc, procfs_unlock }, /* unlock */
|
||||
{ &vop_bmap_desc, procfs_bmap }, /* bmap */
|
||||
{ &vop_strategy_desc, procfs_strategy }, /* strategy */
|
||||
{ &vop_print_desc, procfs_print }, /* print */
|
||||
{ &vop_islocked_desc, procfs_islocked }, /* islocked */
|
||||
{ &vop_pathconf_desc, procfs_pathconf }, /* pathconf */
|
||||
{ &vop_advlock_desc, procfs_advlock }, /* advlock */
|
||||
{ &vop_blkatoff_desc, procfs_blkatoff }, /* blkatoff */
|
||||
{ &vop_valloc_desc, procfs_valloc }, /* valloc */
|
||||
{ &vop_vfree_desc, procfs_vfree }, /* vfree */
|
||||
{ &vop_truncate_desc, procfs_truncate }, /* truncate */
|
||||
{ &vop_update_desc, procfs_update }, /* update */
|
||||
{ (struct vnodeop_desc*)NULL, (int(*)())NULL }
|
||||
};
|
||||
struct vnodeopv_desc procfs_vnodeop_opv_desc =
|
||||
{ &procfs_vnodeop_p, procfs_vnodeop_entries };
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: spec_vnops.c,v 1.27 1995/10/15 05:18:12 mycroft Exp $ */
|
||||
/* $NetBSD: spec_vnops.c,v 1.28 1996/02/09 22:40:57 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -49,6 +49,8 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/disklabel.h>
|
||||
#include <sys/cpu.h>
|
||||
|
||||
#include <miscfs/specfs/specdev.h>
|
||||
|
||||
/* symbolic sleep message strings for devices */
|
||||
@ -60,7 +62,7 @@ char devout[] = "devout";
|
||||
char devioc[] = "devioc";
|
||||
char devcls[] = "devcls";
|
||||
|
||||
int (**spec_vnodeop_p)();
|
||||
int (**spec_vnodeop_p) __P((void *));
|
||||
struct vnodeopv_entry_desc spec_vnodeop_entries[] = {
|
||||
{ &vop_default_desc, vn_default_error },
|
||||
{ &vop_lookup_desc, spec_lookup }, /* lookup */
|
||||
@ -103,8 +105,8 @@ struct vnodeopv_entry_desc spec_vnodeop_entries[] = {
|
||||
{ &vop_vfree_desc, spec_vfree }, /* vfree */
|
||||
{ &vop_truncate_desc, spec_truncate }, /* truncate */
|
||||
{ &vop_update_desc, spec_update }, /* update */
|
||||
{ &vop_bwrite_desc, vn_bwrite }, /* bwrite */
|
||||
{ (struct vnodeop_desc*)NULL, (int(*)())NULL }
|
||||
{ &vop_bwrite_desc, spec_bwrite }, /* bwrite */
|
||||
{ (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL }
|
||||
};
|
||||
struct vnodeopv_desc spec_vnodeop_opv_desc =
|
||||
{ &spec_vnodeop_p, spec_vnodeop_entries };
|
||||
@ -113,13 +115,14 @@ struct vnodeopv_desc spec_vnodeop_opv_desc =
|
||||
* Trivial lookup routine that always fails.
|
||||
*/
|
||||
int
|
||||
spec_lookup(ap)
|
||||
spec_lookup(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_lookup_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode **a_vpp;
|
||||
struct componentname *a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
*ap->a_vpp = NULL;
|
||||
return (ENOTDIR);
|
||||
@ -129,14 +132,16 @@ spec_lookup(ap)
|
||||
* Open a special file.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
spec_open(ap)
|
||||
int
|
||||
spec_open(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_open_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_mode;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct vnode *bvp, *vp = ap->a_vp;
|
||||
dev_t bdev, dev = (dev_t)vp->v_rdev;
|
||||
register int maj = major(dev);
|
||||
@ -197,9 +202,17 @@ spec_open(ap)
|
||||
* Do not allow opens of block devices that are
|
||||
* currently mounted.
|
||||
*/
|
||||
if (error = vfs_mountedon(vp))
|
||||
if ((error = vfs_mountedon(vp)) != 0)
|
||||
return (error);
|
||||
return ((*bdevsw[maj].d_open)(dev, ap->a_mode, S_IFBLK, ap->a_p));
|
||||
case VNON:
|
||||
case VLNK:
|
||||
case VDIR:
|
||||
case VREG:
|
||||
case VBAD:
|
||||
case VFIFO:
|
||||
case VSOCK:
|
||||
break;
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
@ -208,14 +221,16 @@ spec_open(ap)
|
||||
* Vnode op for read
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
spec_read(ap)
|
||||
int
|
||||
spec_read(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_read_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
int a_ioflag;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
register struct vnode *vp = ap->a_vp;
|
||||
register struct uio *uio = ap->a_uio;
|
||||
struct proc *p = uio->uio_procp;
|
||||
@ -223,7 +238,8 @@ spec_read(ap)
|
||||
daddr_t bn, nextbn;
|
||||
long bsize, bscale, ssize;
|
||||
struct partinfo dpart;
|
||||
int n, on, majordev, (*ioctl)();
|
||||
int n, on, majordev;
|
||||
int (*ioctl) __P((dev_t, u_long, caddr_t, int, struct proc *));
|
||||
int error = 0;
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
@ -293,14 +309,16 @@ spec_read(ap)
|
||||
* Vnode op for write
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
spec_write(ap)
|
||||
int
|
||||
spec_write(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_write_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
int a_ioflag;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
register struct vnode *vp = ap->a_vp;
|
||||
register struct uio *uio = ap->a_uio;
|
||||
struct proc *p = uio->uio_procp;
|
||||
@ -308,7 +326,8 @@ spec_write(ap)
|
||||
daddr_t bn;
|
||||
long bsize, bscale, ssize;
|
||||
struct partinfo dpart;
|
||||
int n, on, majordev, (*ioctl)();
|
||||
int n, on, majordev;
|
||||
int (*ioctl) __P((dev_t, u_long, caddr_t, int, struct proc *));
|
||||
int error = 0;
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
@ -376,7 +395,10 @@ spec_write(ap)
|
||||
* Device ioctl operation.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
spec_ioctl(ap)
|
||||
int
|
||||
spec_ioctl(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_ioctl_args /* {
|
||||
struct vnode *a_vp;
|
||||
u_long a_command;
|
||||
@ -384,8 +406,7 @@ spec_ioctl(ap)
|
||||
int a_fflag;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
dev_t dev = ap->a_vp->v_rdev;
|
||||
int maj = major(dev);
|
||||
|
||||
@ -411,15 +432,17 @@ spec_ioctl(ap)
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
spec_select(ap)
|
||||
int
|
||||
spec_select(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_select_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_which;
|
||||
int a_fflags;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
register dev_t dev;
|
||||
|
||||
switch (ap->a_vp->v_type) {
|
||||
@ -437,14 +460,15 @@ spec_select(ap)
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
int
|
||||
spec_fsync(ap)
|
||||
spec_fsync(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_fsync_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct ucred *a_cred;
|
||||
int a_waitfor;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
register struct vnode *vp = ap->a_vp;
|
||||
register struct buf *bp;
|
||||
struct buf *nbp;
|
||||
@ -489,11 +513,13 @@ loop:
|
||||
/*
|
||||
* Just call the device strategy routine
|
||||
*/
|
||||
spec_strategy(ap)
|
||||
int
|
||||
spec_strategy(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_strategy_args /* {
|
||||
struct buf *a_bp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
(*bdevsw[major(ap->a_bp->b_dev)].d_strategy)(ap->a_bp);
|
||||
return (0);
|
||||
@ -502,14 +528,16 @@ spec_strategy(ap)
|
||||
/*
|
||||
* This is a noop, simply returning what one has been given.
|
||||
*/
|
||||
spec_bmap(ap)
|
||||
int
|
||||
spec_bmap(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_bmap_args /* {
|
||||
struct vnode *a_vp;
|
||||
daddr_t a_bn;
|
||||
struct vnode **a_vpp;
|
||||
daddr_t *a_bnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
if (ap->a_vpp != NULL)
|
||||
*ap->a_vpp = ap->a_vp;
|
||||
@ -522,20 +550,18 @@ spec_bmap(ap)
|
||||
* At the moment we do not do any locking.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
spec_lock(ap)
|
||||
struct vop_lock_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
int
|
||||
spec_lock(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
spec_unlock(ap)
|
||||
struct vop_unlock_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
int
|
||||
spec_unlock(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (0);
|
||||
@ -545,14 +571,16 @@ spec_unlock(ap)
|
||||
* Device close routine
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
spec_close(ap)
|
||||
int
|
||||
spec_close(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_close_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_fflag;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
register struct vnode *vp = ap->a_vp;
|
||||
dev_t dev = vp->v_rdev;
|
||||
int (*devclose) __P((dev_t, int, int, struct proc *));
|
||||
@ -592,7 +620,8 @@ spec_close(ap)
|
||||
* we must invalidate any in core blocks, so that
|
||||
* we can, for instance, change floppy disks.
|
||||
*/
|
||||
if (error = vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_p, 0, 0))
|
||||
error = vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_p, 0, 0);
|
||||
if (error)
|
||||
return (error);
|
||||
/*
|
||||
* We do not want to really close the device if it
|
||||
@ -619,26 +648,31 @@ spec_close(ap)
|
||||
/*
|
||||
* Print out the contents of a special device vnode.
|
||||
*/
|
||||
spec_print(ap)
|
||||
int
|
||||
spec_print(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_print_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
printf("tag VT_NON, dev %d, %d\n", major(ap->a_vp->v_rdev),
|
||||
minor(ap->a_vp->v_rdev));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return POSIX pathconf information applicable to special devices.
|
||||
*/
|
||||
spec_pathconf(ap)
|
||||
int
|
||||
spec_pathconf(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_pathconf_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_name;
|
||||
register_t *a_retval;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
switch (ap->a_name) {
|
||||
case _PC_LINK_MAX:
|
||||
@ -669,14 +703,9 @@ spec_pathconf(ap)
|
||||
* Special device advisory byte-level locks.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
spec_advlock(ap)
|
||||
struct vop_advlock_args /* {
|
||||
struct vnode *a_vp;
|
||||
caddr_t a_id;
|
||||
int a_op;
|
||||
struct flock *a_fl;
|
||||
int a_flags;
|
||||
} */ *ap;
|
||||
int
|
||||
spec_advlock(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (EOPNOTSUPP);
|
||||
@ -685,7 +714,10 @@ spec_advlock(ap)
|
||||
/*
|
||||
* Special device failed operation
|
||||
*/
|
||||
spec_ebadf()
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
spec_ebadf(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
return (EBADF);
|
||||
@ -694,7 +726,10 @@ spec_ebadf()
|
||||
/*
|
||||
* Special device bad operation
|
||||
*/
|
||||
spec_badop()
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
spec_badop(v)
|
||||
void *v;
|
||||
{
|
||||
|
||||
panic("spec_badop called");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: specdev.h,v 1.10 1995/10/15 05:18:17 mycroft Exp $ */
|
||||
/* $NetBSD: specdev.h,v 1.11 1996/02/09 22:40:58 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1990, 1993
|
||||
@ -74,7 +74,7 @@ struct vnode *speclisth[SPECHSZ];
|
||||
/*
|
||||
* Prototypes for special file operations on vnodes.
|
||||
*/
|
||||
extern int (**spec_vnodeop_p)();
|
||||
extern int (**spec_vnodeop_p) __P((void *));
|
||||
struct nameidata;
|
||||
struct componentname;
|
||||
struct ucred;
|
||||
@ -82,48 +82,48 @@ struct flock;
|
||||
struct buf;
|
||||
struct uio;
|
||||
|
||||
int spec_badop(),
|
||||
spec_ebadf();
|
||||
int spec_badop __P((void *)),
|
||||
spec_ebadf __P((void *));
|
||||
|
||||
int spec_lookup __P((struct vop_lookup_args *));
|
||||
#define spec_create ((int (*) __P((struct vop_create_args *)))spec_badop)
|
||||
#define spec_mknod ((int (*) __P((struct vop_mknod_args *)))spec_badop)
|
||||
int spec_open __P((struct vop_open_args *));
|
||||
int spec_close __P((struct vop_close_args *));
|
||||
#define spec_access ((int (*) __P((struct vop_access_args *)))spec_ebadf)
|
||||
#define spec_getattr ((int (*) __P((struct vop_getattr_args *)))spec_ebadf)
|
||||
#define spec_setattr ((int (*) __P((struct vop_setattr_args *)))spec_ebadf)
|
||||
int spec_read __P((struct vop_read_args *));
|
||||
int spec_write __P((struct vop_write_args *));
|
||||
#define spec_lease_check ((int (*) __P((struct vop_lease_args *)))nullop)
|
||||
int spec_ioctl __P((struct vop_ioctl_args *));
|
||||
int spec_select __P((struct vop_select_args *));
|
||||
#define spec_mmap ((int (*) __P((struct vop_mmap_args *)))spec_badop)
|
||||
int spec_fsync __P((struct vop_fsync_args *));
|
||||
#define spec_seek ((int (*) __P((struct vop_seek_args *)))spec_badop)
|
||||
#define spec_remove ((int (*) __P((struct vop_remove_args *)))spec_badop)
|
||||
#define spec_link ((int (*) __P((struct vop_link_args *)))spec_badop)
|
||||
#define spec_rename ((int (*) __P((struct vop_rename_args *)))spec_badop)
|
||||
#define spec_mkdir ((int (*) __P((struct vop_mkdir_args *)))spec_badop)
|
||||
#define spec_rmdir ((int (*) __P((struct vop_rmdir_args *)))spec_badop)
|
||||
#define spec_symlink ((int (*) __P((struct vop_symlink_args *)))spec_badop)
|
||||
#define spec_readdir ((int (*) __P((struct vop_readdir_args *)))spec_badop)
|
||||
#define spec_readlink ((int (*) __P((struct vop_readlink_args *)))spec_badop)
|
||||
#define spec_abortop ((int (*) __P((struct vop_abortop_args *)))spec_badop)
|
||||
#define spec_inactive ((int (*) __P((struct vop_inactive_args *)))nullop)
|
||||
#define spec_reclaim ((int (*) __P((struct vop_reclaim_args *)))nullop)
|
||||
int spec_lock __P((struct vop_lock_args *));
|
||||
int spec_unlock __P((struct vop_unlock_args *));
|
||||
int spec_bmap __P((struct vop_bmap_args *));
|
||||
int spec_strategy __P((struct vop_strategy_args *));
|
||||
int spec_print __P((struct vop_print_args *));
|
||||
#define spec_islocked ((int (*) __P((struct vop_islocked_args *)))nullop)
|
||||
int spec_pathconf __P((struct vop_pathconf_args *));
|
||||
int spec_advlock __P((struct vop_advlock_args *));
|
||||
#define spec_blkatoff ((int (*) __P((struct vop_blkatoff_args *)))spec_badop)
|
||||
#define spec_valloc ((int (*) __P((struct vop_valloc_args *)))spec_badop)
|
||||
#define spec_reallocblks \
|
||||
((int (*) __P((struct vop_reallocblks_args *)))spec_badop)
|
||||
#define spec_vfree ((int (*) __P((struct vop_vfree_args *)))spec_badop)
|
||||
#define spec_truncate ((int (*) __P((struct vop_truncate_args *)))nullop)
|
||||
#define spec_update ((int (*) __P((struct vop_update_args *)))nullop)
|
||||
int spec_lookup __P((void *));
|
||||
#define spec_create spec_badop
|
||||
#define spec_mknod spec_badop
|
||||
int spec_open __P((void *));
|
||||
int spec_close __P((void *));
|
||||
#define spec_access spec_ebadf
|
||||
#define spec_getattr spec_ebadf
|
||||
#define spec_setattr spec_ebadf
|
||||
int spec_read __P((void *));
|
||||
int spec_write __P((void *));
|
||||
#define spec_lease_check nullop
|
||||
int spec_ioctl __P((void *));
|
||||
int spec_select __P((void *));
|
||||
#define spec_mmap spec_badop
|
||||
int spec_fsync __P((void *));
|
||||
#define spec_seek spec_badop
|
||||
#define spec_remove spec_badop
|
||||
#define spec_link spec_badop
|
||||
#define spec_rename spec_badop
|
||||
#define spec_mkdir spec_badop
|
||||
#define spec_rmdir spec_badop
|
||||
#define spec_symlink spec_badop
|
||||
#define spec_readdir spec_badop
|
||||
#define spec_readlink spec_badop
|
||||
#define spec_abortop spec_badop
|
||||
#define spec_inactive nullop
|
||||
#define spec_reclaim nullop
|
||||
int spec_lock __P((void *));
|
||||
int spec_unlock __P((void *));
|
||||
int spec_bmap __P((void *));
|
||||
int spec_strategy __P((void *));
|
||||
int spec_print __P((void *));
|
||||
#define spec_islocked nullop
|
||||
int spec_pathconf __P((void *));
|
||||
int spec_advlock __P((void *));
|
||||
#define spec_blkatoff spec_badop
|
||||
#define spec_valloc spec_badop
|
||||
#define spec_reallocblks spec_badop
|
||||
#define spec_vfree spec_badop
|
||||
#define spec_truncate nullop
|
||||
#define spec_update nullop
|
||||
#define spec_bwrite vn_bwrite
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: umap.h,v 1.5 1995/04/15 01:57:35 cgd Exp $ */
|
||||
/* $NetBSD: umap.h,v 1.6 1996/02/09 22:41:00 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -87,6 +87,9 @@ extern struct vnode *umap_checkvp __P((struct vnode *vp, char *fil, int lno));
|
||||
#define UMAPVPTOLOWERVP(vp) (VTOUMAP(vp)->umap_lowervp)
|
||||
#endif
|
||||
|
||||
extern int (**umap_vnodeop_p)();
|
||||
extern int (**umap_vnodeop_p) __P((void *));
|
||||
extern struct vfsops umap_vfsops;
|
||||
|
||||
void umapfs_init __P((void));
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: umap_subr.c,v 1.6 1995/06/01 22:44:34 jtc Exp $ */
|
||||
/* $NetBSD: umap_subr.c,v 1.7 1996/02/09 22:41:02 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -66,9 +66,15 @@
|
||||
LIST_HEAD(umap_node_hashhead, umap_node) *umap_node_hashtbl;
|
||||
u_long umap_node_hash;
|
||||
|
||||
static u_long umap_findid __P((u_long, u_long [][2], int));
|
||||
static struct vnode *umap_node_find __P((struct mount *, struct vnode *));
|
||||
static int umap_node_alloc __P((struct mount *, struct vnode *,
|
||||
struct vnode **));
|
||||
|
||||
/*
|
||||
* Initialise cache headers
|
||||
*/
|
||||
void
|
||||
umapfs_init()
|
||||
{
|
||||
|
||||
@ -191,9 +197,9 @@ umap_node_alloc(mp, lowervp, vpp)
|
||||
struct umap_node *xp;
|
||||
struct vnode *vp, *nvp;
|
||||
int error;
|
||||
extern int (**dead_vnodeop_p)();
|
||||
extern int (**dead_vnodeop_p) __P((void *));
|
||||
|
||||
if (error = getnewvnode(VT_UMAP, mp, umap_vnodeop_p, &vp))
|
||||
if ((error = getnewvnode(VT_UMAP, mp, umap_vnodeop_p, &vp)) != 0)
|
||||
return (error);
|
||||
vp->v_type = lowervp->v_type;
|
||||
|
||||
@ -213,7 +219,7 @@ umap_node_alloc(mp, lowervp, vpp)
|
||||
* check to see if someone else has beaten us to it.
|
||||
* (We could have slept in MALLOC.)
|
||||
*/
|
||||
if (nvp = umap_node_find(lowervp)) {
|
||||
if ((nvp = umap_node_find(mp, lowervp)) != NULL) {
|
||||
*vpp = nvp;
|
||||
|
||||
/* free the substructures we've allocated. */
|
||||
@ -292,7 +298,7 @@ umap_node_create(mp, targetvp, newvpp)
|
||||
{
|
||||
struct vnode *aliasvp;
|
||||
|
||||
if (aliasvp = umap_node_find(mp, targetvp)) {
|
||||
if ((aliasvp = umap_node_find(mp, targetvp)) != NULL) {
|
||||
/*
|
||||
* Take another reference to the alias vnode
|
||||
*/
|
||||
@ -312,7 +318,7 @@ umap_node_create(mp, targetvp, newvpp)
|
||||
/*
|
||||
* Make new vnode reference the umap_node.
|
||||
*/
|
||||
if (error = umap_node_alloc(mp, targetvp, &aliasvp))
|
||||
if ((error = umap_node_alloc(mp, targetvp, &aliasvp)) != 0)
|
||||
return (error);
|
||||
|
||||
/*
|
||||
@ -392,12 +398,12 @@ umap_mapids(v_mount, credp)
|
||||
int i, unentries, gnentries;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
u_long *usermap, *groupmap;
|
||||
u_long (*usermap)[2], (*groupmap)[2];
|
||||
|
||||
unentries = MOUNTTOUMAPMOUNT(v_mount)->info_nentries;
|
||||
usermap = &(MOUNTTOUMAPMOUNT(v_mount)->info_mapdata[0][0]);
|
||||
usermap = MOUNTTOUMAPMOUNT(v_mount)->info_mapdata;
|
||||
gnentries = MOUNTTOUMAPMOUNT(v_mount)->info_gnentries;
|
||||
groupmap = &(MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata[0][0]);
|
||||
groupmap = MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata;
|
||||
|
||||
/* Find uid entry in map */
|
||||
|
||||
@ -427,7 +433,7 @@ umap_mapids(v_mount, credp)
|
||||
i = 0;
|
||||
while (credp->cr_groups[i] != 0) {
|
||||
gid = (gid_t) umap_findid(credp->cr_groups[i],
|
||||
groupmap, gnentries);
|
||||
groupmap, gnentries);
|
||||
|
||||
if (gid != -1)
|
||||
credp->cr_groups[i++] = gid;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: umap_vfsops.c,v 1.8 1995/06/18 14:47:44 cgd Exp $ */
|
||||
/* $NetBSD: umap_vfsops.c,v 1.9 1996/02/09 22:41:05 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -54,6 +54,20 @@
|
||||
#include <sys/malloc.h>
|
||||
#include <miscfs/umapfs/umap.h>
|
||||
|
||||
int umapfs_mount __P((struct mount *, char *, caddr_t,
|
||||
struct nameidata *, struct proc *));
|
||||
int umapfs_start __P((struct mount *, int, struct proc *));
|
||||
int umapfs_unmount __P((struct mount *, int, struct proc *));
|
||||
int umapfs_root __P((struct mount *, struct vnode **));
|
||||
int umapfs_quotactl __P((struct mount *, int, uid_t, caddr_t,
|
||||
struct proc *));
|
||||
int umapfs_statfs __P((struct mount *, struct statfs *, struct proc *));
|
||||
int umapfs_sync __P((struct mount *, int, struct ucred *, struct proc *));
|
||||
int umapfs_vget __P((struct mount *, ino_t, struct vnode **));
|
||||
int umapfs_fhtovp __P((struct mount *, struct fid *, struct mbuf *,
|
||||
struct vnode **, int *, struct ucred **));
|
||||
int umapfs_vptofh __P((struct vnode *, struct fid *));
|
||||
|
||||
/*
|
||||
* Mount umap layer
|
||||
*/
|
||||
@ -87,7 +101,8 @@ umapfs_mount(mp, path, data, ndp, p)
|
||||
/*
|
||||
* Get argument
|
||||
*/
|
||||
if (error = copyin(data, (caddr_t)&args, sizeof(struct umap_args)))
|
||||
error = copyin(data, (caddr_t)&args, sizeof(struct umap_args));
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
/*
|
||||
@ -95,7 +110,7 @@ umapfs_mount(mp, path, data, ndp, p)
|
||||
*/
|
||||
NDINIT(ndp, LOOKUP, FOLLOW|WANTPARENT|LOCKLEAF,
|
||||
UIO_USERSPACE, args.target, p);
|
||||
if (error = namei(ndp))
|
||||
if ((error = namei(ndp)) != 0)
|
||||
return (error);
|
||||
|
||||
/*
|
||||
@ -251,7 +266,7 @@ umapfs_unmount(mp, mntflags, p)
|
||||
#endif
|
||||
if (umapm_rootvp->v_usecount > 1)
|
||||
return (EBUSY);
|
||||
if (error = vflush(mp, umapm_rootvp, flags))
|
||||
if ((error = vflush(mp, umapm_rootvp, flags)) != 0)
|
||||
return (error);
|
||||
|
||||
#ifdef UMAPFS_DIAGNOSTIC
|
||||
@ -396,8 +411,6 @@ umapfs_vptofh(vp, fhp)
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
int umapfs_init __P((void));
|
||||
|
||||
struct vfsops umap_vfsops = {
|
||||
MOUNT_UMAP,
|
||||
umapfs_mount,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: umap_vnops.c,v 1.4 1995/04/15 01:57:39 cgd Exp $ */
|
||||
/* $NetBSD: umap_vnops.c,v 1.5 1996/02/09 22:41:06 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -56,20 +56,55 @@
|
||||
|
||||
int umap_bug_bypass = 0; /* for debugging: enables bypass printf'ing */
|
||||
|
||||
int umap_bypass __P((void *));
|
||||
int umap_getattr __P((void *));
|
||||
int umap_inactive __P((void *));
|
||||
int umap_reclaim __P((void *));
|
||||
int umap_print __P((void *));
|
||||
int umap_rename __P((void *));
|
||||
int umap_strategy __P((void *));
|
||||
int umap_bwrite __P((void *));
|
||||
|
||||
/*
|
||||
* Global vfs data structures
|
||||
*/
|
||||
/*
|
||||
* XXX - strategy, bwrite are hand coded currently. They should
|
||||
* go away with a merged buffer/block cache.
|
||||
*
|
||||
*/
|
||||
int (**umap_vnodeop_p) __P((void *));
|
||||
struct vnodeopv_entry_desc umap_vnodeop_entries[] = {
|
||||
{ &vop_default_desc, umap_bypass },
|
||||
|
||||
{ &vop_getattr_desc, umap_getattr },
|
||||
{ &vop_inactive_desc, umap_inactive },
|
||||
{ &vop_reclaim_desc, umap_reclaim },
|
||||
{ &vop_print_desc, umap_print },
|
||||
{ &vop_rename_desc, umap_rename },
|
||||
|
||||
{ &vop_strategy_desc, umap_strategy },
|
||||
{ &vop_bwrite_desc, umap_bwrite },
|
||||
|
||||
{ (struct vnodeop_desc*) NULL, (int(*) __P((void *))) NULL }
|
||||
};
|
||||
struct vnodeopv_desc umap_vnodeop_opv_desc =
|
||||
{ &umap_vnodeop_p, umap_vnodeop_entries };
|
||||
|
||||
/*
|
||||
* This is the 10-Apr-92 bypass routine.
|
||||
* See null_vnops.c:null_bypass for more details.
|
||||
*/
|
||||
int
|
||||
umap_bypass(ap)
|
||||
umap_bypass(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_generic_args /* {
|
||||
struct vnodeop_desc *a_desc;
|
||||
<other random data follows, presumably>
|
||||
} */ *ap;
|
||||
{
|
||||
extern int (**umap_vnodeop_p)(); /* not extern, really "forward" */
|
||||
} */ *ap = v;
|
||||
struct ucred **credpp = 0, *credp = 0;
|
||||
struct ucred *savecredp, *savecompcredp = 0;
|
||||
struct ucred *savecredp = 0, *savecompcredp = 0;
|
||||
struct ucred *compcredp = 0;
|
||||
struct vnode **this_vp_p;
|
||||
int error;
|
||||
@ -259,14 +294,15 @@ umap_bypass(ap)
|
||||
* We handle getattr to change the fsid.
|
||||
*/
|
||||
int
|
||||
umap_getattr(ap)
|
||||
umap_getattr(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_getattr_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct vattr *a_vap;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
int error, tmpid, nentries, gnentries;
|
||||
@ -275,7 +311,7 @@ umap_getattr(ap)
|
||||
struct vnode **vp1p;
|
||||
struct vnodeop_desc *descp = ap->a_desc;
|
||||
|
||||
if (error = umap_bypass(ap))
|
||||
if ((error = umap_bypass(ap)) != 0)
|
||||
return (error);
|
||||
/* Requires that arguments be restored. */
|
||||
ap->a_vap->va_fsid = ap->a_vp->v_mount->mnt_stat.f_fsid.val[0];
|
||||
@ -331,11 +367,10 @@ umap_getattr(ap)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
umap_inactive(ap)
|
||||
struct vop_inactive_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
umap_inactive(v)
|
||||
void *v;
|
||||
{
|
||||
/*
|
||||
* Do nothing (and _don't_ bypass).
|
||||
@ -348,11 +383,12 @@ umap_inactive(ap)
|
||||
}
|
||||
|
||||
int
|
||||
umap_reclaim(ap)
|
||||
umap_reclaim(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_reclaim_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct umap_node *xp = VTOUMAP(vp);
|
||||
struct vnode *lowervp = xp->umap_lowervp;
|
||||
@ -367,11 +403,12 @@ umap_reclaim(ap)
|
||||
}
|
||||
|
||||
int
|
||||
umap_strategy(ap)
|
||||
umap_strategy(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_strategy_args /* {
|
||||
struct buf *a_bp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct buf *bp = ap->a_bp;
|
||||
int error;
|
||||
struct vnode *savedvp;
|
||||
@ -387,11 +424,12 @@ umap_strategy(ap)
|
||||
}
|
||||
|
||||
int
|
||||
umap_bwrite(ap)
|
||||
umap_bwrite(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_bwrite_args /* {
|
||||
struct buf *a_bp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct buf *bp = ap->a_bp;
|
||||
int error;
|
||||
struct vnode *savedvp;
|
||||
@ -408,18 +446,22 @@ umap_bwrite(ap)
|
||||
|
||||
|
||||
int
|
||||
umap_print(ap)
|
||||
umap_print(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_print_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
printf("\ttag VT_UMAPFS, vp=%x, lowervp=%x\n", vp, UMAPVPTOLOWERVP(vp));
|
||||
printf("\ttag VT_UMAPFS, vp=%x, lowervp=%x\n",
|
||||
(unsigned int) vp, (unsigned int) UMAPVPTOLOWERVP(vp));
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
umap_rename(ap)
|
||||
umap_rename(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_rename_args /* {
|
||||
struct vnode *a_fdvp;
|
||||
struct vnode *a_fvp;
|
||||
@ -427,8 +469,7 @@ umap_rename(ap)
|
||||
struct vnode *a_tdvp;
|
||||
struct vnode *a_tvp;
|
||||
struct componentname *a_tcnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
int error;
|
||||
struct componentname *compnamep;
|
||||
struct ucred *compcredp, *savecompcredp;
|
||||
@ -469,28 +510,3 @@ umap_rename(ap)
|
||||
return error;
|
||||
}
|
||||
|
||||
/*
|
||||
* Global vfs data structures
|
||||
*/
|
||||
/*
|
||||
* XXX - strategy, bwrite are hand coded currently. They should
|
||||
* go away with a merged buffer/block cache.
|
||||
*
|
||||
*/
|
||||
int (**umap_vnodeop_p)();
|
||||
struct vnodeopv_entry_desc umap_vnodeop_entries[] = {
|
||||
{ &vop_default_desc, umap_bypass },
|
||||
|
||||
{ &vop_getattr_desc, umap_getattr },
|
||||
{ &vop_inactive_desc, umap_inactive },
|
||||
{ &vop_reclaim_desc, umap_reclaim },
|
||||
{ &vop_print_desc, umap_print },
|
||||
{ &vop_rename_desc, umap_rename },
|
||||
|
||||
{ &vop_strategy_desc, umap_strategy },
|
||||
{ &vop_bwrite_desc, umap_bwrite },
|
||||
|
||||
{ (struct vnodeop_desc*) NULL, (int(*)()) NULL }
|
||||
};
|
||||
struct vnodeopv_desc umap_vnodeop_opv_desc =
|
||||
{ &umap_vnodeop_p, umap_vnodeop_entries };
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: union.h,v 1.8 1995/05/30 18:55:28 mycroft Exp $ */
|
||||
/* $NetBSD: union.h,v 1.9 1996/02/09 22:41:08 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 The Regents of the University of California.
|
||||
@ -127,6 +127,10 @@ extern void union_newsize __P((struct vnode *, off_t, off_t));
|
||||
#define UPPERVP(vp) (VTOUNION(vp)->un_uppervp)
|
||||
#define OTHERVP(vp) (UPPERVP(vp) ? UPPERVP(vp) : LOWERVP(vp))
|
||||
|
||||
extern int (**union_vnodeop_p)();
|
||||
extern int (**union_vnodeop_p) __P((void *));
|
||||
extern struct vfsops union_vfsops;
|
||||
|
||||
void union_init __P((void));
|
||||
int union_freevp __P((struct vnode *));
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: union_subr.c,v 1.17 1995/10/05 06:26:12 mycroft Exp $ */
|
||||
/* $NetBSD: union_subr.c,v 1.18 1996/02/09 22:41:10 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Jan-Simon Pendry
|
||||
@ -69,7 +69,17 @@
|
||||
static LIST_HEAD(unhead, union_node) unhead[NHASH];
|
||||
static int unvplock[NHASH];
|
||||
|
||||
int
|
||||
static int union_list_lock __P((int));
|
||||
static void union_list_unlock __P((int));
|
||||
void union_updatevp __P((struct union_node *, struct vnode *, struct vnode *));
|
||||
static int union_relookup __P((struct union_mount *, struct vnode *,
|
||||
struct vnode **, struct componentname *,
|
||||
struct componentname *, char *, int));
|
||||
int union_vn_close __P((struct vnode *, int, struct ucred *, struct proc *));
|
||||
static void union_dircache_r __P((struct vnode *, struct vnode ***, int *));
|
||||
struct vnode *union_dircache __P((struct vnode *));
|
||||
|
||||
void
|
||||
union_init()
|
||||
{
|
||||
int i;
|
||||
@ -275,11 +285,10 @@ union_allocvp(vpp, mp, undvp, dvp, cnp, uppervp, lowervp, docache)
|
||||
int docache;
|
||||
{
|
||||
int error;
|
||||
struct union_node *un;
|
||||
struct union_node **pp;
|
||||
struct union_node *un = NULL;
|
||||
struct vnode *xlowervp = NULLVP;
|
||||
struct union_mount *um = MOUNTTOUNIONMOUNT(mp);
|
||||
int hash;
|
||||
int hash = 0;
|
||||
int vflag;
|
||||
int try;
|
||||
|
||||
@ -809,7 +818,6 @@ union_mkwhiteout(um, dvp, cnp, path)
|
||||
char *path;
|
||||
{
|
||||
int error;
|
||||
struct vattr va;
|
||||
struct proc *p = cnp->cn_proc;
|
||||
struct vnode *wvp;
|
||||
struct componentname cn;
|
||||
@ -861,7 +869,6 @@ union_vn_create(vpp, un, p)
|
||||
int fmode = FFLAGS(O_WRONLY|O_CREAT|O_TRUNC|O_EXCL);
|
||||
int error;
|
||||
int cmode = UN_FILEMODE & ~p->p_fd->fd_cmask;
|
||||
char *cp;
|
||||
struct componentname cn;
|
||||
|
||||
*vpp = NULLVP;
|
||||
@ -887,7 +894,7 @@ union_vn_create(vpp, un, p)
|
||||
cn.cn_consume = 0;
|
||||
|
||||
VREF(un->un_dirvp);
|
||||
if (error = relookup(un->un_dirvp, &vp, &cn))
|
||||
if ((error = relookup(un->un_dirvp, &vp, &cn)) != 0)
|
||||
return (error);
|
||||
vrele(un->un_dirvp);
|
||||
|
||||
@ -915,10 +922,10 @@ union_vn_create(vpp, un, p)
|
||||
vap->va_type = VREG;
|
||||
vap->va_mode = cmode;
|
||||
VOP_LEASE(un->un_dirvp, p, cred, LEASE_WRITE);
|
||||
if (error = VOP_CREATE(un->un_dirvp, &vp, &cn, vap))
|
||||
if ((error = VOP_CREATE(un->un_dirvp, &vp, &cn, vap)) != 0)
|
||||
return (error);
|
||||
|
||||
if (error = VOP_OPEN(vp, fmode, cred, p)) {
|
||||
if ((error = VOP_OPEN(vp, fmode, cred, p)) != 0) {
|
||||
vput(vp);
|
||||
return (error);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: union_vfsops.c,v 1.11 1996/01/30 16:45:10 mycroft Exp $ */
|
||||
/* $NetBSD: union_vfsops.c,v 1.12 1996/02/09 22:41:12 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 The Regents of the University of California.
|
||||
@ -56,6 +56,19 @@
|
||||
#include <sys/queue.h>
|
||||
#include <miscfs/union/union.h>
|
||||
|
||||
int union_mount __P((struct mount *, char *, caddr_t, struct nameidata *,
|
||||
struct proc *));
|
||||
int union_start __P((struct mount *, int, struct proc *));
|
||||
int union_unmount __P((struct mount *, int, struct proc *));
|
||||
int union_root __P((struct mount *, struct vnode **));
|
||||
int union_quotactl __P((struct mount *, int, uid_t, caddr_t, struct proc *));
|
||||
int union_statfs __P((struct mount *, struct statfs *, struct proc *));
|
||||
int union_sync __P((struct mount *, int, struct ucred *, struct proc *));
|
||||
int union_vget __P((struct mount *, ino_t, struct vnode **));
|
||||
int union_fhtovp __P((struct mount *, struct fid *, struct mbuf *,
|
||||
struct vnode **, int *, struct ucred **));
|
||||
int union_vptofh __P((struct vnode *, struct fid *));
|
||||
|
||||
/*
|
||||
* Mount union filesystem
|
||||
*/
|
||||
@ -73,8 +86,6 @@ union_mount(mp, path, data, ndp, p)
|
||||
struct vnode *upperrootvp = NULLVP;
|
||||
struct union_mount *um = 0;
|
||||
struct ucred *cred = 0;
|
||||
struct ucred *scred;
|
||||
struct vattr va;
|
||||
char *cp;
|
||||
int len;
|
||||
size_t size;
|
||||
@ -99,7 +110,8 @@ union_mount(mp, path, data, ndp, p)
|
||||
/*
|
||||
* Get argument
|
||||
*/
|
||||
if (error = copyin(data, (caddr_t)&args, sizeof(struct union_args)))
|
||||
error = copyin(data, (caddr_t)&args, sizeof(struct union_args));
|
||||
if (error)
|
||||
goto bad;
|
||||
|
||||
lowerrootvp = mp->mnt_vnodecovered;
|
||||
@ -111,7 +123,7 @@ union_mount(mp, path, data, ndp, p)
|
||||
NDINIT(ndp, LOOKUP, FOLLOW|WANTPARENT,
|
||||
UIO_USERSPACE, args.target, p);
|
||||
|
||||
if (error = namei(ndp))
|
||||
if ((error = namei(ndp)) != 0)
|
||||
goto bad;
|
||||
|
||||
upperrootvp = ndp->ni_vp;
|
||||
@ -214,6 +226,12 @@ union_mount(mp, path, data, ndp, p)
|
||||
case UNMNT_REPLACE:
|
||||
cp = "";
|
||||
break;
|
||||
default:
|
||||
cp = "<invalid>:";
|
||||
#ifdef DIAGNOSTIC
|
||||
panic("union_mount: bad um_op");
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
len = strlen(cp);
|
||||
bcopy(cp, mp->mnt_stat.f_mntfromname, len);
|
||||
@ -247,6 +265,7 @@ bad:
|
||||
* on the underlying filesystem(s) will have been called
|
||||
* when that filesystem was mounted.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
union_start(mp, flags, p)
|
||||
struct mount *mp;
|
||||
@ -284,7 +303,7 @@ union_unmount(mp, mntflags, p)
|
||||
flags |= FORCECLOSE;
|
||||
}
|
||||
|
||||
if (error = union_root(mp, &um_rootvp))
|
||||
if ((error = union_root(mp, &um_rootvp)) != 0)
|
||||
return (error);
|
||||
|
||||
/*
|
||||
@ -390,6 +409,7 @@ union_root(mp, vpp)
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
union_quotactl(mp, cmd, uid, arg, p)
|
||||
struct mount *mp;
|
||||
@ -464,6 +484,7 @@ union_statfs(mp, sbp, p)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
union_sync(mp, waitfor, cred, p)
|
||||
struct mount *mp;
|
||||
@ -478,6 +499,7 @@ union_sync(mp, waitfor, cred, p)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
union_vget(mp, ino, vpp)
|
||||
struct mount *mp;
|
||||
@ -488,6 +510,7 @@ union_vget(mp, ino, vpp)
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
union_fhtovp(mp, fidp, nam, vpp, exflagsp, credanonp)
|
||||
struct mount *mp;
|
||||
@ -501,6 +524,7 @@ union_fhtovp(mp, fidp, nam, vpp, exflagsp, credanonp)
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
union_vptofh(vp, fhp)
|
||||
struct vnode *vp;
|
||||
@ -510,8 +534,6 @@ union_vptofh(vp, fhp)
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
||||
int union_init __P((void));
|
||||
|
||||
struct vfsops union_vfsops = {
|
||||
MOUNT_UNION,
|
||||
union_mount,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: union_vnops.c,v 1.26 1996/02/09 14:45:56 mycroft Exp $ */
|
||||
/* $NetBSD: union_vnops.c,v 1.27 1996/02/09 22:41:14 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993, 1994 The Regents of the University of California.
|
||||
@ -54,11 +54,108 @@
|
||||
#include <sys/queue.h>
|
||||
#include <miscfs/union/union.h>
|
||||
|
||||
/*
|
||||
* Global vfs data structures
|
||||
*/
|
||||
|
||||
int union_lookup __P((void *));
|
||||
int union_create __P((void *));
|
||||
int union_whiteout __P((void *));
|
||||
int union_mknod __P((void *));
|
||||
int union_open __P((void *));
|
||||
int union_close __P((void *));
|
||||
int union_access __P((void *));
|
||||
int union_getattr __P((void *));
|
||||
int union_setattr __P((void *));
|
||||
int union_read __P((void *));
|
||||
int union_write __P((void *));
|
||||
int union_lease __P((void *));
|
||||
int union_ioctl __P((void *));
|
||||
int union_select __P((void *));
|
||||
int union_mmap __P((void *));
|
||||
int union_fsync __P((void *));
|
||||
int union_seek __P((void *));
|
||||
int union_remove __P((void *));
|
||||
int union_link __P((void *));
|
||||
int union_rename __P((void *));
|
||||
int union_mkdir __P((void *));
|
||||
int union_rmdir __P((void *));
|
||||
int union_symlink __P((void *));
|
||||
int union_readdir __P((void *));
|
||||
int union_readlink __P((void *));
|
||||
int union_abortop __P((void *));
|
||||
int union_inactive __P((void *));
|
||||
int union_reclaim __P((void *));
|
||||
int union_lock __P((void *));
|
||||
int union_unlock __P((void *));
|
||||
int union_bmap __P((void *));
|
||||
int union_print __P((void *));
|
||||
int union_islocked __P((void *));
|
||||
int union_pathconf __P((void *));
|
||||
int union_advlock __P((void *));
|
||||
int union_strategy __P((void *));
|
||||
|
||||
int (**union_vnodeop_p) __P((void *));
|
||||
struct vnodeopv_entry_desc union_vnodeop_entries[] = {
|
||||
{ &vop_default_desc, vn_default_error },
|
||||
{ &vop_lookup_desc, union_lookup }, /* lookup */
|
||||
{ &vop_create_desc, union_create }, /* create */
|
||||
{ &vop_whiteout_desc, union_whiteout }, /* whiteout */
|
||||
{ &vop_mknod_desc, union_mknod }, /* mknod */
|
||||
{ &vop_open_desc, union_open }, /* open */
|
||||
{ &vop_close_desc, union_close }, /* close */
|
||||
{ &vop_access_desc, union_access }, /* access */
|
||||
{ &vop_getattr_desc, union_getattr }, /* getattr */
|
||||
{ &vop_setattr_desc, union_setattr }, /* setattr */
|
||||
{ &vop_read_desc, union_read }, /* read */
|
||||
{ &vop_write_desc, union_write }, /* write */
|
||||
{ &vop_lease_desc, union_lease }, /* lease */
|
||||
{ &vop_ioctl_desc, union_ioctl }, /* ioctl */
|
||||
{ &vop_select_desc, union_select }, /* select */
|
||||
{ &vop_mmap_desc, union_mmap }, /* mmap */
|
||||
{ &vop_fsync_desc, union_fsync }, /* fsync */
|
||||
{ &vop_seek_desc, union_seek }, /* seek */
|
||||
{ &vop_remove_desc, union_remove }, /* remove */
|
||||
{ &vop_link_desc, union_link }, /* link */
|
||||
{ &vop_rename_desc, union_rename }, /* rename */
|
||||
{ &vop_mkdir_desc, union_mkdir }, /* mkdir */
|
||||
{ &vop_rmdir_desc, union_rmdir }, /* rmdir */
|
||||
{ &vop_symlink_desc, union_symlink }, /* symlink */
|
||||
{ &vop_readdir_desc, union_readdir }, /* readdir */
|
||||
{ &vop_readlink_desc, union_readlink }, /* readlink */
|
||||
{ &vop_abortop_desc, union_abortop }, /* abortop */
|
||||
{ &vop_inactive_desc, union_inactive }, /* inactive */
|
||||
{ &vop_reclaim_desc, union_reclaim }, /* reclaim */
|
||||
{ &vop_lock_desc, union_lock }, /* lock */
|
||||
{ &vop_unlock_desc, union_unlock }, /* unlock */
|
||||
{ &vop_bmap_desc, union_bmap }, /* bmap */
|
||||
{ &vop_strategy_desc, union_strategy }, /* strategy */
|
||||
{ &vop_print_desc, union_print }, /* print */
|
||||
{ &vop_islocked_desc, union_islocked }, /* islocked */
|
||||
{ &vop_pathconf_desc, union_pathconf }, /* pathconf */
|
||||
{ &vop_advlock_desc, union_advlock }, /* advlock */
|
||||
#ifdef notdef
|
||||
{ &vop_blkatoff_desc, union_blkatoff }, /* blkatoff */
|
||||
{ &vop_valloc_desc, union_valloc }, /* valloc */
|
||||
{ &vop_vfree_desc, union_vfree }, /* vfree */
|
||||
{ &vop_truncate_desc, union_truncate }, /* truncate */
|
||||
{ &vop_update_desc, union_update }, /* update */
|
||||
{ &vop_bwrite_desc, union_bwrite }, /* bwrite */
|
||||
#endif
|
||||
{ (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL }
|
||||
};
|
||||
struct vnodeopv_desc union_vnodeop_opv_desc =
|
||||
{ &union_vnodeop_p, union_vnodeop_entries };
|
||||
|
||||
#define FIXUP(un) { \
|
||||
if (((un)->un_flags & UN_ULOCK) == 0) { \
|
||||
union_fixup(un); \
|
||||
} \
|
||||
}
|
||||
static void union_fixup __P((struct union_node *));
|
||||
static int union_lookup1 __P((struct vnode *, struct vnode **,
|
||||
struct vnode **, struct componentname *));
|
||||
|
||||
|
||||
static void
|
||||
union_fixup(un)
|
||||
@ -133,7 +230,7 @@ union_lookup1(udvp, dvpp, vpp, cnp)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (error = VFS_ROOT(mp, &tdvp)) {
|
||||
if ((error = VFS_ROOT(mp, &tdvp)) != 0) {
|
||||
vput(dvp);
|
||||
return (error);
|
||||
}
|
||||
@ -147,14 +244,15 @@ union_lookup1(udvp, dvpp, vpp, cnp)
|
||||
}
|
||||
|
||||
int
|
||||
union_lookup(ap)
|
||||
union_lookup(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_lookup_args /* {
|
||||
struct vnodeop_desc *a_desc;
|
||||
struct vnode *a_dvp;
|
||||
struct vnode **a_vpp;
|
||||
struct componentname *a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
int error;
|
||||
int uerror, lerror;
|
||||
struct vnode *uppervp, *lowervp;
|
||||
@ -163,9 +261,8 @@ union_lookup(ap)
|
||||
struct union_node *dun = VTOUNION(dvp);
|
||||
struct componentname *cnp = ap->a_cnp;
|
||||
int lockparent = cnp->cn_flags & LOCKPARENT;
|
||||
int rdonly = cnp->cn_flags & RDONLY;
|
||||
struct union_mount *um = MOUNTTOUNIONMOUNT(dvp->v_mount);
|
||||
struct ucred *saved_cred;
|
||||
struct ucred *saved_cred = NULL;
|
||||
int iswhiteout;
|
||||
struct vattr va;
|
||||
|
||||
@ -356,14 +453,15 @@ union_lookup(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_create(ap)
|
||||
union_create(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_create_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode **a_vpp;
|
||||
struct componentname *a_cnp;
|
||||
struct vattr *a_vap;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct union_node *un = VTOUNION(ap->a_dvp);
|
||||
struct vnode *dvp;
|
||||
|
||||
@ -401,13 +499,14 @@ union_create(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_whiteout(ap)
|
||||
union_whiteout(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_whiteout_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct componentname *a_cnp;
|
||||
int a_flags;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct union_node *un = VTOUNION(ap->a_dvp);
|
||||
|
||||
if (un->un_uppervp == NULLVP)
|
||||
@ -418,14 +517,15 @@ union_whiteout(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_mknod(ap)
|
||||
union_mknod(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_mknod_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode **a_vpp;
|
||||
struct componentname *a_cnp;
|
||||
struct vattr *a_vap;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct union_node *un = VTOUNION(ap->a_dvp);
|
||||
struct vnode *dvp;
|
||||
|
||||
@ -465,15 +565,16 @@ union_mknod(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_open(ap)
|
||||
union_open(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_open_args /* {
|
||||
struct vnodeop_desc *a_desc;
|
||||
struct vnode *a_vp;
|
||||
int a_mode;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct union_node *un = VTOUNION(ap->a_vp);
|
||||
struct vnode *tvp;
|
||||
int mode = ap->a_mode;
|
||||
@ -518,14 +619,15 @@ union_open(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_close(ap)
|
||||
union_close(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_close_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_fflag;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct union_node *un = VTOUNION(ap->a_vp);
|
||||
struct vnode *vp;
|
||||
|
||||
@ -562,15 +664,16 @@ union_close(ap)
|
||||
* the user caused an implicit file copy.
|
||||
*/
|
||||
int
|
||||
union_access(ap)
|
||||
union_access(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_access_args /* {
|
||||
struct vnodeop_desc *a_desc;
|
||||
struct vnode *a_vp;
|
||||
int a_mode;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct union_node *un = VTOUNION(ap->a_vp);
|
||||
int error = EACCES;
|
||||
struct vnode *vp;
|
||||
@ -603,14 +706,15 @@ union_access(ap)
|
||||
* track object sizes
|
||||
*/
|
||||
int
|
||||
union_getattr(ap)
|
||||
union_getattr(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_getattr_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct vattr *a_vap;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
int error;
|
||||
struct union_node *un = VTOUNION(ap->a_vp);
|
||||
struct vnode *vp = un->un_uppervp;
|
||||
@ -671,14 +775,15 @@ union_getattr(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_setattr(ap)
|
||||
union_setattr(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_setattr_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct vattr *a_vap;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct union_node *un = VTOUNION(ap->a_vp);
|
||||
int error;
|
||||
|
||||
@ -714,14 +819,15 @@ union_setattr(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_read(ap)
|
||||
union_read(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_read_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
int a_ioflag;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
int error;
|
||||
struct vnode *vp = OTHERVP(ap->a_vp);
|
||||
int dolock = (vp == LOWERVP(ap->a_vp));
|
||||
@ -757,14 +863,15 @@ union_read(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_write(ap)
|
||||
union_write(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_read_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
int a_ioflag;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
int error;
|
||||
struct vnode *vp;
|
||||
struct union_node *un = VTOUNION(ap->a_vp);
|
||||
@ -790,14 +897,16 @@ union_write(ap)
|
||||
return (error);
|
||||
}
|
||||
|
||||
union_lease(ap)
|
||||
int
|
||||
union_lease(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_lease_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct proc *a_p;
|
||||
struct ucred *a_cred;
|
||||
int a_flag;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
register struct vnode *vp = OTHERVP(ap->a_vp);
|
||||
|
||||
ap->a_vp = vp;
|
||||
@ -805,7 +914,9 @@ union_lease(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_ioctl(ap)
|
||||
union_ioctl(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_ioctl_args /* {
|
||||
struct vnode *a_vp;
|
||||
u_long a_command;
|
||||
@ -813,8 +924,7 @@ union_ioctl(ap)
|
||||
int a_fflag;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
register struct vnode *vp = OTHERVP(ap->a_vp);
|
||||
|
||||
ap->a_vp = vp;
|
||||
@ -822,15 +932,16 @@ union_ioctl(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_select(ap)
|
||||
union_select(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_select_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_which;
|
||||
int a_fflags;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
register struct vnode *vp = OTHERVP(ap->a_vp);
|
||||
|
||||
ap->a_vp = vp;
|
||||
@ -838,14 +949,15 @@ union_select(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_mmap(ap)
|
||||
union_mmap(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_mmap_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_fflags;
|
||||
struct ucred *a_cred;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
register struct vnode *vp = OTHERVP(ap->a_vp);
|
||||
|
||||
ap->a_vp = vp;
|
||||
@ -853,14 +965,15 @@ union_mmap(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_fsync(ap)
|
||||
union_fsync(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_fsync_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct ucred *a_cred;
|
||||
int a_waitfor;
|
||||
struct proc *a_p;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
int error = 0;
|
||||
struct vnode *targetvp = OTHERVP(ap->a_vp);
|
||||
|
||||
@ -881,14 +994,15 @@ union_fsync(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_seek(ap)
|
||||
union_seek(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_seek_args /* {
|
||||
struct vnode *a_vp;
|
||||
off_t a_oldoff;
|
||||
off_t a_newoff;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
register struct vnode *vp = OTHERVP(ap->a_vp);
|
||||
|
||||
ap->a_vp = vp;
|
||||
@ -896,13 +1010,14 @@ union_seek(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_remove(ap)
|
||||
union_remove(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_remove_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode *a_vp;
|
||||
struct componentname *a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
int error;
|
||||
struct union_node *dun = VTOUNION(ap->a_dvp);
|
||||
struct union_node *un = VTOUNION(ap->a_vp);
|
||||
@ -942,13 +1057,14 @@ union_remove(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_link(ap)
|
||||
union_link(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_link_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode *a_vp;
|
||||
struct componentname *a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
int error = 0;
|
||||
struct union_node *dun;
|
||||
struct vnode *dvp;
|
||||
@ -996,7 +1112,9 @@ union_link(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_rename(ap)
|
||||
union_rename(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_rename_args /* {
|
||||
struct vnode *a_fdvp;
|
||||
struct vnode *a_fvp;
|
||||
@ -1004,8 +1122,7 @@ union_rename(ap)
|
||||
struct vnode *a_tdvp;
|
||||
struct vnode *a_tvp;
|
||||
struct componentname *a_tcnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
int error;
|
||||
|
||||
struct vnode *fdvp = ap->a_fdvp;
|
||||
@ -1090,14 +1207,15 @@ bad:
|
||||
}
|
||||
|
||||
int
|
||||
union_mkdir(ap)
|
||||
union_mkdir(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_mkdir_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode **a_vpp;
|
||||
struct componentname *a_cnp;
|
||||
struct vattr *a_vap;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct union_node *un = VTOUNION(ap->a_dvp);
|
||||
struct vnode *dvp = un->un_uppervp;
|
||||
|
||||
@ -1135,13 +1253,14 @@ union_mkdir(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_rmdir(ap)
|
||||
union_rmdir(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_rmdir_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode *a_vp;
|
||||
struct componentname *a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
int error;
|
||||
struct union_node *dun = VTOUNION(ap->a_dvp);
|
||||
struct union_node *un = VTOUNION(ap->a_vp);
|
||||
@ -1181,22 +1300,22 @@ union_rmdir(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_symlink(ap)
|
||||
union_symlink(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_symlink_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct vnode **a_vpp;
|
||||
struct componentname *a_cnp;
|
||||
struct vattr *a_vap;
|
||||
char *a_target;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct union_node *un = VTOUNION(ap->a_dvp);
|
||||
struct vnode *dvp = un->un_uppervp;
|
||||
|
||||
if (dvp != NULLVP) {
|
||||
int error;
|
||||
struct vnode *vp;
|
||||
struct mount *mp = ap->a_dvp->v_mount;
|
||||
|
||||
FIXUP(un);
|
||||
VREF(dvp);
|
||||
@ -1220,7 +1339,9 @@ union_symlink(ap)
|
||||
* eliminating duplicate names from the returned data stream.
|
||||
*/
|
||||
int
|
||||
union_readdir(ap)
|
||||
union_readdir(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_readdir_args /* {
|
||||
struct vnodeop_desc *a_desc;
|
||||
struct vnode *a_vp;
|
||||
@ -1229,8 +1350,7 @@ union_readdir(ap)
|
||||
int *a_eofflag;
|
||||
u_long *a_cookies;
|
||||
int a_ncookies;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
register struct union_node *un = VTOUNION(ap->a_vp);
|
||||
register struct vnode *vp;
|
||||
|
||||
@ -1243,13 +1363,14 @@ union_readdir(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_readlink(ap)
|
||||
union_readlink(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_readlink_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
int error;
|
||||
struct vnode *vp = OTHERVP(ap->a_vp);
|
||||
int dolock = (vp == LOWERVP(ap->a_vp));
|
||||
@ -1267,12 +1388,13 @@ union_readlink(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_abortop(ap)
|
||||
union_abortop(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_abortop_args /* {
|
||||
struct vnode *a_dvp;
|
||||
struct componentname *a_cnp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
int error;
|
||||
struct vnode *vp = OTHERVP(ap->a_dvp);
|
||||
struct union_node *un = VTOUNION(ap->a_dvp);
|
||||
@ -1294,11 +1416,12 @@ union_abortop(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_inactive(ap)
|
||||
union_inactive(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_inactive_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct union_node *un = VTOUNION(ap->a_vp);
|
||||
|
||||
/*
|
||||
@ -1330,11 +1453,12 @@ union_inactive(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_reclaim(ap)
|
||||
union_reclaim(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_reclaim_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
union_freevp(ap->a_vp);
|
||||
|
||||
@ -1342,9 +1466,10 @@ union_reclaim(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_lock(ap)
|
||||
struct vop_lock_args *ap;
|
||||
union_lock(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_lock_args *ap = v;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct union_node *un;
|
||||
|
||||
@ -1393,9 +1518,10 @@ start:
|
||||
}
|
||||
|
||||
int
|
||||
union_unlock(ap)
|
||||
struct vop_lock_args *ap;
|
||||
union_unlock(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_lock_args *ap = v;
|
||||
struct union_node *un = VTOUNION(ap->a_vp);
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
@ -1426,15 +1552,16 @@ union_unlock(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_bmap(ap)
|
||||
union_bmap(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_bmap_args /* {
|
||||
struct vnode *a_vp;
|
||||
daddr_t a_bn;
|
||||
struct vnode **a_vpp;
|
||||
daddr_t *a_bnp;
|
||||
int *a_runp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
int error;
|
||||
struct vnode *vp = OTHERVP(ap->a_vp);
|
||||
int dolock = (vp == LOWERVP(ap->a_vp));
|
||||
@ -1452,15 +1579,17 @@ union_bmap(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_print(ap)
|
||||
union_print(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_print_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
|
||||
printf("\ttag VT_UNION, vp=%x, uppervp=%x, lowervp=%x\n",
|
||||
vp, UPPERVP(vp), LOWERVP(vp));
|
||||
(unsigned int) vp, (unsigned int) UPPERVP(vp),
|
||||
(unsigned int) LOWERVP(vp));
|
||||
if (UPPERVP(vp))
|
||||
vprint("uppervp", UPPERVP(vp));
|
||||
if (LOWERVP(vp))
|
||||
@ -1469,23 +1598,25 @@ union_print(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_islocked(ap)
|
||||
union_islocked(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_islocked_args /* {
|
||||
struct vnode *a_vp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
|
||||
return ((VTOUNION(ap->a_vp)->un_flags & UN_LOCKED) ? 1 : 0);
|
||||
}
|
||||
|
||||
int
|
||||
union_pathconf(ap)
|
||||
union_pathconf(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_pathconf_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_name;
|
||||
register_t *a_retval;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
int error;
|
||||
struct vnode *vp = OTHERVP(ap->a_vp);
|
||||
int dolock = (vp == LOWERVP(ap->a_vp));
|
||||
@ -1503,15 +1634,16 @@ union_pathconf(ap)
|
||||
}
|
||||
|
||||
int
|
||||
union_advlock(ap)
|
||||
union_advlock(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_advlock_args /* {
|
||||
struct vnode *a_vp;
|
||||
caddr_t a_id;
|
||||
int a_op;
|
||||
struct flock *a_fl;
|
||||
int a_flags;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
register struct vnode *vp = OTHERVP(ap->a_vp);
|
||||
|
||||
ap->a_vp = vp;
|
||||
@ -1525,11 +1657,12 @@ union_advlock(ap)
|
||||
* This goes away with a merged VM/buffer cache.
|
||||
*/
|
||||
int
|
||||
union_strategy(ap)
|
||||
union_strategy(v)
|
||||
void *v;
|
||||
{
|
||||
struct vop_strategy_args /* {
|
||||
struct buf *a_bp;
|
||||
} */ *ap;
|
||||
{
|
||||
} */ *ap = v;
|
||||
struct buf *bp = ap->a_bp;
|
||||
int error;
|
||||
struct vnode *savedvp;
|
||||
@ -1551,57 +1684,3 @@ union_strategy(ap)
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Global vfs data structures
|
||||
*/
|
||||
int (**union_vnodeop_p)();
|
||||
struct vnodeopv_entry_desc union_vnodeop_entries[] = {
|
||||
{ &vop_default_desc, vn_default_error },
|
||||
{ &vop_lookup_desc, union_lookup }, /* lookup */
|
||||
{ &vop_create_desc, union_create }, /* create */
|
||||
{ &vop_whiteout_desc, union_whiteout }, /* whiteout */
|
||||
{ &vop_mknod_desc, union_mknod }, /* mknod */
|
||||
{ &vop_open_desc, union_open }, /* open */
|
||||
{ &vop_close_desc, union_close }, /* close */
|
||||
{ &vop_access_desc, union_access }, /* access */
|
||||
{ &vop_getattr_desc, union_getattr }, /* getattr */
|
||||
{ &vop_setattr_desc, union_setattr }, /* setattr */
|
||||
{ &vop_read_desc, union_read }, /* read */
|
||||
{ &vop_write_desc, union_write }, /* write */
|
||||
{ &vop_lease_desc, union_lease }, /* lease */
|
||||
{ &vop_ioctl_desc, union_ioctl }, /* ioctl */
|
||||
{ &vop_select_desc, union_select }, /* select */
|
||||
{ &vop_mmap_desc, union_mmap }, /* mmap */
|
||||
{ &vop_fsync_desc, union_fsync }, /* fsync */
|
||||
{ &vop_seek_desc, union_seek }, /* seek */
|
||||
{ &vop_remove_desc, union_remove }, /* remove */
|
||||
{ &vop_link_desc, union_link }, /* link */
|
||||
{ &vop_rename_desc, union_rename }, /* rename */
|
||||
{ &vop_mkdir_desc, union_mkdir }, /* mkdir */
|
||||
{ &vop_rmdir_desc, union_rmdir }, /* rmdir */
|
||||
{ &vop_symlink_desc, union_symlink }, /* symlink */
|
||||
{ &vop_readdir_desc, union_readdir }, /* readdir */
|
||||
{ &vop_readlink_desc, union_readlink }, /* readlink */
|
||||
{ &vop_abortop_desc, union_abortop }, /* abortop */
|
||||
{ &vop_inactive_desc, union_inactive }, /* inactive */
|
||||
{ &vop_reclaim_desc, union_reclaim }, /* reclaim */
|
||||
{ &vop_lock_desc, union_lock }, /* lock */
|
||||
{ &vop_unlock_desc, union_unlock }, /* unlock */
|
||||
{ &vop_bmap_desc, union_bmap }, /* bmap */
|
||||
{ &vop_strategy_desc, union_strategy }, /* strategy */
|
||||
{ &vop_print_desc, union_print }, /* print */
|
||||
{ &vop_islocked_desc, union_islocked }, /* islocked */
|
||||
{ &vop_pathconf_desc, union_pathconf }, /* pathconf */
|
||||
{ &vop_advlock_desc, union_advlock }, /* advlock */
|
||||
#ifdef notdef
|
||||
{ &vop_blkatoff_desc, union_blkatoff }, /* blkatoff */
|
||||
{ &vop_valloc_desc, union_valloc }, /* valloc */
|
||||
{ &vop_vfree_desc, union_vfree }, /* vfree */
|
||||
{ &vop_truncate_desc, union_truncate }, /* truncate */
|
||||
{ &vop_update_desc, union_update }, /* update */
|
||||
{ &vop_bwrite_desc, union_bwrite }, /* bwrite */
|
||||
#endif
|
||||
{ (struct vnodeop_desc*)NULL, (int(*)())NULL }
|
||||
};
|
||||
struct vnodeopv_desc union_vnodeop_opv_desc =
|
||||
{ &union_vnodeop_p, union_vnodeop_entries };
|
||||
|
Loading…
Reference in New Issue
Block a user