Commit 3e679dc7 authored by Eric Biggers's avatar Eric Biggers Committed by Jaegeuk Kim

f2fs: make f2fs_write_failed() take struct inode

Make f2fs_write_failed() take a 'struct inode' directly rather than a
'struct address_space', as this simplifies it slightly.
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 9de71ede
...@@ -3178,9 +3178,8 @@ static int f2fs_write_data_pages(struct address_space *mapping, ...@@ -3178,9 +3178,8 @@ static int f2fs_write_data_pages(struct address_space *mapping,
FS_CP_DATA_IO : FS_DATA_IO); 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); loff_t i_size = i_size_read(inode);
if (IS_NOQUOTA(inode)) if (IS_NOQUOTA(inode))
...@@ -3412,7 +3411,7 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping, ...@@ -3412,7 +3411,7 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,
fail: fail:
f2fs_put_page(page, 1); f2fs_put_page(page, 1);
f2fs_write_failed(mapping, pos + len); f2fs_write_failed(inode, pos + len);
if (drop_atomic) if (drop_atomic)
f2fs_drop_inmem_pages_all(sbi, false); f2fs_drop_inmem_pages_all(sbi, false);
return err; return err;
...@@ -3602,7 +3601,7 @@ static ssize_t f2fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter) ...@@ -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, f2fs_update_iostat(F2FS_I_SB(inode), APP_DIRECT_IO,
count - iov_iter_count(iter)); count - iov_iter_count(iter));
} else if (err < 0) { } else if (err < 0) {
f2fs_write_failed(mapping, offset + count); f2fs_write_failed(inode, offset + count);
} }
} else { } else {
if (err > 0) if (err > 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment