diff options
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 |