diff options
Diffstat (limited to 'fs/coda/file.c')
-rw-r--r-- | fs/coda/file.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/fs/coda/file.c b/fs/coda/file.c index a6b32c883a50..0dbd13ab72e3 100644 --- a/fs/coda/file.c +++ b/fs/coda/file.c | |||
@@ -37,9 +37,7 @@ static ssize_t | |||
37 | coda_file_read_iter(struct kiocb *iocb, struct iov_iter *to) | 37 | coda_file_read_iter(struct kiocb *iocb, struct iov_iter *to) |
38 | { | 38 | { |
39 | struct file *coda_file = iocb->ki_filp; | 39 | struct file *coda_file = iocb->ki_filp; |
40 | struct coda_file_info *cfi = CODA_FTOC(coda_file); | 40 | struct coda_file_info *cfi = coda_ftoc(coda_file); |
41 | |||
42 | BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC); | ||
43 | 41 | ||
44 | return vfs_iter_read(cfi->cfi_container, to, &iocb->ki_pos, 0); | 42 | return vfs_iter_read(cfi->cfi_container, to, &iocb->ki_pos, 0); |
45 | } | 43 | } |
@@ -49,12 +47,10 @@ coda_file_write_iter(struct kiocb *iocb, struct iov_iter *to) | |||
49 | { | 47 | { |
50 | struct file *coda_file = iocb->ki_filp; | 48 | struct file *coda_file = iocb->ki_filp; |
51 | struct inode *coda_inode = file_inode(coda_file); | 49 | struct inode *coda_inode = file_inode(coda_file); |
52 | struct coda_file_info *cfi = CODA_FTOC(coda_file); | 50 | struct coda_file_info *cfi = coda_ftoc(coda_file); |
53 | struct file *host_file; | 51 | struct file *host_file; |
54 | ssize_t ret; | 52 | ssize_t ret; |
55 | 53 | ||
56 | BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC); | ||
57 | |||
58 | host_file = cfi->cfi_container; | 54 | host_file = cfi->cfi_container; |
59 | file_start_write(host_file); | 55 | file_start_write(host_file); |
60 | inode_lock(coda_inode); | 56 | inode_lock(coda_inode); |
@@ -105,8 +101,7 @@ coda_file_mmap(struct file *coda_file, struct vm_area_struct *vma) | |||
105 | struct coda_vm_ops *cvm_ops; | 101 | struct coda_vm_ops *cvm_ops; |
106 | int ret; | 102 | int ret; |
107 | 103 | ||
108 | cfi = CODA_FTOC(coda_file); | 104 | cfi = coda_ftoc(coda_file); |
109 | BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC); | ||
110 | host_file = cfi->cfi_container; | 105 | host_file = cfi->cfi_container; |
111 | 106 | ||
112 | if (!host_file->f_op->mmap) | 107 | if (!host_file->f_op->mmap) |
@@ -208,8 +203,7 @@ int coda_release(struct inode *coda_inode, struct file *coda_file) | |||
208 | struct inode *host_inode; | 203 | struct inode *host_inode; |
209 | int err; | 204 | int err; |
210 | 205 | ||
211 | cfi = CODA_FTOC(coda_file); | 206 | cfi = coda_ftoc(coda_file); |
212 | BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC); | ||
213 | 207 | ||
214 | err = venus_close(coda_inode->i_sb, coda_i2f(coda_inode), | 208 | err = venus_close(coda_inode->i_sb, coda_i2f(coda_inode), |
215 | coda_flags, coda_file->f_cred->fsuid); | 209 | coda_flags, coda_file->f_cred->fsuid); |
@@ -251,8 +245,7 @@ int coda_fsync(struct file *coda_file, loff_t start, loff_t end, int datasync) | |||
251 | return err; | 245 | return err; |
252 | inode_lock(coda_inode); | 246 | inode_lock(coda_inode); |
253 | 247 | ||
254 | cfi = CODA_FTOC(coda_file); | 248 | cfi = coda_ftoc(coda_file); |
255 | BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC); | ||
256 | host_file = cfi->cfi_container; | 249 | host_file = cfi->cfi_container; |
257 | 250 | ||
258 | err = vfs_fsync(host_file, datasync); | 251 | err = vfs_fsync(host_file, datasync); |