diff options
Diffstat (limited to 'fs/udf')
-rw-r--r-- | fs/udf/file.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/udf/file.c b/fs/udf/file.c index a59e5f33daf6..7aedd552cba1 100644 --- a/fs/udf/file.c +++ b/fs/udf/file.c | |||
@@ -103,19 +103,21 @@ const struct address_space_operations udf_adinicb_aops = { | |||
103 | .commit_write = udf_adinicb_commit_write, | 103 | .commit_write = udf_adinicb_commit_write, |
104 | }; | 104 | }; |
105 | 105 | ||
106 | static ssize_t udf_file_write(struct file * file, const char __user * buf, | 106 | static ssize_t udf_file_aio_write(struct kiocb *iocb, const struct iovec *iov, |
107 | size_t count, loff_t *ppos) | 107 | unsigned long nr_segs, loff_t ppos) |
108 | { | 108 | { |
109 | ssize_t retval; | 109 | ssize_t retval; |
110 | struct file *file = iocb->ki_filp; | ||
110 | struct inode *inode = file->f_dentry->d_inode; | 111 | struct inode *inode = file->f_dentry->d_inode; |
111 | int err, pos; | 112 | int err, pos; |
113 | size_t count = iocb->ki_left; | ||
112 | 114 | ||
113 | if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB) | 115 | if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB) |
114 | { | 116 | { |
115 | if (file->f_flags & O_APPEND) | 117 | if (file->f_flags & O_APPEND) |
116 | pos = inode->i_size; | 118 | pos = inode->i_size; |
117 | else | 119 | else |
118 | pos = *ppos; | 120 | pos = ppos; |
119 | 121 | ||
120 | if (inode->i_sb->s_blocksize < (udf_file_entry_alloc_offset(inode) + | 122 | if (inode->i_sb->s_blocksize < (udf_file_entry_alloc_offset(inode) + |
121 | pos + count)) | 123 | pos + count)) |
@@ -136,7 +138,7 @@ static ssize_t udf_file_write(struct file * file, const char __user * buf, | |||
136 | } | 138 | } |
137 | } | 139 | } |
138 | 140 | ||
139 | retval = generic_file_write(file, buf, count, ppos); | 141 | retval = generic_file_aio_write(iocb, iov, nr_segs, ppos); |
140 | 142 | ||
141 | if (retval > 0) | 143 | if (retval > 0) |
142 | mark_inode_dirty(inode); | 144 | mark_inode_dirty(inode); |
@@ -249,11 +251,13 @@ static int udf_release_file(struct inode * inode, struct file * filp) | |||
249 | } | 251 | } |
250 | 252 | ||
251 | const struct file_operations udf_file_operations = { | 253 | const struct file_operations udf_file_operations = { |
252 | .read = generic_file_read, | 254 | .read = do_sync_read, |
255 | .aio_read = generic_file_aio_read, | ||
253 | .ioctl = udf_ioctl, | 256 | .ioctl = udf_ioctl, |
254 | .open = generic_file_open, | 257 | .open = generic_file_open, |
255 | .mmap = generic_file_mmap, | 258 | .mmap = generic_file_mmap, |
256 | .write = udf_file_write, | 259 | .write = do_sync_write, |
260 | .aio_write = udf_file_aio_write, | ||
257 | .release = udf_release_file, | 261 | .release = udf_release_file, |
258 | .fsync = udf_fsync_file, | 262 | .fsync = udf_fsync_file, |
259 | .sendfile = generic_file_sendfile, | 263 | .sendfile = generic_file_sendfile, |