10 #include <linux/types.h>
11 #include <linux/kernel.h>
12 #include <linux/time.h>
15 #include <linux/stat.h>
17 #include <linux/errno.h>
19 #include <linux/string.h>
20 #include <linux/slab.h>
21 #include <asm/uaccess.h>
23 #include <linux/coda.h>
24 #include <linux/coda_psdev.h>
30 coda_file_read(
struct file *coda_file,
char __user *
buf,
size_t count, loff_t *ppos)
33 struct file *host_file;
39 if (!host_file->
f_op || !host_file->
f_op->read)
42 return host_file->
f_op->read(host_file, buf, count, ppos);
46 coda_file_splice_read(
struct file *coda_file, loff_t *ppos,
53 struct file *host_file;
59 splice_read = host_file->
f_op->splice_read;
63 return splice_read(host_file, ppos, pipe, count, flags);
67 coda_file_write(
struct file *coda_file,
const char __user *buf,
size_t count, loff_t *ppos)
69 struct inode *host_inode, *coda_inode = coda_file->
f_path.dentry->d_inode;
71 struct file *host_file;
78 if (!host_file->
f_op || !host_file->
f_op->write)
81 host_inode = host_file->
f_path.dentry->d_inode;
84 ret = host_file->
f_op->write(host_file, buf, count, ppos);
99 struct file *host_file;
100 struct inode *coda_inode, *host_inode;
106 if (!host_file->
f_op || !host_file->
f_op->mmap)
109 coda_inode = coda_file->
f_path.dentry->d_inode;
110 host_inode = host_file->
f_path.dentry->d_inode;
112 cii = ITOC(coda_inode);
121 spin_unlock(&cii->
c_lock);
128 spin_unlock(&cii->
c_lock);
130 return host_file->
f_op->mmap(host_file, vma);
145 error =
venus_open(coda_inode->
i_sb, coda_i2f(coda_inode), coda_flags,
172 struct inode *host_inode;
179 coda_flags, coda_file->
f_cred->fsuid);
182 cii = ITOC(coda_inode);
191 spin_unlock(&cii->
c_lock);
204 struct file *host_file;
205 struct inode *coda_inode = coda_file->
f_path.dentry->d_inode;
223 if (!err && !datasync)
232 .read = coda_file_read,
233 .write = coda_file_write,
234 .mmap = coda_file_mmap,
238 .splice_read = coda_file_splice_read,