summaryrefslogtreecommitdiffstats
path: root/sys/fs/nullfs
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2005-01-24 22:56:24 +0000
committerphk <phk@FreeBSD.org>2005-01-24 22:56:24 +0000
commitad40d6a0263acb4b89e5378cfcd68d963411927e (patch)
tree4d011057d5277ced6b7a12b3153435816e6abaf5 /sys/fs/nullfs
parentc07ace7f7b4ed5767d3d6eb6fbc56ed010a292e1 (diff)
downloadFreeBSD-src-ad40d6a0263acb4b89e5378cfcd68d963411927e.zip
FreeBSD-src-ad40d6a0263acb4b89e5378cfcd68d963411927e.tar.gz
Add null_open() and null_close() which calls null_bypass() and managed
the v_object pointer.
Diffstat (limited to 'sys/fs/nullfs')
-rw-r--r--sys/fs/nullfs/null_vnops.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c
index a85ebe0..856671c 100644
--- a/sys/fs/nullfs/null_vnops.c
+++ b/sys/fs/nullfs/null_vnops.c
@@ -329,6 +329,19 @@ null_bypass(struct vop_generic_args *ap)
return (error);
}
+static int
+null_close(struct vop_close_args *ap)
+{
+ int retval;
+ struct vnode *vp;
+
+ vp = ap->a_vp;
+ retval = null_bypass(&ap->a_gen);
+ if (retval == 0)
+ vp->v_object = NULL;
+ return (retval);
+}
+
/*
* We have to carry on the locking protocol on the null layer vnodes
* as we progress through the tree. We also have to enforce read-only
@@ -382,6 +395,20 @@ null_lookup(struct vop_lookup_args *ap)
return (error);
}
+static int
+null_open(struct vop_open_args *ap)
+{
+ int retval;
+ struct vnode *vp, *ldvp;
+
+ vp = ap->a_vp;
+ ldvp = NULLVPTOLOWERVP(vp);
+ retval = null_bypass(&ap->a_gen);
+ if (retval == 0)
+ vp->v_object = ldvp->v_object;
+ return (retval);
+}
+
/*
* Setattr call. Disallow write attempts if the layer is mounted read-only.
*/
@@ -773,6 +800,7 @@ struct vop_vector null_vnodeops = {
.vop_access = null_access,
.vop_bmap = VOP_EOPNOTSUPP,
+ .vop_close = null_close,
.vop_createvobject = null_createvobject,
.vop_destroyvobject = null_destroyvobject,
.vop_getattr = null_getattr,
@@ -782,6 +810,7 @@ struct vop_vector null_vnodeops = {
.vop_islocked = null_islocked,
.vop_lock = null_lock,
.vop_lookup = null_lookup,
+ .vop_open = null_open,
.vop_print = null_print,
.vop_reclaim = null_reclaim,
.vop_rename = null_rename,
OpenPOWER on IntegriCloud