From cb64ed501e0d0c8c5a158f1d6c34594044720813 Mon Sep 17 00:00:00 2001 From: phk Date: Wed, 1 Dec 2004 20:18:56 +0000 Subject: Remove redundant functions (repo-copied from nfsclient) for dealing with fifos. --- sys/nfs4client/nfs4_vnops.c | 114 -------------------------------------------- 1 file changed, 114 deletions(-) (limited to 'sys/nfs4client') diff --git a/sys/nfs4client/nfs4_vnops.c b/sys/nfs4client/nfs4_vnops.c index 2d03bf5..22698d9 100644 --- a/sys/nfs4client/nfs4_vnops.c +++ b/sys/nfs4client/nfs4_vnops.c @@ -126,12 +126,6 @@ __FBSDID("$FreeBSD$"); #define vfs_busy_pages(bp, f) #endif -#if 0 -static vop_read_t nfsfifo_read; -static vop_write_t nfsfifo_write; -static vop_close_t nfsfifo_close; -static vop_access_t nfsspec_access; -#endif static int nfs4_flush(struct vnode *, struct ucred *, int, struct thread *, int); static int nfs4_setattrrpc(struct vnode *, struct vattr *, struct ucred *, @@ -2974,114 +2968,6 @@ nfs4_writebp(struct buf *bp, int force __unused, struct thread *td) return (0); } -#if 0 -/* - * nfs special file access vnode op. - * Essentially just get vattr and then imitate iaccess() since the device is - * local to the client. - */ -static int -nfsspec_access(struct vop_access_args *ap) -{ - struct vattr *vap; - struct ucred *cred = ap->a_cred; - struct vnode *vp = ap->a_vp; - mode_t mode = ap->a_mode; - struct vattr vattr; - int error; - - /* - * Disallow write attempts on filesystems mounted read-only; - * unless the file is a socket, fifo, or a block or character - * device resident on the filesystem. - */ - if ((mode & VWRITE) && (vp->v_mount->mnt_flag & MNT_RDONLY)) { - switch (vp->v_type) { - case VREG: - case VDIR: - case VLNK: - return (EROFS); - default: - break; - } - } - vap = &vattr; - error = VOP_GETATTR(vp, vap, cred, ap->a_td); - if (error) - return (error); - return (vaccess(vp->v_type, vap->va_mode, vap->va_uid, vap->va_gid, - mode, cred, NULL)); -} - -/* - * Read wrapper for fifos. - */ -static int -nfsfifo_read(struct vop_read_args *ap) -{ - struct nfsnode *np = VTONFS(ap->a_vp); - - /* - * Set access flag. - */ - np->n_flag |= NACC; - getnanotime(&np->n_atim); - return (VOCALL(fifo_vnodeop_p, VOFFSET(vop_read), ap)); -} - -/* - * Write wrapper for fifos. - */ -static int -nfsfifo_write(struct vop_write_args *ap) -{ - struct nfsnode *np = VTONFS(ap->a_vp); - - /* - * Set update flag. - */ - np->n_flag |= NUPD; - getnanotime(&np->n_mtim); - return (VOCALL(fifo_vnodeop_p, VOFFSET(vop_write), ap)); -} - -/* - * Close wrapper for fifos. - * - * Update the times on the nfsnode then do fifo close. - */ -static int -nfsfifo_close(struct vop_close_args *ap) -{ - struct vnode *vp = ap->a_vp; - struct nfsnode *np = VTONFS(vp); - struct vattr vattr; - struct timespec ts; - - if (np->n_flag & (NACC | NUPD)) { - getnanotime(&ts); - if (np->n_flag & NACC) - np->n_atim = ts; - if (np->n_flag & NUPD) - np->n_mtim = ts; - np->n_flag |= NCHG; - if (vrefcnt(vp) == 1 && - (vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { - VATTR_NULL(&vattr); - if (np->n_flag & NACC) - vattr.va_atime = np->n_atim; - if (np->n_flag & NUPD) - vattr.va_mtime = np->n_mtim; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, ap->a_td); - (void)VOP_SETATTR(vp, &vattr, ap->a_cred, ap->a_td); - VOP_UNLOCK(vp, 0, ap->a_td); - } - } - return (VOCALL(fifo_vnodeop_p, VOFFSET(vop_close), ap)); -} - -#endif - /* * Just call nfs_writebp() with the force argument set to 1. * -- cgit v1.1