linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bean Huo <beanhuo@iokpp.de>
To: 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
Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com,
	beanhuo@micron.com
Subject: [PATCH v1 2/5] fs/buffer.c: convert block_commit_write to return void
Date: Sun, 18 Jun 2023 23:32:47 +0200	[thread overview]
Message-ID: <20230618213250.694110-3-beanhuo@iokpp.de> (raw)
In-Reply-To: <20230618213250.694110-1-beanhuo@iokpp.de>

From: Bean Huo <beanhuo@micron.com>

block_commit_write() always returns 0, this patch changes it to
return void.

Signed-off-by: Bean Huo <beanhuo@micron.com>
---
 fs/buffer.c                 | 11 +++++------
 include/linux/buffer_head.h |  2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index b88bb7ec38be..fa09cf94f771 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2116,7 +2116,7 @@ int __block_write_begin(struct page *page, loff_t pos, unsigned len,
 }
 EXPORT_SYMBOL(__block_write_begin);
 
-int block_commit_write(struct page *page, unsigned int from, unsigned int to)
+void block_commit_write(struct page *page, unsigned int from, unsigned int to)
 {
 	unsigned block_start, block_end;
 	int partial = 0;
@@ -2151,7 +2151,6 @@ int block_commit_write(struct page *page, unsigned int from, unsigned int to)
 	 */
 	if (!partial)
 		SetPageUptodate(page);
-	return 0;
 }
 EXPORT_SYMBOL(block_commit_write);
 
@@ -2577,11 +2576,11 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
 		end = PAGE_SIZE;
 
 	ret = __block_write_begin(page, 0, end, get_block);
-	if (!ret)
-		ret = block_commit_write(page, 0, end);
-
-	if (unlikely(ret < 0))
+	if (unlikely(ret))
 		goto out_unlock;
+
+	block_commit_write(page, 0, end);
+
 	set_page_dirty(page);
 	wait_for_stable_page(page);
 	return 0;
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 1520793c72da..873653d2f1aa 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -284,7 +284,7 @@ int cont_write_begin(struct file *, struct address_space *, loff_t,
 			unsigned, struct page **, void **,
 			get_block_t *, loff_t *);
 int generic_cont_expand_simple(struct inode *inode, loff_t size);
-int block_commit_write(struct page *page, unsigned from, unsigned to);
+void block_commit_write(struct page *page, unsigned int from, unsigned int to);
 int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
 				get_block_t get_block);
 /* Convert errno to return value from ->page_mkwrite() call */
-- 
2.34.1


  parent reply	other threads:[~2023-06-18 21:36 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
2023-06-18 21:32 ` Bean Huo [this message]
2023-06-18 23:35   ` [PATCH v1 2/5] fs/buffer.c: convert block_commit_write to return void 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=20230618213250.694110-3-beanhuo@iokpp.de \
    --to=beanhuo@iokpp.de \
    --cc=adilger.kernel@dilger.ca \
    --cc=akpm@linux-foundation.org \
    --cc=beanhuo@micron.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.com \
    --cc=jack@suse.cz \
    --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).