aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/vfs_dentry.c
diff options
context:
space:
mode:
authorEric Van Hensbergen <ericvh@gmail.com>2007-02-11 14:21:39 -0500
committerEric Van Hensbergen <ericvh@gmail.com>2007-02-18 11:16:10 -0500
commite03abc0c963a31cb07dfbc07c7d85d75e0d13cf4 (patch)
tree1840001bde4a7f9f01d39dd09baf7d7b04e95706 /fs/9p/vfs_dentry.c
parent2c0463a9ae8751547c39302aeb31c6cef16b5df4 (diff)
9p: implement optional loose read cache
While cacheing is generally frowned upon in the 9p world, it has its place -- particularly in situations where the remote file system is exclusive and/or read-only. The vacfs views of venti content addressable store are a real-world instance of such a situation. To facilitate higher performance for these workloads (and eventually use the fscache patches), we have enabled a "loose" cache mode which does not attempt to maintain any form of consistency on the page-cache or dcache. This results in over two orders of magnitude performance improvement for cacheable block reads in the Bonnie benchmark. The more aggressive use of the dcache also seems to improve metadata operational performance. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'fs/9p/vfs_dentry.c')
-rw-r--r--fs/9p/vfs_dentry.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/fs/9p/vfs_dentry.c b/fs/9p/vfs_dentry.c
index 062daa6000ab..ddffd8aa902d 100644
--- a/fs/9p/vfs_dentry.c
+++ b/fs/9p/vfs_dentry.c
@@ -53,10 +53,31 @@
53static int v9fs_dentry_delete(struct dentry *dentry) 53static int v9fs_dentry_delete(struct dentry *dentry)
54{ 54{
55 dprintk(DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_iname, dentry); 55 dprintk(DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_iname, dentry);
56
56 return 1; 57 return 1;
57} 58}
58 59
59/** 60/**
61 * v9fs_cached_dentry_delete - called when dentry refcount equals 0
62 * @dentry: dentry in question
63 *
64 * Only return 1 if our inode is invalid. Only non-synthetic files
65 * (ones without mtime == 0) should be calling this function.
66 *
67 */
68
69static int v9fs_cached_dentry_delete(struct dentry *dentry)
70{
71 struct inode *inode = dentry->d_inode;
72 dprintk(DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_iname, dentry);
73
74 if(!inode)
75 return 1;
76
77 return 0;
78}
79
80/**
60 * v9fs_dentry_release - called when dentry is going to be freed 81 * v9fs_dentry_release - called when dentry is going to be freed
61 * @dentry: dentry that is being release 82 * @dentry: dentry that is being release
62 * 83 *
@@ -87,6 +108,11 @@ void v9fs_dentry_release(struct dentry *dentry)
87 } 108 }
88} 109}
89 110
111struct dentry_operations v9fs_cached_dentry_operations = {
112 .d_delete = v9fs_cached_dentry_delete,
113 .d_release = v9fs_dentry_release,
114};
115
90struct dentry_operations v9fs_dentry_operations = { 116struct dentry_operations v9fs_dentry_operations = {
91 .d_delete = v9fs_dentry_delete, 117 .d_delete = v9fs_dentry_delete,
92 .d_release = v9fs_dentry_release, 118 .d_release = v9fs_dentry_release,