f2fs: make f2fs_write_failed() take struct inode
authorEric Biggers <ebiggers@google.com>
Fri, 16 Jul 2021 14:39:11 +0000 (09:39 -0500)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sun, 25 Jul 2021 15:42:31 +0000 (08:42 -0700)
Make f2fs_write_failed() take a 'struct inode' directly rather than a
'struct address_space', as this simplifies it slightly.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c

index ba120d5..1803c68 100644 (file)
@@ -3178,9 +3178,8 @@ static int f2fs_write_data_pages(struct address_space *mapping,
                        FS_CP_DATA_IO : FS_DATA_IO);
 }
 
-static void f2fs_write_failed(struct address_space *mapping, loff_t to)
+static void f2fs_write_failed(struct inode *inode, loff_t to)
 {
-       struct inode *inode = mapping->host;
        loff_t i_size = i_size_read(inode);
 
        if (IS_NOQUOTA(inode))
@@ -3412,7 +3411,7 @@ repeat:
 
 fail:
        f2fs_put_page(page, 1);
-       f2fs_write_failed(mapping, pos + len);
+       f2fs_write_failed(inode, pos + len);
        if (drop_atomic)
                f2fs_drop_inmem_pages_all(sbi, false);
        return err;
@@ -3602,7 +3601,7 @@ static ssize_t f2fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
                        f2fs_update_iostat(F2FS_I_SB(inode), APP_DIRECT_IO,
                                                count - iov_iter_count(iter));
                } else if (err < 0) {
-                       f2fs_write_failed(mapping, offset + count);
+                       f2fs_write_failed(inode, offset + count);
                }
        } else {
                if (err > 0)