diff mbox series

[v2,1/5] fs/buffer: clean up block_commit_write

Message ID 20230619211827.707054-2-beanhuo@iokpp.de
State Superseded
Headers show
Series clean up block_commit_write | expand

Commit Message

Bean Huo June 19, 2023, 9:18 p.m. UTC
From: Bean Huo <beanhuo@micron.com>

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

Signed-off-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Jan Kara <jack@suse.cz>
---
 fs/buffer.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

Comments

Christoph Hellwig June 20, 2023, 4:47 a.m. UTC | #1
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox June 20, 2023, 5:33 a.m. UTC | #2
On Mon, Jun 19, 2023 at 11:18:23PM +0200, Bean Huo wrote:
> +++ b/fs/buffer.c
> @@ -2116,8 +2116,7 @@ int __block_write_begin(struct page *page, loff_t pos, unsigned len,
>  }
>  EXPORT_SYMBOL(__block_write_begin);
>  
> -static int __block_commit_write(struct inode *inode, struct page *page,
> -		unsigned from, unsigned to)
> +int block_commit_write(struct page *page, unsigned int from, unsigned int to)
>  {
>  	unsigned block_start, block_end;
>  	int partial = 0;

You're going to need to redo these patches, I'm afraid.  A series of
patches I wrote just went in that convert __block_commit_write (but
not block_commit_write) to take a folio instead of a page.
Bean Huo June 20, 2023, 10:57 a.m. UTC | #3
On Tue, 2023-06-20 at 06:33 +0100, Matthew Wilcox wrote:
> You're going to need to redo these patches, I'm afraid.  A series of
> patches I wrote just went in that convert __block_commit_write (but
> not block_commit_write) to take a folio instead of a page.

Do you know which git repo merged with your patches?
Matthew Wilcox June 20, 2023, 12:19 p.m. UTC | #4
On Tue, Jun 20, 2023 at 12:57:11PM +0200, Bean Huo wrote:
> On Tue, 2023-06-20 at 06:33 +0100, Matthew Wilcox wrote:
> > You're going to need to redo these patches, I'm afraid.  A series of
> > patches I wrote just went in that convert __block_commit_write (but
> > not block_commit_write) to take a folio instead of a page.
> 
> Do you know which git repo merged with your patches? 

They're in git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
It's usually easiest to just work against
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next
diff mbox series

Patch

diff --git a/fs/buffer.c b/fs/buffer.c
index a7fc561758b1..b88bb7ec38be 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2116,8 +2116,7 @@  int __block_write_begin(struct page *page, loff_t pos, unsigned len,
 }
 EXPORT_SYMBOL(__block_write_begin);
 
-static int __block_commit_write(struct inode *inode, struct page *page,
-		unsigned from, unsigned to)
+int block_commit_write(struct page *page, unsigned int from, unsigned int to)
 {
 	unsigned block_start, block_end;
 	int partial = 0;
@@ -2154,6 +2153,7 @@  static int __block_commit_write(struct inode *inode, struct page *page,
 		SetPageUptodate(page);
 	return 0;
 }
+EXPORT_SYMBOL(block_commit_write);
 
 /*
  * block_write_begin takes care of the basic task of block allocation and
@@ -2188,7 +2188,6 @@  int block_write_end(struct file *file, struct address_space *mapping,
 			loff_t pos, unsigned len, unsigned copied,
 			struct page *page, void *fsdata)
 {
-	struct inode *inode = mapping->host;
 	unsigned start;
 
 	start = pos & (PAGE_SIZE - 1);
@@ -2214,7 +2213,7 @@  int block_write_end(struct file *file, struct address_space *mapping,
 	flush_dcache_page(page);
 
 	/* This could be a short (even 0-length) commit */
-	__block_commit_write(inode, page, start, start+copied);
+	block_commit_write(page, start, start+copied);
 
 	return copied;
 }
@@ -2535,14 +2534,6 @@  int cont_write_begin(struct file *file, struct address_space *mapping,
 }
 EXPORT_SYMBOL(cont_write_begin);
 
-int block_commit_write(struct page *page, unsigned from, unsigned to)
-{
-	struct inode *inode = page->mapping->host;
-	__block_commit_write(inode,page,from,to);
-	return 0;
-}
-EXPORT_SYMBOL(block_commit_write);
-
 /*
  * block_page_mkwrite() is not allowed to change the file size as it gets
  * called from a page fault handler when a page is first dirtied. Hence we must