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

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
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -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 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,

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)