From: Joanne Koong <joannelkoong@gmail.com>
To: miklos@szeredi.hu, linux-fsdevel@vger.kernel.org
Cc: josef@toxicpanda.com, bernd.schubert@fastmail.fm,
willy@infradead.org, kernel-team@meta.com
Subject: [PATCH v3 04/13] fuse: convert readlink to use folios
Date: Thu, 24 Oct 2024 10:18:00 -0700 [thread overview]
Message-ID: <20241024171809.3142801-5-joannelkoong@gmail.com> (raw)
In-Reply-To: <20241024171809.3142801-1-joannelkoong@gmail.com>
Convert readlink requests to use a folio instead of a page.
No functional changes.
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
---
fs/fuse/dir.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 54104dd48af7..a08c532068d0 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -1585,14 +1585,15 @@ static int fuse_permission(struct mnt_idmap *idmap,
return err;
}
-static int fuse_readlink_page(struct inode *inode, struct page *page)
+static int fuse_readlink_page(struct inode *inode, struct folio *folio)
{
struct fuse_mount *fm = get_fuse_mount(inode);
- struct fuse_page_desc desc = { .length = PAGE_SIZE - 1 };
+ struct fuse_folio_desc desc = { .length = PAGE_SIZE - 1 };
struct fuse_args_pages ap = {
- .num_pages = 1,
- .pages = &page,
- .descs = &desc,
+ .uses_folios = true,
+ .num_folios = 1,
+ .folios = &folio,
+ .folio_descs = &desc,
};
char *link;
ssize_t res;
@@ -1614,7 +1615,7 @@ static int fuse_readlink_page(struct inode *inode, struct page *page)
if (WARN_ON(res >= PAGE_SIZE))
return -EIO;
- link = page_address(page);
+ link = folio_address(folio);
link[res] = '\0';
return 0;
@@ -1624,7 +1625,7 @@ static const char *fuse_get_link(struct dentry *dentry, struct inode *inode,
struct delayed_call *callback)
{
struct fuse_conn *fc = get_fuse_conn(inode);
- struct page *page;
+ struct folio *folio;
int err;
err = -EIO;
@@ -1638,20 +1639,20 @@ static const char *fuse_get_link(struct dentry *dentry, struct inode *inode,
if (!dentry)
goto out_err;
- page = alloc_page(GFP_KERNEL);
+ folio = folio_alloc(GFP_KERNEL, 0);
err = -ENOMEM;
- if (!page)
+ if (!folio)
goto out_err;
- err = fuse_readlink_page(inode, page);
+ err = fuse_readlink_page(inode, folio);
if (err) {
- __free_page(page);
+ folio_put(folio);
goto out_err;
}
- set_delayed_call(callback, page_put_link, page);
+ set_delayed_call(callback, page_put_link, &folio->page);
- return page_address(page);
+ return folio_address(folio);
out_err:
return ERR_PTR(err);
@@ -2231,7 +2232,7 @@ void fuse_init_dir(struct inode *inode)
static int fuse_symlink_read_folio(struct file *null, struct folio *folio)
{
- int err = fuse_readlink_page(folio->mapping->host, &folio->page);
+ int err = fuse_readlink_page(folio->mapping->host, folio);
if (!err)
folio_mark_uptodate(folio);
--
2.43.5
next prev parent reply other threads:[~2024-10-24 17:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-24 17:17 [PATCH v3 00/13] fuse: use folios instead of pages for requests Joanne Koong
2024-10-24 17:17 ` [PATCH v3 01/13] fuse: support folios in struct fuse_args_pages and fuse_copy_pages() Joanne Koong
2024-10-24 17:17 ` [PATCH v3 02/13] fuse: add support in virtio for requests using folios Joanne Koong
2024-10-24 17:17 ` [PATCH v3 03/13] fuse: convert cuse to use folios Joanne Koong
2024-10-24 17:18 ` Joanne Koong [this message]
2024-10-24 17:18 ` [PATCH v3 05/13] fuse: convert readdir " Joanne Koong
2024-10-24 17:18 ` [PATCH v3 06/13] fuse: convert reads " Joanne Koong
2024-10-24 17:18 ` [PATCH v3 07/13] fuse: convert writes (non-writeback) " Joanne Koong
2024-10-24 17:18 ` [PATCH v3 08/13] fuse: convert ioctls " Joanne Koong
2024-10-24 17:18 ` [PATCH v3 09/13] fuse: convert retrieves " Joanne Koong
2024-10-24 17:18 ` [PATCH v3 10/13] fuse: convert writebacks " Joanne Koong
2024-10-24 17:18 ` [PATCH v3 11/13] mm/writeback: add folio_mark_dirty_lock() Joanne Koong
2024-10-24 17:18 ` [PATCH v3 12/13] fuse: convert direct io to use folios Joanne Koong
2024-10-24 17:18 ` [PATCH v3 13/13] fuse: remove pages for requests and exclusively " Joanne Koong
2024-11-06 11:20 ` [PATCH v3 00/13] fuse: use folios instead of pages for requests Miklos Szeredi
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=20241024171809.3142801-5-joannelkoong@gmail.com \
--to=joannelkoong@gmail.com \
--cc=bernd.schubert@fastmail.fm \
--cc=josef@toxicpanda.com \
--cc=kernel-team@meta.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=willy@infradead.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