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