mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-23 20:24:12 +08:00
ufs; Convert ufs_commit_chunk() to take a folio
All callers now have a folio, so pass it in. Saves a call to compound_head(). Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
128d1e89ac
commit
0f3e63f30b
16
fs/ufs/dir.c
16
fs/ufs/dir.c
@ -42,18 +42,18 @@ static inline int ufs_match(struct super_block *sb, int len,
|
||||
return !memcmp(name, de->d_name, len);
|
||||
}
|
||||
|
||||
static void ufs_commit_chunk(struct page *page, loff_t pos, unsigned len)
|
||||
static void ufs_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;
|
||||
|
||||
inode_inc_iversion(dir);
|
||||
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 ufs_handle_dirsync(struct inode *dir)
|
||||
@ -103,7 +103,7 @@ void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de,
|
||||
de->d_ino = cpu_to_fs32(dir->i_sb, inode->i_ino);
|
||||
ufs_set_de_type(dir->i_sb, de, inode->i_mode);
|
||||
|
||||
ufs_commit_chunk(&folio->page, pos, len);
|
||||
ufs_commit_chunk(folio, pos, len);
|
||||
ufs_put_page(&folio->page);
|
||||
if (update_times)
|
||||
inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir));
|
||||
@ -383,7 +383,7 @@ got_it:
|
||||
de->d_ino = cpu_to_fs32(sb, inode->i_ino);
|
||||
ufs_set_de_type(sb, de, inode->i_mode);
|
||||
|
||||
ufs_commit_chunk(&folio->page, pos, rec_len);
|
||||
ufs_commit_chunk(folio, pos, rec_len);
|
||||
inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir));
|
||||
|
||||
mark_inode_dirty(dir);
|
||||
@ -526,7 +526,7 @@ int ufs_delete_entry(struct inode *inode, struct ufs_dir_entry *dir,
|
||||
if (pde)
|
||||
pde->d_reclen = cpu_to_fs16(sb, to - from);
|
||||
dir->d_ino = 0;
|
||||
ufs_commit_chunk(&folio->page, pos, to - from);
|
||||
ufs_commit_chunk(folio, pos, to - from);
|
||||
inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
|
||||
mark_inode_dirty(inode);
|
||||
err = ufs_handle_dirsync(inode);
|
||||
@ -574,7 +574,7 @@ int ufs_make_empty(struct inode * inode, struct inode *dir)
|
||||
strcpy (de->d_name, "..");
|
||||
kunmap_local(kaddr);
|
||||
|
||||
ufs_commit_chunk(&folio->page, 0, chunk_size);
|
||||
ufs_commit_chunk(folio, 0, chunk_size);
|
||||
err = ufs_handle_dirsync(inode);
|
||||
fail:
|
||||
folio_put(folio);
|
||||
|
Loading…
Reference in New Issue
Block a user