summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2008-01-19 13:27:14 +0000
committerrwatson <rwatson@FreeBSD.org>2008-01-19 13:27:14 +0000
commit642dbf24b6325e4d6320f40640e974cfd44b582f (patch)
treeaf1ac46070c0fcc55585d7b1bd3d8f564888245c /sys/fs
parent393839ea2be4cce3e92d7deeda170cd48c324d0b (diff)
downloadFreeBSD-src-642dbf24b6325e4d6320f40640e974cfd44b582f.zip
FreeBSD-src-642dbf24b6325e4d6320f40640e974cfd44b582f.tar.gz
Borrow the VM object associated with an underlying cache vnode with the
Coda vnode derived from it, in the style of nullfs. This allows files in the Coda file system to be memory-mapped, such as with execve(2) or mmap(2). MFC after: 3 days Reported by: Rune <u+openafsdev-sr55 at chalmers dot se>
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/coda/coda_vnops.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/fs/coda/coda_vnops.c b/sys/fs/coda/coda_vnops.c
index fe0b2c9..5f1cb0c 100644
--- a/sys/fs/coda/coda_vnops.c
+++ b/sys/fs/coda/coda_vnops.c
@@ -244,6 +244,8 @@ coda_open(struct vop_open_args *ap)
if (error) {
printf("coda_open: VOP_OPEN on container failed %d\n", error);
return (error);
+ } else {
+ (*vpp)->v_object = vp->v_object;
}
/* grab (above) does this when it calls newvnode unless it's in the cache*/
@@ -747,6 +749,8 @@ coda_inactive(struct vop_inactive_args *ap)
CODADEBUG(CODA_INACTIVE, myprintf(("in inactive, %s, vfsp %p\n",
coda_f2s(&cp->c_fid), vp->v_mount));)
+
+ vp->v_object = NULL;
/* If an array has been allocated to hold the symlink, deallocate it */
if ((coda_symlink_cache) && (VALID_SYMLINK(cp))) {
@@ -1552,7 +1556,7 @@ coda_reclaim(struct vop_reclaim_args *ap)
cache_purge(vp);
coda_free(VTOC(vp));
vp->v_data = NULL;
- vnode_destroy_vobject(vp);
+ vp->v_object = NULL;
return (0);
}
OpenPOWER on IntegriCloud