diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-04-03 14:00:23 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-05-06 17:39:38 -0400 |
commit | f5674c31ee1f968606702e82c160d6ae11032ded (patch) | |
tree | 97e0411ced6cd406b73818261f6ccf6c15d1de70 /fs/ubifs | |
parent | a8f3550cd228b6edc5d17fce1a9af8cc7004f185 (diff) |
ubifs: switch to ->write_iter()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ubifs')
-rw-r--r-- | fs/ubifs/file.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index ab721529c57c..6bc4e8efbccf 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c | |||
@@ -1363,17 +1363,17 @@ static inline int mctime_update_needed(const struct inode *inode, | |||
1363 | 1363 | ||
1364 | /** | 1364 | /** |
1365 | * update_ctime - update mtime and ctime of an inode. | 1365 | * update_ctime - update mtime and ctime of an inode. |
1366 | * @c: UBIFS file-system description object | ||
1367 | * @inode: inode to update | 1366 | * @inode: inode to update |
1368 | * | 1367 | * |
1369 | * This function updates mtime and ctime of the inode if it is not equivalent to | 1368 | * This function updates mtime and ctime of the inode if it is not equivalent to |
1370 | * current time. Returns zero in case of success and a negative error code in | 1369 | * current time. Returns zero in case of success and a negative error code in |
1371 | * case of failure. | 1370 | * case of failure. |
1372 | */ | 1371 | */ |
1373 | static int update_mctime(struct ubifs_info *c, struct inode *inode) | 1372 | static int update_mctime(struct inode *inode) |
1374 | { | 1373 | { |
1375 | struct timespec now = ubifs_current_time(inode); | 1374 | struct timespec now = ubifs_current_time(inode); |
1376 | struct ubifs_inode *ui = ubifs_inode(inode); | 1375 | struct ubifs_inode *ui = ubifs_inode(inode); |
1376 | struct ubifs_info *c = inode->i_sb->s_fs_info; | ||
1377 | 1377 | ||
1378 | if (mctime_update_needed(inode, &now)) { | 1378 | if (mctime_update_needed(inode, &now)) { |
1379 | int err, release; | 1379 | int err, release; |
@@ -1396,18 +1396,13 @@ static int update_mctime(struct ubifs_info *c, struct inode *inode) | |||
1396 | return 0; | 1396 | return 0; |
1397 | } | 1397 | } |
1398 | 1398 | ||
1399 | static ssize_t ubifs_aio_write(struct kiocb *iocb, const struct iovec *iov, | 1399 | static ssize_t ubifs_write_iter(struct kiocb *iocb, struct iov_iter *from) |
1400 | unsigned long nr_segs, loff_t pos) | ||
1401 | { | 1400 | { |
1402 | int err; | 1401 | int err = update_mctime(file_inode(iocb->ki_filp)); |
1403 | struct inode *inode = iocb->ki_filp->f_mapping->host; | ||
1404 | struct ubifs_info *c = inode->i_sb->s_fs_info; | ||
1405 | |||
1406 | err = update_mctime(c, inode); | ||
1407 | if (err) | 1402 | if (err) |
1408 | return err; | 1403 | return err; |
1409 | 1404 | ||
1410 | return generic_file_aio_write(iocb, iov, nr_segs, pos); | 1405 | return generic_file_write_iter(iocb, from); |
1411 | } | 1406 | } |
1412 | 1407 | ||
1413 | static int ubifs_set_page_dirty(struct page *page) | 1408 | static int ubifs_set_page_dirty(struct page *page) |
@@ -1583,9 +1578,9 @@ const struct inode_operations ubifs_symlink_inode_operations = { | |||
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 = new_sync_read, | 1580 | .read = new_sync_read, |
1586 | .write = do_sync_write, | 1581 | .write = new_sync_write, |
1587 | .read_iter = generic_file_read_iter, | 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, |