diff options
-rw-r--r-- | fs/ntfs/file.c | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c index 4350d4993b18..663c0e341f8b 100644 --- a/fs/ntfs/file.c +++ b/fs/ntfs/file.c | |||
@@ -2146,46 +2146,6 @@ static ssize_t ntfs_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
2146 | } | 2146 | } |
2147 | 2147 | ||
2148 | /** | 2148 | /** |
2149 | * ntfs_file_writev - | ||
2150 | * | ||
2151 | * Basically the same as generic_file_writev() except that it ends up calling | ||
2152 | * ntfs_file_aio_write_nolock() instead of __generic_file_aio_write_nolock(). | ||
2153 | */ | ||
2154 | static ssize_t ntfs_file_writev(struct file *file, const struct iovec *iov, | ||
2155 | unsigned long nr_segs, loff_t *ppos) | ||
2156 | { | ||
2157 | struct address_space *mapping = file->f_mapping; | ||
2158 | struct inode *inode = mapping->host; | ||
2159 | struct kiocb kiocb; | ||
2160 | ssize_t ret; | ||
2161 | |||
2162 | mutex_lock(&inode->i_mutex); | ||
2163 | init_sync_kiocb(&kiocb, file); | ||
2164 | ret = ntfs_file_aio_write_nolock(&kiocb, iov, nr_segs, ppos); | ||
2165 | if (ret == -EIOCBQUEUED) | ||
2166 | ret = wait_on_sync_kiocb(&kiocb); | ||
2167 | mutex_unlock(&inode->i_mutex); | ||
2168 | if (ret > 0) { | ||
2169 | int err = generic_write_sync(file, *ppos - ret, ret); | ||
2170 | if (err < 0) | ||
2171 | ret = err; | ||
2172 | } | ||
2173 | return ret; | ||
2174 | } | ||
2175 | |||
2176 | /** | ||
2177 | * ntfs_file_write - simple wrapper for ntfs_file_writev() | ||
2178 | */ | ||
2179 | static ssize_t ntfs_file_write(struct file *file, const char __user *buf, | ||
2180 | size_t count, loff_t *ppos) | ||
2181 | { | ||
2182 | struct iovec local_iov = { .iov_base = (void __user *)buf, | ||
2183 | .iov_len = count }; | ||
2184 | |||
2185 | return ntfs_file_writev(file, &local_iov, 1, ppos); | ||
2186 | } | ||
2187 | |||
2188 | /** | ||
2189 | * ntfs_file_fsync - sync a file to disk | 2149 | * ntfs_file_fsync - sync a file to disk |
2190 | * @filp: file to be synced | 2150 | * @filp: file to be synced |
2191 | * @dentry: dentry describing the file to sync | 2151 | * @dentry: dentry describing the file to sync |
@@ -2247,7 +2207,7 @@ const struct file_operations ntfs_file_ops = { | |||
2247 | .read = do_sync_read, /* Read from file. */ | 2207 | .read = do_sync_read, /* Read from file. */ |
2248 | .aio_read = generic_file_aio_read, /* Async read from file. */ | 2208 | .aio_read = generic_file_aio_read, /* Async read from file. */ |
2249 | #ifdef NTFS_RW | 2209 | #ifdef NTFS_RW |
2250 | .write = ntfs_file_write, /* Write to file. */ | 2210 | .write = do_sync_write, /* Write to file. */ |
2251 | .aio_write = ntfs_file_aio_write, /* Async write to file. */ | 2211 | .aio_write = ntfs_file_aio_write, /* Async write to file. */ |
2252 | /*.release = ,*/ /* Last file is closed. See | 2212 | /*.release = ,*/ /* Last file is closed. See |
2253 | fs/ext2/file.c:: | 2213 | fs/ext2/file.c:: |