Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ntfs: remove ntfs_file_write

do_sync_write() does the right thing for turning the aio_writev method
into a normal non-vectored synchronous write, no need to duplicate it in
ntfs.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Anton Altaparmakov <aia21@cantab.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Christoph Hellwig and committed by
Linus Torvalds
8a9f47dd 562787a5

+1 -41
+1 -41
fs/ntfs/file.c
··· 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 2149 * ntfs_file_fsync - sync a file to disk 2190 2150 * @filp: file to be synced 2191 2151 * @dentry: dentry describing the file to sync ··· 2207 2247 .read = do_sync_read, /* Read from file. */ 2208 2248 .aio_read = generic_file_aio_read, /* Async read from file. */ 2209 2249 #ifdef NTFS_RW 2210 - .write = ntfs_file_write, /* Write to file. */ 2250 + .write = do_sync_write, /* Write to file. */ 2211 2251 .aio_write = ntfs_file_aio_write, /* Async write to file. */ 2212 2252 /*.release = ,*/ /* Last file is closed. See 2213 2253 fs/ext2/file.c::