summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorups <ups@FreeBSD.org>2008-05-20 19:05:43 +0000
committerups <ups@FreeBSD.org>2008-05-20 19:05:43 +0000
commitfbd329664f5e1e99035c0b473a42b33812b91466 (patch)
tree122fb04f7bf2895af8ccd1d933a2cf8c59347db2 /sys/ufs
parent8a663465644dd0d19159348afb69bb2462822ed1 (diff)
downloadFreeBSD-src-fbd329664f5e1e99035c0b473a42b33812b91466.zip
FreeBSD-src-fbd329664f5e1e99035c0b473a42b33812b91466.tar.gz
Allow VM object creation in ufs_lookup. (If vfs.vmiodirenable is set)
Directory IO without a VM object will store data in 'malloced' buffers severely limiting caching of the data. Without this change VM objects for directories are only created on an open() of the directory. TODO: Inline test if VM object already exists to avoid locking/function call overhead. Tested by: kris@ Reviewed by: jeff@ Reported by: David Filo
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ufs/ufs_lookup.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c
index 0a2f532..467f084 100644
--- a/sys/ufs/ufs/ufs_lookup.c
+++ b/sys/ufs/ufs/ufs_lookup.c
@@ -168,6 +168,16 @@ ufs_lookup(ap)
vdp = ap->a_dvp;
dp = VTOI(vdp);
+
+ /*
+ * Create a vm object if vmiodirenable is enabled.
+ * Alternatively we could call vnode_create_vobject
+ * in VFS_VGET but we could end up creating objects
+ * that are never used.
+ */
+
+ vnode_create_vobject(vdp, DIP(dp, i_size), cnp->cn_thread);
+
/*
* We now have a segment name to search for, and a directory to search.
*
OpenPOWER on IntegriCloud