summaryrefslogtreecommitdiffstats
path: root/sys/nfs4client
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-09-27 20:02:50 +0000
committerphk <phk@FreeBSD.org>2004-09-27 20:02:50 +0000
commit5c67a82c63d23c91417eb3116f2968251a0c41ea (patch)
treeb30c2de4cc84708535b152ab7dc19ea0fdadff49 /sys/nfs4client
parent730b32e9d8d1f726dd86f0214c21e416b020d377 (diff)
downloadFreeBSD-src-5c67a82c63d23c91417eb3116f2968251a0c41ea.zip
FreeBSD-src-5c67a82c63d23c91417eb3116f2968251a0c41ea.tar.gz
Remove NFS4 vop method vector for devices: we are desupporing device nodes
on anything but DEVFS and in this case it was not even used (see below). Put the NFS4 vop method for fifo's behind "#if 0" because it is unused. Add a XXX comment to say that I think the unusedness is a bug.
Diffstat (limited to 'sys/nfs4client')
-rw-r--r--sys/nfs4client/nfs4_vnops.c93
1 files changed, 12 insertions, 81 deletions
diff --git a/sys/nfs4client/nfs4_vnops.c b/sys/nfs4client/nfs4_vnops.c
index 0f577b9..937db83 100644
--- a/sys/nfs4client/nfs4_vnops.c
+++ b/sys/nfs4client/nfs4_vnops.c
@@ -126,12 +126,12 @@ __FBSDID("$FreeBSD$");
#define vfs_busy_pages(bp, f)
#endif
-static int nfsspec_read(struct vop_read_args *);
-static int nfsspec_write(struct vop_write_args *);
+#if 0
static int nfsfifo_read(struct vop_read_args *);
static int nfsfifo_write(struct vop_write_args *);
-static int nfsspec_close(struct vop_close_args *);
static int nfsfifo_close(struct vop_close_args *);
+static int nfsspec_access(struct vop_access_args *);
+#endif
static int nfs4_flush(struct vnode *, struct ucred *, int, struct thread *,
int);
static int nfs4_setattrrpc(struct vnode *, struct vattr *, struct ucred *,
@@ -160,7 +160,6 @@ static int nfs4_lookitup(struct vnode *, const char *, int,
struct ucred *, struct thread *, struct nfsnode **);
static int nfs4_sillyrename(struct vnode *, struct vnode *,
struct componentname *);
-static int nfsspec_access(struct vop_access_args *);
static int nfs4_readlink(struct vop_readlink_args *);
static int nfs4_print(struct vop_print_args *);
static int nfs4_advlock(struct vop_advlock_args *);
@@ -204,27 +203,15 @@ static struct vnodeopv_desc nfs4_vnodeop_opv_desc =
{ &nfs4_vnodeop_p, nfs4_vnodeop_entries };
VNODEOP_SET(nfs4_vnodeop_opv_desc);
+#if 0
/*
* Special device vnode ops
+ *
+ * XXX: I've commented this stuff out because it is unused. It is not clear
+ * XXX: however that it shouldn't be used: the current code applies the
+ * XXX: vector from sys/nfsclient and it would take some luck for that to
+ * XXX: work also in the NFS4 case I think /phk.
*/
-vop_t **spec_nfs4nodeop_p;
-static struct vnodeopv_entry_desc nfs4_specop_entries[] = {
- { &vop_default_desc, (vop_t *) spec_vnoperate },
- { &vop_access_desc, (vop_t *) nfsspec_access },
- { &vop_close_desc, (vop_t *) nfsspec_close },
- { &vop_fsync_desc, (vop_t *) nfs4_fsync },
- { &vop_getattr_desc, (vop_t *) nfs4_getattr },
- { &vop_inactive_desc, (vop_t *) nfs_inactive },
- { &vop_print_desc, (vop_t *) nfs4_print },
- { &vop_read_desc, (vop_t *) nfsspec_read },
- { &vop_reclaim_desc, (vop_t *) nfs_reclaim },
- { &vop_setattr_desc, (vop_t *) nfs4_setattr },
- { &vop_write_desc, (vop_t *) nfsspec_write },
- { NULL, NULL }
-};
-static struct vnodeopv_desc spec_nfs4nodeop_opv_desc =
- { &spec_nfs4nodeop_p, nfs4_specop_entries };
-VNODEOP_SET(spec_nfs4nodeop_opv_desc);
vop_t **fifo_nfs4nodeop_p;
static struct vnodeopv_entry_desc nfs4_fifoop_entries[] = {
@@ -244,6 +231,7 @@ static struct vnodeopv_entry_desc nfs4_fifoop_entries[] = {
static struct vnodeopv_desc fifo_nfs4nodeop_opv_desc =
{ &fifo_nfs4nodeop_p, nfs4_fifoop_entries };
VNODEOP_SET(fifo_nfs4nodeop_opv_desc);
+#endif
static int nfs4_removerpc(struct vnode *dvp, const char *name, int namelen,
struct ucred *cred, struct thread *td);
@@ -2994,6 +2982,7 @@ 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
@@ -3033,65 +3022,6 @@ nfsspec_access(struct vop_access_args *ap)
}
/*
- * Read wrapper for special devices.
- */
-static int
-nfsspec_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(spec_vnodeop_p, VOFFSET(vop_read), ap));
-}
-
-/*
- * Write wrapper for special devices.
- */
-static int
-nfsspec_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(spec_vnodeop_p, VOFFSET(vop_write), ap));
-}
-
-/*
- * Close wrapper for special devices.
- *
- * Update the times on the nfsnode then do device close.
- */
-static int
-nfsspec_close(struct vop_close_args *ap)
-{
- struct vnode *vp = ap->a_vp;
- struct nfsnode *np = VTONFS(vp);
- struct vattr vattr;
-
- if (np->n_flag & (NACC | NUPD)) {
- 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;
- (void)VOP_SETATTR(vp, &vattr, ap->a_cred, ap->a_td);
- }
- }
- return (VOCALL(spec_vnodeop_p, VOFFSET(vop_close), ap));
-}
-
-/*
* Read wrapper for fifos.
*/
static int
@@ -3158,3 +3088,4 @@ nfsfifo_close(struct vop_close_args *ap)
return (VOCALL(fifo_vnodeop_p, VOFFSET(vop_close), ap));
}
+#endif
OpenPOWER on IntegriCloud