From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: linux-fsdevel@vger.kernel.org
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
linux-mm@kvack.org, "Theodore Ts'o" <tytso@mit.edu>,
Andreas Dilger <adilger.kernel@dilger.ca>,
linux-ext4@vger.kernel.org
Subject: [PATCH v3 11/18] ext4: Tell the VFS that readpage was synchronous
Date: Fri, 16 Oct 2020 17:04:36 +0100 [thread overview]
Message-ID: <20201016160443.18685-12-willy@infradead.org> (raw)
In-Reply-To: <20201016160443.18685-1-willy@infradead.org>
The ext4 inline data readpage implementation was already synchronous,
so use AOP_UPDATED_PAGE to avoid cycling the page lock.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
fs/ext4/inline.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
index 75c97bca0815..2a489243e4de 100644
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
@@ -490,7 +490,8 @@ static int ext4_read_inline_page(struct inode *inode, struct page *page)
zero_user_segment(page, len, PAGE_SIZE);
SetPageUptodate(page);
brelse(iloc.bh);
-
+ if (ret >= 0)
+ return AOP_UPDATED_PAGE;
out:
return ret;
}
@@ -514,12 +515,14 @@ int ext4_readpage_inline(struct inode *inode, struct page *page)
else if (!PageUptodate(page)) {
zero_user_segment(page, 0, PAGE_SIZE);
SetPageUptodate(page);
+ ret = AOP_UPDATED_PAGE;
}
up_read(&EXT4_I(inode)->xattr_sem);
- unlock_page(page);
- return ret >= 0 ? 0 : ret;
+ if (ret < 0)
+ unlock_page(page);
+ return ret;
}
static int ext4_convert_inline_data_to_extent(struct address_space *mapping,
--
2.28.0
next prev parent reply other threads:[~2020-10-16 16:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-16 16:04 [PATCH v3 00/18] Allow readpage to return a locked page Matthew Wilcox (Oracle)
2020-10-16 16:04 ` Matthew Wilcox (Oracle) [this message]
2020-10-18 14:24 ` [PATCH v3 11/18] ext4: Tell the VFS that readpage was synchronous Theodore Y. Ts'o
2020-10-16 16:04 ` [PATCH v3 12/18] ext4: Return error from ext4_readpage Matthew Wilcox (Oracle)
2020-10-18 14:25 ` Theodore Y. Ts'o
2020-10-18 15:04 ` Matthew Wilcox
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=20201016160443.18685-12-willy@infradead.org \
--to=willy@infradead.org \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=tytso@mit.edu \
/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).