Commit 489b7e72 authored by Bean Huo's avatar Bean Huo Committed by Andrew Morton

fs/buffer: clean up block_commit_write

Originally inode is used to get blksize, after commit 45bce8f3
("fs/buffer.c: make block-size be per-page and protected by the page
lock"), __block_commit_write no longer uses this parameter inode.

[akpm@linux-foundation.org: remove now-unused local `inode']
Link: https://lkml.kernel.org/r/20230626055518.842392-2-beanhuo@iokpp.deSigned-off-by: default avatarBean Huo <beanhuo@micron.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Luís Henriques <ocfs2-devel@oss.oracle.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 1a7d018d
...@@ -2180,8 +2180,7 @@ int __block_write_begin(struct page *page, loff_t pos, unsigned len, ...@@ -2180,8 +2180,7 @@ int __block_write_begin(struct page *page, loff_t pos, unsigned len,
} }
EXPORT_SYMBOL(__block_write_begin); EXPORT_SYMBOL(__block_write_begin);
static int __block_commit_write(struct inode *inode, struct folio *folio, static int __block_commit_write(struct folio *folio, size_t from, size_t to)
size_t from, size_t to)
{ {
size_t block_start, block_end; size_t block_start, block_end;
bool partial = false; bool partial = false;
...@@ -2253,7 +2252,6 @@ int block_write_end(struct file *file, struct address_space *mapping, ...@@ -2253,7 +2252,6 @@ int block_write_end(struct file *file, struct address_space *mapping,
struct page *page, void *fsdata) struct page *page, void *fsdata)
{ {
struct folio *folio = page_folio(page); struct folio *folio = page_folio(page);
struct inode *inode = mapping->host;
size_t start = pos - folio_pos(folio); size_t start = pos - folio_pos(folio);
if (unlikely(copied < len)) { if (unlikely(copied < len)) {
...@@ -2277,7 +2275,7 @@ int block_write_end(struct file *file, struct address_space *mapping, ...@@ -2277,7 +2275,7 @@ int block_write_end(struct file *file, struct address_space *mapping,
flush_dcache_folio(folio); flush_dcache_folio(folio);
/* This could be a short (even 0-length) commit */ /* This could be a short (even 0-length) commit */
__block_commit_write(inode, folio, start, start + copied); __block_commit_write(folio, start, start + copied);
return copied; return copied;
} }
...@@ -2601,8 +2599,7 @@ EXPORT_SYMBOL(cont_write_begin); ...@@ -2601,8 +2599,7 @@ EXPORT_SYMBOL(cont_write_begin);
int block_commit_write(struct page *page, unsigned from, unsigned to) int block_commit_write(struct page *page, unsigned from, unsigned to)
{ {
struct folio *folio = page_folio(page); struct folio *folio = page_folio(page);
struct inode *inode = folio->mapping->host; __block_commit_write(folio, from, to);
__block_commit_write(inode, folio, from, to);
return 0; return 0;
} }
EXPORT_SYMBOL(block_commit_write); EXPORT_SYMBOL(block_commit_write);
...@@ -2650,7 +2647,7 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, ...@@ -2650,7 +2647,7 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
ret = __block_write_begin_int(folio, 0, end, get_block, NULL); ret = __block_write_begin_int(folio, 0, end, get_block, NULL);
if (!ret) if (!ret)
ret = __block_commit_write(inode, folio, 0, end); ret = __block_commit_write(folio, 0, end);
if (unlikely(ret < 0)) if (unlikely(ret < 0))
goto out_unlock; goto out_unlock;
......
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