1 #include <sys/param.h> 2 #include <sys/systm.h> 3 #include <sys/kernel.h> 4 #include <sys/mount.h> 5 #include <sys/namei.h> 6 #include <sys/vnode.h> 7 #include <sys/malloc.h> 8 #include <sys/poll.h> 9 10 #include <miscfs/genfs/genfs.h> 11 12 int 13 genfs_poll(v) 14 void *v; 15 { 16 struct vop_poll_args /* { 17 struct vnode *a_vp; 18 int a_events; 19 struct proc *a_p; 20 } */ *ap = v; 21 22 return (ap->a_events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)); 23 } 24 25 int 26 genfs_fsync(v) 27 void *v; 28 { 29 struct vop_fsync_args /* { 30 struct vnode *a_vp; 31 struct ucred *a_cred; 32 int a_waitfor; 33 struct proc *a_p; 34 } */ *ap = v; 35 register struct vnode *vp = ap->a_vp; 36 struct timespec ts; 37 38 vflushbuf(vp, ap->a_waitfor == MNT_WAIT); 39 TIMEVAL_TO_TIMESPEC(&time, &ts); 40 return (VOP_UPDATE(ap->a_vp, &ts, &ts, ap->a_waitfor == MNT_WAIT)); 41 } 42 43 int 44 genfs_abortop(v) 45 void *v; 46 { 47 struct vop_abortop_args /* { 48 struct vnode *a_dvp; 49 struct componentname *a_cnp; 50 } */ *ap = v; 51 52 if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF) 53 FREE(ap->a_cnp->cn_pnbuf, M_NAMEI); 54 return (0); 55 } 56 57 /*ARGSUSED*/ 58 int 59 genfs_badop(v) 60 void *v; 61 { 62 63 panic("genfs: bad op"); 64 } 65 66 /*ARGSUSED*/ 67 int 68 genfs_nullop(v) 69 void *v; 70 { 71 72 return (0); 73 } 74 75 /*ARGSUSED*/ 76 int 77 genfs_eopnotsupp(v) 78 void *v; 79 { 80 81 return (EOPNOTSUPP); 82 } 83 84 /*ARGSUSED*/ 85 int 86 genfs_ebadf(v) 87 void *v; 88 { 89 90 return (EBADF); 91 } 92