aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/vfs_inode.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_inode.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_inode.c')
-rw-r--r--fs/9p/vfs_inode.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 5cf22134826b..124a085d1f2e 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -504,7 +504,10 @@ v9fs_vfs_create(struct inode *dir, struct dentry *dentry, int mode,
504 goto error; 504 goto error;
505 } 505 }
506 506
507 dentry->d_op = &v9fs_dentry_operations; 507 if(v9ses->cache)
508 dentry->d_op = &v9fs_cached_dentry_operations;
509 else
510 dentry->d_op = &v9fs_dentry_operations;
508 d_instantiate(dentry, inode); 511 d_instantiate(dentry, inode);
509 512
510 if (nd && nd->flags & LOOKUP_OPEN) { 513 if (nd && nd->flags & LOOKUP_OPEN) {
@@ -589,7 +592,10 @@ static int v9fs_vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
589 goto error; 592 goto error;
590 } 593 }
591 594
592 dentry->d_op = &v9fs_dentry_operations; 595 if(v9ses->cache)
596 dentry->d_op = &v9fs_cached_dentry_operations;
597 else
598 dentry->d_op = &v9fs_dentry_operations;
593 d_instantiate(dentry, inode); 599 d_instantiate(dentry, inode);
594 return 0; 600 return 0;
595 601
@@ -626,7 +632,6 @@ static struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
626 632
627 sb = dir->i_sb; 633 sb = dir->i_sb;
628 v9ses = v9fs_inode2v9ses(dir); 634 v9ses = v9fs_inode2v9ses(dir);
629 dentry->d_op = &v9fs_dentry_operations;
630 dirfid = v9fs_fid_lookup(dentry->d_parent); 635 dirfid = v9fs_fid_lookup(dentry->d_parent);
631 636
632 if(IS_ERR(dirfid)) 637 if(IS_ERR(dirfid))
@@ -697,6 +702,10 @@ static struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
697 702
698 fid->qid = fcall->params.rstat.stat.qid; 703 fid->qid = fcall->params.rstat.stat.qid;
699 v9fs_stat2inode(&fcall->params.rstat.stat, inode, inode->i_sb); 704 v9fs_stat2inode(&fcall->params.rstat.stat, inode, inode->i_sb);
705 if((fid->qid.version)&&(v9ses->cache))
706 dentry->d_op = &v9fs_cached_dentry_operations;
707 else
708 dentry->d_op = &v9fs_dentry_operations;
700 709
701 d_add(dentry, inode); 710 d_add(dentry, inode);
702 kfree(fcall); 711 kfree(fcall);
@@ -1184,7 +1193,10 @@ static int v9fs_vfs_mkspecial(struct inode *dir, struct dentry *dentry,
1184 goto free_vfid; 1193 goto free_vfid;
1185 } 1194 }
1186 1195
1187 dentry->d_op = &v9fs_dentry_operations; 1196 if(v9ses->cache)
1197 dentry->d_op = &v9fs_cached_dentry_operations;
1198 else
1199 dentry->d_op = &v9fs_dentry_operations;
1188 d_instantiate(dentry, inode); 1200 d_instantiate(dentry, inode);
1189 return 0; 1201 return 0;
1190 1202