diff options
Diffstat (limited to 'fs/coda')
-rw-r--r-- | fs/coda/coda_int.h | 2 | ||||
-rw-r--r-- | fs/coda/coda_linux.h | 2 | ||||
-rw-r--r-- | fs/coda/dir.c | 9 | ||||
-rw-r--r-- | fs/coda/file.c | 8 | ||||
-rw-r--r-- | fs/coda/pioctl.c | 4 |
5 files changed, 15 insertions, 10 deletions
diff --git a/fs/coda/coda_int.h b/fs/coda/coda_int.h index 6b443ff43a1..b7143cf783a 100644 --- a/fs/coda/coda_int.h +++ b/fs/coda/coda_int.h | |||
@@ -11,7 +11,7 @@ extern int coda_fake_statfs; | |||
11 | 11 | ||
12 | void coda_destroy_inodecache(void); | 12 | void coda_destroy_inodecache(void); |
13 | int coda_init_inodecache(void); | 13 | int coda_init_inodecache(void); |
14 | int coda_fsync(struct file *coda_file, int datasync); | 14 | int coda_fsync(struct file *coda_file, loff_t start, loff_t end, int datasync); |
15 | void coda_sysctl_init(void); | 15 | void coda_sysctl_init(void); |
16 | void coda_sysctl_clean(void); | 16 | void coda_sysctl_clean(void); |
17 | 17 | ||
diff --git a/fs/coda/coda_linux.h b/fs/coda/coda_linux.h index 9b0c5323890..44e17e9c21a 100644 --- a/fs/coda/coda_linux.h +++ b/fs/coda/coda_linux.h | |||
@@ -39,7 +39,7 @@ extern const struct file_operations coda_ioctl_operations; | |||
39 | /* operations shared over more than one file */ | 39 | /* operations shared over more than one file */ |
40 | int coda_open(struct inode *i, struct file *f); | 40 | int coda_open(struct inode *i, struct file *f); |
41 | int coda_release(struct inode *i, struct file *f); | 41 | int coda_release(struct inode *i, struct file *f); |
42 | int coda_permission(struct inode *inode, int mask, unsigned int flags); | 42 | int coda_permission(struct inode *inode, int mask); |
43 | int coda_revalidate_inode(struct dentry *); | 43 | int coda_revalidate_inode(struct dentry *); |
44 | int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 44 | int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
45 | int coda_setattr(struct dentry *, struct iattr *); | 45 | int coda_setattr(struct dentry *, struct iattr *); |
diff --git a/fs/coda/dir.c b/fs/coda/dir.c index 2b8dae4d121..0239433f50c 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c | |||
@@ -132,11 +132,11 @@ exit: | |||
132 | } | 132 | } |
133 | 133 | ||
134 | 134 | ||
135 | int coda_permission(struct inode *inode, int mask, unsigned int flags) | 135 | int coda_permission(struct inode *inode, int mask) |
136 | { | 136 | { |
137 | int error; | 137 | int error; |
138 | 138 | ||
139 | if (flags & IPERM_FLAG_RCU) | 139 | if (mask & MAY_NOT_BLOCK) |
140 | return -ECHILD; | 140 | return -ECHILD; |
141 | 141 | ||
142 | mask &= MAY_READ | MAY_WRITE | MAY_EXEC; | 142 | mask &= MAY_READ | MAY_WRITE | MAY_EXEC; |
@@ -449,8 +449,7 @@ static int coda_venus_readdir(struct file *coda_file, void *buf, | |||
449 | struct file *host_file; | 449 | struct file *host_file; |
450 | struct dentry *de; | 450 | struct dentry *de; |
451 | struct venus_dirent *vdir; | 451 | struct venus_dirent *vdir; |
452 | unsigned long vdir_size = | 452 | unsigned long vdir_size = offsetof(struct venus_dirent, d_name); |
453 | (unsigned long)(&((struct venus_dirent *)0)->d_name); | ||
454 | unsigned int type; | 453 | unsigned int type; |
455 | struct qstr name; | 454 | struct qstr name; |
456 | ino_t ino; | 455 | ino_t ino; |
@@ -474,7 +473,7 @@ static int coda_venus_readdir(struct file *coda_file, void *buf, | |||
474 | coda_file->f_pos++; | 473 | coda_file->f_pos++; |
475 | } | 474 | } |
476 | if (coda_file->f_pos == 1) { | 475 | if (coda_file->f_pos == 1) { |
477 | ret = filldir(buf, "..", 2, 1, de->d_parent->d_inode->i_ino, DT_DIR); | 476 | ret = filldir(buf, "..", 2, 1, parent_ino(de), DT_DIR); |
478 | if (ret < 0) | 477 | if (ret < 0) |
479 | goto out; | 478 | goto out; |
480 | result++; | 479 | result++; |
diff --git a/fs/coda/file.c b/fs/coda/file.c index 0433057be33..8edd404e641 100644 --- a/fs/coda/file.c +++ b/fs/coda/file.c | |||
@@ -199,7 +199,7 @@ int coda_release(struct inode *coda_inode, struct file *coda_file) | |||
199 | return 0; | 199 | return 0; |
200 | } | 200 | } |
201 | 201 | ||
202 | int coda_fsync(struct file *coda_file, int datasync) | 202 | int coda_fsync(struct file *coda_file, loff_t start, loff_t end, int datasync) |
203 | { | 203 | { |
204 | struct file *host_file; | 204 | struct file *host_file; |
205 | struct inode *coda_inode = coda_file->f_path.dentry->d_inode; | 205 | struct inode *coda_inode = coda_file->f_path.dentry->d_inode; |
@@ -210,6 +210,11 @@ int coda_fsync(struct file *coda_file, int datasync) | |||
210 | S_ISLNK(coda_inode->i_mode))) | 210 | S_ISLNK(coda_inode->i_mode))) |
211 | return -EINVAL; | 211 | return -EINVAL; |
212 | 212 | ||
213 | err = filemap_write_and_wait_range(coda_inode->i_mapping, start, end); | ||
214 | if (err) | ||
215 | return err; | ||
216 | mutex_lock(&coda_inode->i_mutex); | ||
217 | |||
213 | cfi = CODA_FTOC(coda_file); | 218 | cfi = CODA_FTOC(coda_file); |
214 | BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC); | 219 | BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC); |
215 | host_file = cfi->cfi_container; | 220 | host_file = cfi->cfi_container; |
@@ -217,6 +222,7 @@ int coda_fsync(struct file *coda_file, int datasync) | |||
217 | err = vfs_fsync(host_file, datasync); | 222 | err = vfs_fsync(host_file, datasync); |
218 | if (!err && !datasync) | 223 | if (!err && !datasync) |
219 | err = venus_fsync(coda_inode->i_sb, coda_i2f(coda_inode)); | 224 | err = venus_fsync(coda_inode->i_sb, coda_i2f(coda_inode)); |
225 | mutex_unlock(&coda_inode->i_mutex); | ||
220 | 226 | ||
221 | return err; | 227 | return err; |
222 | } | 228 | } |
diff --git a/fs/coda/pioctl.c b/fs/coda/pioctl.c index cb140ef293e..ee0981f1375 100644 --- a/fs/coda/pioctl.c +++ b/fs/coda/pioctl.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include "coda_linux.h" | 24 | #include "coda_linux.h" |
25 | 25 | ||
26 | /* pioctl ops */ | 26 | /* pioctl ops */ |
27 | static int coda_ioctl_permission(struct inode *inode, int mask, unsigned int flags); | 27 | static int coda_ioctl_permission(struct inode *inode, int mask); |
28 | static long coda_pioctl(struct file *filp, unsigned int cmd, | 28 | static long coda_pioctl(struct file *filp, unsigned int cmd, |
29 | unsigned long user_data); | 29 | unsigned long user_data); |
30 | 30 | ||
@@ -41,7 +41,7 @@ const struct file_operations coda_ioctl_operations = { | |||
41 | }; | 41 | }; |
42 | 42 | ||
43 | /* the coda pioctl inode ops */ | 43 | /* the coda pioctl inode ops */ |
44 | static int coda_ioctl_permission(struct inode *inode, int mask, unsigned int flags) | 44 | static int coda_ioctl_permission(struct inode *inode, int mask) |
45 | { | 45 | { |
46 | return (mask & MAY_EXEC) ? -EACCES : 0; | 46 | return (mask & MAY_EXEC) ? -EACCES : 0; |
47 | } | 47 | } |