NetBSD/sys/miscfs/genfs/genfs_vnops.c

92 lines
1.3 KiB
C
Raw Normal View History

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/mount.h>
#include <sys/namei.h>
#include <sys/vnode.h>
#include <sys/malloc.h>
1996-09-07 16:40:22 +04:00
#include <sys/poll.h>
#include <miscfs/genfs/genfs.h>
int
1996-09-07 16:40:22 +04:00
genfs_poll(v)
void *v;
{
1996-09-07 16:40:22 +04:00
struct vop_poll_args /* {
struct vnode *a_vp;
1996-09-07 16:40:22 +04:00
int a_events;
struct proc *a_p;
} */ *ap = v;
1996-09-07 16:40:22 +04:00
return (ap->a_events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM));
}
int
genfs_fsync(v)
void *v;
{
struct vop_fsync_args /* {
struct vnode *a_vp;
struct ucred *a_cred;
int a_waitfor;
struct proc *a_p;
} */ *ap = v;
register struct vnode *vp = ap->a_vp;
struct timespec ts;
vflushbuf(vp, ap->a_waitfor == MNT_WAIT);
TIMEVAL_TO_TIMESPEC(&time, &ts);
return (VOP_UPDATE(ap->a_vp, &ts, &ts, ap->a_waitfor == MNT_WAIT));
}
int
genfs_abortop(v)
void *v;
{
struct vop_abortop_args /* {
struct vnode *a_dvp;
struct componentname *a_cnp;
} */ *ap = v;
if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF)
FREE(ap->a_cnp->cn_pnbuf, M_NAMEI);
return (0);
}
/*ARGSUSED*/
int
genfs_badop(v)
void *v;
{
panic("genfs: bad op");
}
/*ARGSUSED*/
int
genfs_nullop(v)
void *v;
{
return (0);
}
/*ARGSUSED*/
int
genfs_eopnotsupp(v)
void *v;
{
return (EOPNOTSUPP);
}
/*ARGSUSED*/
int
genfs_ebadf(v)
void *v;
{
return (EBADF);
}