aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/vfs_file.c
diff options
context:
space:
mode:
authorVenkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>2010-09-22 19:30:52 -0400
committerEric Van Hensbergen <ericvh@gmail.com>2010-10-28 10:08:47 -0400
commitb04faaf3717307cd976a15667c8c24161c1d24ef (patch)
tree8000428b36f21a112019abad4e0614c0b5c41317 /fs/9p/vfs_file.c
parent76381a42e4a5606774fd48413e6282cd7130ff2c (diff)
[fs/9p] Add file_operations for cached mode in dotl protocol.
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'fs/9p/vfs_file.c')
-rw-r--r--fs/9p/vfs_file.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index f455c45a8c5f..28db7fb1d96e 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -44,6 +44,7 @@
44#include "cache.h" 44#include "cache.h"
45 45
46static const struct file_operations v9fs_cached_file_operations; 46static const struct file_operations v9fs_cached_file_operations;
47static const struct file_operations v9fs_cached_file_operations_dotl;
47 48
48/** 49/**
49 * v9fs_file_open - open a file (or directory) 50 * v9fs_file_open - open a file (or directory)
@@ -92,6 +93,8 @@ int v9fs_file_open(struct inode *inode, struct file *file)
92 /* enable cached file options */ 93 /* enable cached file options */
93 if(file->f_op == &v9fs_file_operations) 94 if(file->f_op == &v9fs_file_operations)
94 file->f_op = &v9fs_cached_file_operations; 95 file->f_op = &v9fs_cached_file_operations;
96 else if (file->f_op == &v9fs_file_operations_dotl)
97 file->f_op = &v9fs_cached_file_operations_dotl;
95 98
96#ifdef CONFIG_9P_FSCACHE 99#ifdef CONFIG_9P_FSCACHE
97 v9fs_cache_inode_set_cookie(inode, file); 100 v9fs_cache_inode_set_cookie(inode, file);
@@ -299,6 +302,18 @@ static const struct file_operations v9fs_cached_file_operations = {
299 .fsync = v9fs_file_fsync, 302 .fsync = v9fs_file_fsync,
300}; 303};
301 304
305static const struct file_operations v9fs_cached_file_operations_dotl = {
306 .llseek = generic_file_llseek,
307 .read = do_sync_read,
308 .aio_read = generic_file_aio_read,
309 .write = v9fs_file_write,
310 .open = v9fs_file_open,
311 .release = v9fs_dir_release,
312 .lock = v9fs_file_lock,
313 .mmap = generic_file_readonly_mmap,
314 .fsync = v9fs_file_fsync,
315};
316
302const struct file_operations v9fs_file_operations = { 317const struct file_operations v9fs_file_operations = {
303 .llseek = generic_file_llseek, 318 .llseek = generic_file_llseek,
304 .read = v9fs_file_read, 319 .read = v9fs_file_read,