diff mbox series

[RESEND,v3,1/2] fs/buffer: clean up block_commit_write

Message ID 20230626055518.842392-2-beanhuo@iokpp.de (mailing list archive)
State New, archived
Headers show
Series clean up block_commit_write | expand

Commit Message

Bean Huo June 26, 2023, 5:55 a.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.

Signed-off-by: Bean Huo <beanhuo@micron.com>
---
 fs/buffer.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Christoph Hellwig June 26, 2023, 7:55 a.m. UTC | #1
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox June 26, 2023, 12:21 p.m. UTC | #2
On Mon, Jun 26, 2023 at 07:55:17AM +0200, Bean Huo wrote:
> 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.

Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>

I'm expecting that Andrew will pick up these patches.  Unfortunately,
you've sent them right at the beginning of the merge window, so I
wouldn't expect that they'll be picked up for two weeks.
Jan Kara June 26, 2023, 1:41 p.m. UTC | #3
On Mon 26-06-23 07:55:17, Bean Huo wrote:
> 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.
> 
> Signed-off-by: Bean Huo <beanhuo@micron.com>

Looks good to me. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/buffer.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/buffer.c b/fs/buffer.c
> index bd091329026c..50821dfb02f7 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -2180,8 +2180,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 folio *folio,
> -		size_t from, size_t to)
> +static int __block_commit_write(struct folio *folio, size_t from, size_t to)
>  {
>  	size_t block_start, block_end;
>  	bool partial = false;
> @@ -2277,7 +2276,7 @@ int block_write_end(struct file *file, struct address_space *mapping,
>  	flush_dcache_folio(folio);
>  
>  	/* 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;
>  }
> @@ -2601,8 +2600,7 @@ EXPORT_SYMBOL(cont_write_begin);
>  int block_commit_write(struct page *page, unsigned from, unsigned to)
>  {
>  	struct folio *folio = page_folio(page);
> -	struct inode *inode = folio->mapping->host;
> -	__block_commit_write(inode, folio, from, to);
> +	__block_commit_write(folio, from, to);
>  	return 0;
>  }
>  EXPORT_SYMBOL(block_commit_write);
> @@ -2650,7 +2648,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);
>  	if (!ret)
> -		ret = __block_commit_write(inode, folio, 0, end);
> +		ret = __block_commit_write(folio, 0, end);
>  
>  	if (unlikely(ret < 0))
>  		goto out_unlock;
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/fs/buffer.c b/fs/buffer.c
index bd091329026c..50821dfb02f7 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2180,8 +2180,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 folio *folio,
-		size_t from, size_t to)
+static int __block_commit_write(struct folio *folio, size_t from, size_t to)
 {
 	size_t block_start, block_end;
 	bool partial = false;
@@ -2277,7 +2276,7 @@  int block_write_end(struct file *file, struct address_space *mapping,
 	flush_dcache_folio(folio);
 
 	/* 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;
 }
@@ -2601,8 +2600,7 @@  EXPORT_SYMBOL(cont_write_begin);
 int block_commit_write(struct page *page, unsigned from, unsigned to)
 {
 	struct folio *folio = page_folio(page);
-	struct inode *inode = folio->mapping->host;
-	__block_commit_write(inode, folio, from, to);
+	__block_commit_write(folio, from, to);
 	return 0;
 }
 EXPORT_SYMBOL(block_commit_write);
@@ -2650,7 +2648,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);
 	if (!ret)
-		ret = __block_commit_write(inode, folio, 0, end);
+		ret = __block_commit_write(folio, 0, end);
 
 	if (unlikely(ret < 0))
 		goto out_unlock;