linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bob Peterson <rpeterso@redhat.com>
To: linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk
Cc: Andreas Gruenbacher <agruenba@redhat.com>,
	Christoph Hellwig <hch@lst.de>
Subject: [PATCH v2] fs: clean up __block_commit_write
Date: Thu, 13 Feb 2020 08:57:04 -0500 (EST)	[thread overview]
Message-ID: <1454296586.8777883.1581602224759.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1350360444.7695146.1581449194730.JavaMail.zimbra@redhat.com>

Al,

Can you add this to your tree then? (Christoph's suggestion has been implemented).

Bob

Function __block_commit_write did nothing with the inode passed in
and it always returned 0. This patch changes it to a void and gets
rid of the overhead needed to pass in the inode.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 fs/buffer.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index b8d28370cfd7..07e0a327be4a 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2059,8 +2059,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)
+static void __block_commit_write(struct page *page, unsigned from, unsigned to)
 {
 	unsigned block_start, block_end;
 	int partial = 0;
@@ -2094,7 +2093,6 @@ static int __block_commit_write(struct inode *inode, struct page *page,
 	 */
 	if (!partial)
 		SetPageUptodate(page);
-	return 0;
 }
 
 /*
@@ -2130,7 +2128,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);
@@ -2156,7 +2153,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;
 }
@@ -2469,8 +2466,7 @@ 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);
+	__block_commit_write(page, from, to);
 	return 0;
 }
 EXPORT_SYMBOL(block_commit_write);


      parent reply	other threads:[~2020-02-13 13:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1527244171.7695063.1581449058353.JavaMail.zimbra@redhat.com>
2020-02-11 19:26 ` [PATCH] fs: clean up __block_commit_write Bob Peterson
2020-02-12  7:33   ` Christoph Hellwig
2020-02-13 13:57   ` Bob Peterson [this message]

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=1454296586.8777883.1581602224759.JavaMail.zimbra@redhat.com \
    --to=rpeterso@redhat.com \
    --cc=agruenba@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --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).