linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Bean Huo <beanhuo@iokpp.de>
Cc: viro@zeniv.linux.org.uk, brauner@kernel.org,
	akpm@linux-foundation.org, jack@suse.cz, jack@suse.com,
	tytso@mit.edu, adilger.kernel@dilger.ca, mark@fasheh.com,
	jlbec@evilplan.org, joseph.qi@linux.alibaba.com,
	linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com,
	beanhuo@micron.com
Subject: Re: [PATCH v1 1/5] fs/buffer: clean up block_commit_write
Date: Mon, 19 Jun 2023 11:52:30 +0200	[thread overview]
Message-ID: <20230619095230.undchckir57stooe@quack3> (raw)
In-Reply-To: <20230618213250.694110-2-beanhuo@iokpp.de>

On Sun 18-06-23 23:32:46, 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, this patch is to
> remove inode and clean up block_commit_write.
> 
> Signed-off-by: Bean Huo <beanhuo@micron.com>

Nice! Feel free to add:

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

								Honza

> ---
>  fs/buffer.c | 15 +++------------
>  1 file changed, 3 insertions(+), 12 deletions(-)
> 
> 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
> -- 
> 2.34.1
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2023-06-19  9:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-18 21:32 [PATCH v1 0/5] clean up block_commit_write Bean Huo
2023-06-18 21:32 ` [PATCH v1 1/5] fs/buffer: " Bean Huo
2023-06-19  9:52   ` Jan Kara [this message]
2023-06-18 21:32 ` [PATCH v1 2/5] fs/buffer.c: convert block_commit_write to return void Bean Huo
2023-06-18 23:35   ` kernel test robot
2023-06-19  9:56   ` Jan Kara
2023-06-19 10:42     ` Bean Huo
2023-06-18 21:32 ` [PATCH v1 3/5] ext4: No need to check return value of block_commit_write() Bean Huo
2023-06-19  9:56   ` Jan Kara
2023-06-18 21:32 ` [PATCH v1 4/5] fs/ocfs2: " Bean Huo
2023-06-19  9:56   ` Jan Kara
2023-06-18 21:32 ` [PATCH v1 5/5] udf: " Bean Huo
2023-06-19  9:56   ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230619095230.undchckir57stooe@quack3 \
    --to=jack@suse.cz \
    --cc=adilger.kernel@dilger.ca \
    --cc=akpm@linux-foundation.org \
    --cc=beanhuo@iokpp.de \
    --cc=beanhuo@micron.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.com \
    --cc=jlbec@evilplan.org \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@fasheh.com \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).