aboutsummaryrefslogtreecommitdiffstats
path: root/fs/coda/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/coda/file.c')
-rw-r--r--fs/coda/file.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/coda/file.c b/fs/coda/file.c
index 29137ff3ca67..6a347fbc998a 100644
--- a/fs/coda/file.c
+++ b/fs/coda/file.c
@@ -13,6 +13,7 @@
13#include <linux/file.h> 13#include <linux/file.h>
14#include <linux/fs.h> 14#include <linux/fs.h>
15#include <linux/stat.h> 15#include <linux/stat.h>
16#include <linux/cred.h>
16#include <linux/errno.h> 17#include <linux/errno.h>
17#include <linux/smp_lock.h> 18#include <linux/smp_lock.h>
18#include <linux/string.h> 19#include <linux/string.h>
@@ -174,7 +175,7 @@ int coda_release(struct inode *coda_inode, struct file *coda_file)
174 BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC); 175 BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC);
175 176
176 err = venus_close(coda_inode->i_sb, coda_i2f(coda_inode), 177 err = venus_close(coda_inode->i_sb, coda_i2f(coda_inode),
177 coda_flags, coda_file->f_uid); 178 coda_flags, coda_file->f_cred->fsuid);
178 179
179 host_inode = cfi->cfi_container->f_path.dentry->d_inode; 180 host_inode = cfi->cfi_container->f_path.dentry->d_inode;
180 cii = ITOC(coda_inode); 181 cii = ITOC(coda_inode);
@@ -200,8 +201,7 @@ int coda_release(struct inode *coda_inode, struct file *coda_file)
200int coda_fsync(struct file *coda_file, struct dentry *coda_dentry, int datasync) 201int coda_fsync(struct file *coda_file, struct dentry *coda_dentry, int datasync)
201{ 202{
202 struct file *host_file; 203 struct file *host_file;
203 struct dentry *host_dentry; 204 struct inode *coda_inode = coda_dentry->d_inode;
204 struct inode *host_inode, *coda_inode = coda_dentry->d_inode;
205 struct coda_file_info *cfi; 205 struct coda_file_info *cfi;
206 int err = 0; 206 int err = 0;
207 207
@@ -213,14 +213,7 @@ int coda_fsync(struct file *coda_file, struct dentry *coda_dentry, int datasync)
213 BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC); 213 BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC);
214 host_file = cfi->cfi_container; 214 host_file = cfi->cfi_container;
215 215
216 if (host_file->f_op && host_file->f_op->fsync) { 216 err = vfs_fsync(host_file, host_file->f_path.dentry, datasync);
217 host_dentry = host_file->f_path.dentry;
218 host_inode = host_dentry->d_inode;
219 mutex_lock(&host_inode->i_mutex);
220 err = host_file->f_op->fsync(host_file, host_dentry, datasync);
221 mutex_unlock(&host_inode->i_mutex);
222 }
223
224 if ( !err && !datasync ) { 217 if ( !err && !datasync ) {
225 lock_kernel(); 218 lock_kernel();
226 err = venus_fsync(coda_inode->i_sb, coda_i2f(coda_inode)); 219 err = venus_fsync(coda_inode->i_sb, coda_i2f(coda_inode));