aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fat
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-12 13:30:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-12 13:30:18 -0400
commit16b9057804c02e2d351e9c8f606e909b43cbd9e7 (patch)
treea3ac6e1d9d57a8abf4267e5ead3f2de1309335eb /fs/fat
parent5c02c392cd2320e8d612376d6b72b6548a680923 (diff)
parentc2338f2dc7c1e9f6202f370c64ffd7f44f3d4b51 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs updates from Al Viro: "This the bunch that sat in -next + lock_parent() fix. This is the minimal set; there's more pending stuff. In particular, I really hope to get acct.c fixes merged this cycle - we need that to deal sanely with delayed-mntput stuff. In the next pile, hopefully - that series is fairly short and localized (kernel/acct.c, fs/super.c and fs/namespace.c). In this pile: more iov_iter work. Most of prereqs for ->splice_write with sane locking order are there and Kent's dio rewrite would also fit nicely on top of this pile" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (70 commits) lock_parent: don't step on stale ->d_parent of all-but-freed one kill generic_file_splice_write() ceph: switch to iter_file_splice_write() shmem: switch to iter_file_splice_write() nfs: switch to iter_splice_write_file() fs/splice.c: remove unneeded exports ocfs2: switch to iter_file_splice_write() ->splice_write() via ->write_iter() bio_vec-backed iov_iter optimize copy_page_{to,from}_iter() bury generic_file_aio_{read,write} lustre: get rid of messing with iovecs ceph: switch to ->write_iter() ceph_sync_direct_write: stop poking into iov_iter guts ceph_sync_read: stop poking into iov_iter guts new helper: copy_page_from_iter() fuse: switch to ->write_iter() btrfs: switch to ->write_iter() ocfs2: switch to ->write_iter() xfs: switch to ->write_iter() ...
Diffstat (limited to 'fs/fat')
-rw-r--r--fs/fat/file.c8
-rw-r--r--fs/fat/inode.c12
2 files changed, 10 insertions, 10 deletions
diff --git a/fs/fat/file.c b/fs/fat/file.c
index 9b104f543056..85f79a89e747 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -170,10 +170,10 @@ int fat_file_fsync(struct file *filp, loff_t start, loff_t end, int datasync)
170 170
171const struct file_operations fat_file_operations = { 171const struct file_operations fat_file_operations = {
172 .llseek = generic_file_llseek, 172 .llseek = generic_file_llseek,
173 .read = do_sync_read, 173 .read = new_sync_read,
174 .write = do_sync_write, 174 .write = new_sync_write,
175 .aio_read = generic_file_aio_read, 175 .read_iter = generic_file_read_iter,
176 .aio_write = generic_file_aio_write, 176 .write_iter = generic_file_write_iter,
177 .mmap = generic_file_mmap, 177 .mmap = generic_file_mmap,
178 .release = fat_file_release, 178 .release = fat_file_release,
179 .unlocked_ioctl = fat_generic_ioctl, 179 .unlocked_ioctl = fat_generic_ioctl,
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 9c83594d7fb5..756aead10d96 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -247,12 +247,13 @@ static int fat_write_end(struct file *file, struct address_space *mapping,
247} 247}
248 248
249static ssize_t fat_direct_IO(int rw, struct kiocb *iocb, 249static ssize_t fat_direct_IO(int rw, struct kiocb *iocb,
250 const struct iovec *iov, 250 struct iov_iter *iter,
251 loff_t offset, unsigned long nr_segs) 251 loff_t offset)
252{ 252{
253 struct file *file = iocb->ki_filp; 253 struct file *file = iocb->ki_filp;
254 struct address_space *mapping = file->f_mapping; 254 struct address_space *mapping = file->f_mapping;
255 struct inode *inode = mapping->host; 255 struct inode *inode = mapping->host;
256 size_t count = iov_iter_count(iter);
256 ssize_t ret; 257 ssize_t ret;
257 258
258 if (rw == WRITE) { 259 if (rw == WRITE) {
@@ -265,7 +266,7 @@ static ssize_t fat_direct_IO(int rw, struct kiocb *iocb,
265 * 266 *
266 * Return 0, and fallback to normal buffered write. 267 * Return 0, and fallback to normal buffered write.
267 */ 268 */
268 loff_t size = offset + iov_length(iov, nr_segs); 269 loff_t size = offset + count;
269 if (MSDOS_I(inode)->mmu_private < size) 270 if (MSDOS_I(inode)->mmu_private < size)
270 return 0; 271 return 0;
271 } 272 }
@@ -274,10 +275,9 @@ static ssize_t fat_direct_IO(int rw, struct kiocb *iocb,
274 * FAT need to use the DIO_LOCKING for avoiding the race 275 * FAT need to use the DIO_LOCKING for avoiding the race
275 * condition of fat_get_block() and ->truncate(). 276 * condition of fat_get_block() and ->truncate().
276 */ 277 */
277 ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, 278 ret = blockdev_direct_IO(rw, iocb, inode, iter, offset, fat_get_block);
278 fat_get_block);
279 if (ret < 0 && (rw & WRITE)) 279 if (ret < 0 && (rw & WRITE))
280 fat_write_failed(mapping, offset + iov_length(iov, nr_segs)); 280 fat_write_failed(mapping, offset + count);
281 281
282 return ret; 282 return ret;
283} 283}