aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/ubifs/file.c19
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 */
1373static int update_mctime(struct ubifs_info *c, struct inode *inode) 1372static 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
1399static ssize_t ubifs_aio_write(struct kiocb *iocb, const struct iovec *iov, 1399static 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
1413static int ubifs_set_page_dirty(struct page *page) 1408static int ubifs_set_page_dirty(struct page *page)
@@ -1583,9 +1578,9 @@ const struct inode_operations ubifs_symlink_inode_operations = {
1583const struct file_operations ubifs_file_operations = { 1578const 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,