Skip to content

Commit 8a9f47d

Browse files
Christoph Hellwigtorvalds
authored andcommitted
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>
1 parent 562787a commit 8a9f47d

1 file changed

Lines changed: 1 addition & 41 deletions

File tree

‎fs/ntfs/file.c‎

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,46 +2145,6 @@ static ssize_t ntfs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
21452145
return ret;
21462146
}
21472147

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-
21882148
/**
21892149
* ntfs_file_fsync - sync a file to disk
21902150
* @filp: file to be synced
@@ -2247,7 +2207,7 @@ const struct file_operations ntfs_file_ops = {
22472207
.read = do_sync_read, /* Read from file. */
22482208
.aio_read = generic_file_aio_read, /* Async read from file. */
22492209
#ifdef NTFS_RW
2250-
.write = ntfs_file_write, /* Write to file. */
2210+
.write = do_sync_write, /* Write to file. */
22512211
.aio_write = ntfs_file_aio_write, /* Async write to file. */
22522212
/*.release = ,*/ /* Last file is closed. See
22532213
fs/ext2/file.c::

0 commit comments

Comments
 (0)