Linux-Fsdevel Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruenba@redhat.com>
To: cluster-devel@redhat.com, Christoph Hellwig <hch@lst.de>
Cc: Andreas Gruenbacher <agruenba@redhat.com>, linux-fsdevel@vger.kernel.org
Subject: [PATCH 05/10] gfs2: gfs2_stuffed_write_end cleanup (fixup)
Date: Thu, 11 Jan 2018 22:14:59 +0100	[thread overview]
Message-ID: <20180111211506.328-6-agruenba@redhat.com> (raw)
In-Reply-To: <20180111211506.328-1-agruenba@redhat.com>

Revert "Third, make the page argument optional".
---
 fs/gfs2/aops.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index aa2031ff82c8..37410293c1f8 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -815,7 +815,7 @@ static void adjust_fs_space(struct inode *inode)
  * @dibh: The buffer_head containing the on-disk inode
  * @pos: The file position
  * @copied: How much was actually copied by the VFS
- * @page: The (optional) page
+ * @page: The page
  *
  * This copies the data from the page into the inode block after
  * the inode data structure itself.
@@ -830,29 +830,15 @@ static int gfs2_stuffed_write_end(struct inode *inode, struct buffer_head *dibh,
 	u64 to = pos + copied;
 	void *kaddr;
 	unsigned char *buf = dibh->b_data + sizeof(struct gfs2_dinode);
-	bool page_grabbed = false;
 
 	BUG_ON(pos + copied > gfs2_max_stuffed_size(ip));
 
-	if (!page) {
-		page = find_lock_page(inode->i_mapping, 0);
-		if (WARN_ON(!page))
-			return -ENOMEM;
-		page_grabbed = true;
-	}
-
 	kaddr = kmap_atomic(page);
 	memcpy(buf + pos, kaddr + pos, copied);
 	flush_dcache_page(page);
 	kunmap_atomic(kaddr);
 
 	WARN_ON(!PageUptodate(page));
-
-	if (page_grabbed) {
-		unlock_page(page);
-		put_page(page);
-	}
-
 	if (copied) {
 		if (inode->i_size < to)
 			i_size_write(inode, to);
-- 
2.14.3

  parent reply	other threads:[~2018-01-11 21:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-11 21:14 [PATCH 00/10] gfs2 iomap buffered write support Andreas Gruenbacher
2018-01-11 21:14 ` [PATCH 01/10] gfs2: Typo fixes Andreas Gruenbacher
2018-01-11 21:14 ` [PATCH 02/10] gfs2: Add gfs2_max_stuffed_size Andreas Gruenbacher
2018-01-11 21:14 ` [PATCH 03/10] gfs2: Minor gfs2_page_add_databufs cleanup Andreas Gruenbacher
2018-01-11 21:14 ` [PATCH 04/10] gfs2: gfs2_stuffed_write_end cleanup Andreas Gruenbacher
2018-01-11 21:14 ` Andreas Gruenbacher [this message]
2018-01-11 21:15 ` [PATCH 06/10] gfs2: Remove ordered write mode handling from gfs2_trans_add_data Andreas Gruenbacher
2018-01-11 21:15 ` [PATCH 07/10] gfs2: Iomap cleanups and improvements Andreas Gruenbacher
2018-01-11 21:15 ` [PATCH 08/10] iomap: New iomap_written operation Andreas Gruenbacher
2018-01-11 21:53   ` Dave Chinner
2018-01-11 21:15 ` [PATCH 09/10] gfs2: Implement buffered iomap write support (1) Andreas Gruenbacher
2018-01-11 21:19   ` Andreas Grünbacher
2018-01-11 21:15 ` [PATCH 09/10] gfs2: Implement iomap buffered " Andreas Gruenbacher
2018-01-11 21:15 ` [PATCH 10/10] gfs2: Implement buffered iomap write support (2) Andreas Gruenbacher
2018-01-11 21:20   ` Andreas Gruenbacher
2018-01-11 21:15 ` [PATCH 10/10] gfs2: Implement iomap buffered " Andreas Gruenbacher
2018-01-12 10:26 ` [Cluster-devel] [PATCH 00/10] gfs2 iomap buffered write support Steven Whitehouse

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=20180111211506.328-6-agruenba@redhat.com \
    --to=agruenba@redhat.com \
    --cc=cluster-devel@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --subject='Re: [PATCH 05/10] gfs2: gfs2_stuffed_write_end cleanup (fixup)' \
    /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

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).