linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: Jan Kara <jack@suse.com>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	linux-fsdevel@vger.kernel.org
Subject: [PATCH 1/7] udf: Convert udf_symlink_filler() to use a folio
Date: Wed, 17 Apr 2024 16:04:07 +0100	[thread overview]
Message-ID: <20240417150416.752929-2-willy@infradead.org> (raw)
In-Reply-To: <20240417150416.752929-1-willy@infradead.org>

Remove the conversion to struct page and use folio APIs throughout.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/udf/symlink.c | 22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/fs/udf/symlink.c b/fs/udf/symlink.c
index f7eaf7b14594..0105e7e2ba3d 100644
--- a/fs/udf/symlink.c
+++ b/fs/udf/symlink.c
@@ -99,18 +99,17 @@ static int udf_pc_to_char(struct super_block *sb, unsigned char *from,
 
 static int udf_symlink_filler(struct file *file, struct folio *folio)
 {
-	struct page *page = &folio->page;
-	struct inode *inode = page->mapping->host;
+	struct inode *inode = folio->mapping->host;
 	struct buffer_head *bh = NULL;
 	unsigned char *symlink;
 	int err = 0;
-	unsigned char *p = page_address(page);
+	unsigned char *p = folio_address(folio);
 	struct udf_inode_info *iinfo = UDF_I(inode);
 
 	/* We don't support symlinks longer than one block */
 	if (inode->i_size > inode->i_sb->s_blocksize) {
 		err = -ENAMETOOLONG;
-		goto out_unlock;
+		goto out;
 	}
 
 	if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
@@ -120,24 +119,15 @@ static int udf_symlink_filler(struct file *file, struct folio *folio)
 		if (!bh) {
 			if (!err)
 				err = -EFSCORRUPTED;
-			goto out_err;
+			goto out;
 		}
 		symlink = bh->b_data;
 	}
 
 	err = udf_pc_to_char(inode->i_sb, symlink, inode->i_size, p, PAGE_SIZE);
 	brelse(bh);
-	if (err)
-		goto out_err;
-
-	SetPageUptodate(page);
-	unlock_page(page);
-	return 0;
-
-out_err:
-	SetPageError(page);
-out_unlock:
-	unlock_page(page);
+out:
+	folio_end_read(folio, err == 0);
 	return err;
 }
 
-- 
2.43.0


  reply	other threads:[~2024-04-17 15:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17 15:04 [PATCH 0/7] Convert UDF to folios Matthew Wilcox (Oracle)
2024-04-17 15:04 ` Matthew Wilcox (Oracle) [this message]
2024-04-18 10:37   ` [PATCH 1/7] udf: Convert udf_symlink_filler() to use a folio Jan Kara
2024-04-18 12:27     ` Matthew Wilcox
2024-04-17 15:04 ` [PATCH 2/7] udf: Convert udf_write_begin() " Matthew Wilcox (Oracle)
2024-04-17 15:04 ` [PATCH 3/7] udf: Convert udf_expand_file_adinicb() " Matthew Wilcox (Oracle)
2024-04-18 10:44   ` Jan Kara
2024-04-17 15:04 ` [PATCH 4/7] udf: Convert udf_adinicb_readpage() to udf_adinicb_read_folio() Matthew Wilcox (Oracle)
2024-04-18 10:50   ` Jan Kara
2024-04-18 12:29     ` Matthew Wilcox
2024-04-19  8:50       ` Jan Kara
2024-04-17 15:04 ` [PATCH 5/7] udf: Convert udf_symlink_getattr() to use a folio Matthew Wilcox (Oracle)
2024-04-17 15:04 ` [PATCH 6/7] udf: Convert udf_page_mkwrite() " Matthew Wilcox (Oracle)
2024-04-17 15:04 ` [PATCH 7/7] udf: Use a folio in udf_write_end() Matthew Wilcox (Oracle)
2024-04-18 10:53 ` [PATCH 0/7] Convert UDF to folios Jan Kara
2024-04-23 13:44   ` 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=20240417150416.752929-2-willy@infradead.org \
    --to=willy@infradead.org \
    --cc=jack@suse.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /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).