From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: linux-fsdevel@vger.kernel.org
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
Al Viro <viro@zeniv.linux.org.uk>, Christoph Hellwig <hch@lst.de>
Subject: [PATCH 7/7] sysv: Convert dir_commit_chunk() to take a folio
Date: Tue, 9 Jul 2024 16:03:12 +0100 [thread overview]
Message-ID: <20240709150314.1906109-8-willy@infradead.org> (raw)
In-Reply-To: <20240709150314.1906109-1-willy@infradead.org>
All callers now have a folio, so pass it in. Saves a call to
compound_head().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
fs/sysv/dir.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c
index 43615b803fee..27eaa5273ba7 100644
--- a/fs/sysv/dir.c
+++ b/fs/sysv/dir.c
@@ -28,17 +28,17 @@ const struct file_operations sysv_dir_operations = {
.fsync = generic_file_fsync,
};
-static void dir_commit_chunk(struct page *page, loff_t pos, unsigned len)
+static void dir_commit_chunk(struct folio *folio, loff_t pos, unsigned len)
{
- struct address_space *mapping = page->mapping;
+ struct address_space *mapping = folio->mapping;
struct inode *dir = mapping->host;
- block_write_end(NULL, mapping, pos, len, len, page, NULL);
+ block_write_end(NULL, mapping, pos, len, len, &folio->page, NULL);
if (pos+len > dir->i_size) {
i_size_write(dir, pos+len);
mark_inode_dirty(dir);
}
- unlock_page(page);
+ folio_unlock(folio);
}
static int sysv_handle_dirsync(struct inode *dir)
@@ -219,7 +219,7 @@ int sysv_add_link(struct dentry *dentry, struct inode *inode)
memcpy (de->name, name, namelen);
memset (de->name + namelen, 0, SYSV_DIRSIZE - namelen - 2);
de->inode = cpu_to_fs16(SYSV_SB(inode->i_sb), inode->i_ino);
- dir_commit_chunk(&folio->page, pos, SYSV_DIRSIZE);
+ dir_commit_chunk(folio, pos, SYSV_DIRSIZE);
inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir));
mark_inode_dirty(dir);
err = sysv_handle_dirsync(dir);
@@ -244,7 +244,7 @@ int sysv_delete_entry(struct sysv_dir_entry *de, struct folio *folio)
return err;
}
de->inode = 0;
- dir_commit_chunk(&folio->page, pos, SYSV_DIRSIZE);
+ dir_commit_chunk(folio, pos, SYSV_DIRSIZE);
inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
mark_inode_dirty(inode);
return sysv_handle_dirsync(inode);
@@ -275,7 +275,7 @@ int sysv_make_empty(struct inode *inode, struct inode *dir)
strcpy(de->name,"..");
kunmap_local(kaddr);
- dir_commit_chunk(&folio->page, 0, 2 * SYSV_DIRSIZE);
+ dir_commit_chunk(folio, 0, 2 * SYSV_DIRSIZE);
err = sysv_handle_dirsync(inode);
fail:
folio_put(folio);
@@ -341,7 +341,7 @@ int sysv_set_link(struct sysv_dir_entry *de, struct folio *folio,
return err;
}
de->inode = cpu_to_fs16(SYSV_SB(inode->i_sb), inode->i_ino);
- dir_commit_chunk(&folio->page, pos, SYSV_DIRSIZE);
+ dir_commit_chunk(folio, pos, SYSV_DIRSIZE);
inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir));
mark_inode_dirty(dir);
return sysv_handle_dirsync(inode);
--
2.43.0
next prev parent reply other threads:[~2024-07-09 15:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-09 15:03 [PATCH 0/7] Convert sysv directory handling to folios Matthew Wilcox (Oracle)
2024-07-09 15:03 ` [PATCH 1/7] sysv: Convert dir_get_page() to dir_get_folio() Matthew Wilcox (Oracle)
2024-07-09 15:03 ` [PATCH 2/7] sysv: Convert sysv_find_entry() to take a folio Matthew Wilcox (Oracle)
2024-07-09 15:03 ` [PATCH 3/7] sysv: Convert sysv_set_link() and sysv_dotdot() " Matthew Wilcox (Oracle)
2024-07-09 15:03 ` [PATCH 4/7] sysv: Convert sysv_delete_entry() to work on " Matthew Wilcox (Oracle)
2024-07-09 15:03 ` [PATCH 5/7] sysv: Convert sysv_make_empty() to use " Matthew Wilcox (Oracle)
2024-07-09 15:03 ` [PATCH 6/7] sysv: Convert sysv_prepare_chunk() to take " Matthew Wilcox (Oracle)
2024-07-09 15:03 ` Matthew Wilcox (Oracle) [this message]
2024-07-16 8:17 ` [PATCH 0/7] Convert sysv directory handling to folios Christian Brauner
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=20240709150314.1906109-8-willy@infradead.org \
--to=willy@infradead.org \
--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).