Remove redundant functions (repo-copied from nfsclient) for dealing with
fifos.
This commit is contained in:
parent
d0b2552098
commit
cb64ed501e
@ -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.
|
||||
*
|
||||
|
@ -194,10 +194,6 @@ nfs_rsunlock(struct nfsnode *np, struct thread *td)
|
||||
extern vop_t **fifo_nfsnodeop_p;
|
||||
extern vop_t **nfs_vnodeop_p;
|
||||
extern struct buf_ops buf_ops_nfs;
|
||||
|
||||
#if 0
|
||||
extern vop_t **fifo_nfs4nodeop_p;
|
||||
#endif
|
||||
extern vop_t **nfs4_vnodeop_p;
|
||||
extern struct buf_ops buf_ops_nfs4;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user