diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-12 13:30:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-12 13:30:18 -0400 |
commit | 16b9057804c02e2d351e9c8f606e909b43cbd9e7 (patch) | |
tree | a3ac6e1d9d57a8abf4267e5ead3f2de1309335eb /fs/ubifs/file.c | |
parent | 5c02c392cd2320e8d612376d6b72b6548a680923 (diff) | |
parent | c2338f2dc7c1e9f6202f370c64ffd7f44f3d4b51 (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/ubifs/file.c')
-rw-r--r-- | fs/ubifs/file.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index 0ab7f7dfb98b..b5b593c45270 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c | |||
@@ -1364,17 +1364,17 @@ static inline int mctime_update_needed(const struct inode *inode, | |||
1364 | 1364 | ||
1365 | /** | 1365 | /** |
1366 | * update_ctime - update mtime and ctime of an inode. | 1366 | * update_ctime - update mtime and ctime of an inode. |
1367 | * @c: UBIFS file-system description object | ||
1368 | * @inode: inode to update | 1367 | * @inode: inode to update |
1369 | * | 1368 | * |
1370 | * This function updates mtime and ctime of the inode if it is not equivalent to | 1369 | * This function updates mtime and ctime of the inode if it is not equivalent to |
1371 | * current time. Returns zero in case of success and a negative error code in | 1370 | * current time. Returns zero in case of success and a negative error code in |
1372 | * case of failure. | 1371 | * case of failure. |
1373 | */ | 1372 | */ |
1374 | static int update_mctime(struct ubifs_info *c, struct inode *inode) | 1373 | static int update_mctime(struct inode *inode) |
1375 | { | 1374 | { |
1376 | struct timespec now = ubifs_current_time(inode); | 1375 | struct timespec now = ubifs_current_time(inode); |
1377 | struct ubifs_inode *ui = ubifs_inode(inode); | 1376 | struct ubifs_inode *ui = ubifs_inode(inode); |
1377 | struct ubifs_info *c = inode->i_sb->s_fs_info; | ||
1378 | 1378 | ||
1379 | if (mctime_update_needed(inode, &now)) { | 1379 | if (mctime_update_needed(inode, &now)) { |
1380 | int err, release; | 1380 | int err, release; |
@@ -1397,18 +1397,13 @@ static int update_mctime(struct ubifs_info *c, struct inode *inode) | |||
1397 | return 0; | 1397 | return 0; |
1398 | } | 1398 | } |
1399 | 1399 | ||
1400 | static ssize_t ubifs_aio_write(struct kiocb *iocb, const struct iovec *iov, | 1400 | static ssize_t ubifs_write_iter(struct kiocb *iocb, struct iov_iter *from) |
1401 | unsigned long nr_segs, loff_t pos) | ||
1402 | { | 1401 | { |
1403 | int err; | 1402 | int err = update_mctime(file_inode(iocb->ki_filp)); |
1404 | struct inode *inode = iocb->ki_filp->f_mapping->host; | ||
1405 | struct ubifs_info *c = inode->i_sb->s_fs_info; | ||
1406 | |||
1407 | err = update_mctime(c, inode); | ||
1408 | if (err) | 1403 | if (err) |
1409 | return err; | 1404 | return err; |
1410 | 1405 | ||
1411 | return generic_file_aio_write(iocb, iov, nr_segs, pos); | 1406 | return generic_file_write_iter(iocb, from); |
1412 | } | 1407 | } |
1413 | 1408 | ||
1414 | static int ubifs_set_page_dirty(struct page *page) | 1409 | static int ubifs_set_page_dirty(struct page *page) |
@@ -1582,15 +1577,15 @@ const struct inode_operations ubifs_symlink_inode_operations = { | |||
1582 | 1577 | ||
1583 | const struct file_operations ubifs_file_operations = { | 1578 | const struct file_operations ubifs_file_operations = { |
1584 | .llseek = generic_file_llseek, | 1579 | .llseek = generic_file_llseek, |
1585 | .read = do_sync_read, | 1580 | .read = new_sync_read, |
1586 | .write = do_sync_write, | 1581 | .write = new_sync_write, |
1587 | .aio_read = generic_file_aio_read, | 1582 | .read_iter = generic_file_read_iter, |
1588 | .aio_write = ubifs_aio_write, | 1583 | .write_iter = ubifs_write_iter, |
1589 | .mmap = ubifs_file_mmap, | 1584 | .mmap = ubifs_file_mmap, |
1590 | .fsync = ubifs_fsync, | 1585 | .fsync = ubifs_fsync, |
1591 | .unlocked_ioctl = ubifs_ioctl, | 1586 | .unlocked_ioctl = ubifs_ioctl, |
1592 | .splice_read = generic_file_splice_read, | 1587 | .splice_read = generic_file_splice_read, |
1593 | .splice_write = generic_file_splice_write, | 1588 | .splice_write = iter_file_splice_write, |
1594 | #ifdef CONFIG_COMPAT | 1589 | #ifdef CONFIG_COMPAT |
1595 | .compat_ioctl = ubifs_compat_ioctl, | 1590 | .compat_ioctl = ubifs_compat_ioctl, |
1596 | #endif | 1591 | #endif |