mirror of
https://github.com/torvalds/linux
synced 2024-10-03 18:00:50 +00:00
sysv: Convert sysv_prepare_chunk() to take a folio
All callers now have a folio, so convert sysv_prepare_chunk() to take one. 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
7f4fb15063
commit
d3a2fa28fe
|
@ -213,7 +213,7 @@ int sysv_add_link(struct dentry *dentry, struct inode *inode)
|
||||||
got_it:
|
got_it:
|
||||||
pos = folio_pos(folio) + offset_in_folio(folio, de);
|
pos = folio_pos(folio) + offset_in_folio(folio, de);
|
||||||
folio_lock(folio);
|
folio_lock(folio);
|
||||||
err = sysv_prepare_chunk(&folio->page, pos, SYSV_DIRSIZE);
|
err = sysv_prepare_chunk(folio, pos, SYSV_DIRSIZE);
|
||||||
if (err)
|
if (err)
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
memcpy (de->name, name, namelen);
|
memcpy (de->name, name, namelen);
|
||||||
|
@ -238,7 +238,7 @@ int sysv_delete_entry(struct sysv_dir_entry *de, struct folio *folio)
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
folio_lock(folio);
|
folio_lock(folio);
|
||||||
err = sysv_prepare_chunk(&folio->page, pos, SYSV_DIRSIZE);
|
err = sysv_prepare_chunk(folio, pos, SYSV_DIRSIZE);
|
||||||
if (err) {
|
if (err) {
|
||||||
folio_unlock(folio);
|
folio_unlock(folio);
|
||||||
return err;
|
return err;
|
||||||
|
@ -259,7 +259,7 @@ int sysv_make_empty(struct inode *inode, struct inode *dir)
|
||||||
|
|
||||||
if (IS_ERR(folio))
|
if (IS_ERR(folio))
|
||||||
return PTR_ERR(folio);
|
return PTR_ERR(folio);
|
||||||
err = sysv_prepare_chunk(&folio->page, 0, 2 * SYSV_DIRSIZE);
|
err = sysv_prepare_chunk(folio, 0, 2 * SYSV_DIRSIZE);
|
||||||
if (err) {
|
if (err) {
|
||||||
folio_unlock(folio);
|
folio_unlock(folio);
|
||||||
goto fail;
|
goto fail;
|
||||||
|
@ -335,7 +335,7 @@ int sysv_set_link(struct sysv_dir_entry *de, struct folio *folio,
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
folio_lock(folio);
|
folio_lock(folio);
|
||||||
err = sysv_prepare_chunk(&folio->page, pos, SYSV_DIRSIZE);
|
err = sysv_prepare_chunk(folio, pos, SYSV_DIRSIZE);
|
||||||
if (err) {
|
if (err) {
|
||||||
folio_unlock(folio);
|
folio_unlock(folio);
|
||||||
return err;
|
return err;
|
||||||
|
|
|
@ -466,9 +466,9 @@ static int sysv_read_folio(struct file *file, struct folio *folio)
|
||||||
return block_read_full_folio(folio, get_block);
|
return block_read_full_folio(folio, get_block);
|
||||||
}
|
}
|
||||||
|
|
||||||
int sysv_prepare_chunk(struct page *page, loff_t pos, unsigned len)
|
int sysv_prepare_chunk(struct folio *folio, loff_t pos, unsigned len)
|
||||||
{
|
{
|
||||||
return __block_write_begin(page, pos, len, get_block);
|
return __block_write_begin(&folio->page, pos, len, get_block);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sysv_write_failed(struct address_space *mapping, loff_t to)
|
static void sysv_write_failed(struct address_space *mapping, loff_t to)
|
||||||
|
|
|
@ -133,8 +133,8 @@ extern void sysv_free_block(struct super_block *, sysv_zone_t);
|
||||||
extern unsigned long sysv_count_free_blocks(struct super_block *);
|
extern unsigned long sysv_count_free_blocks(struct super_block *);
|
||||||
|
|
||||||
/* itree.c */
|
/* itree.c */
|
||||||
extern void sysv_truncate(struct inode *);
|
void sysv_truncate(struct inode *);
|
||||||
extern int sysv_prepare_chunk(struct page *page, loff_t pos, unsigned len);
|
int sysv_prepare_chunk(struct folio *folio, loff_t pos, unsigned len);
|
||||||
|
|
||||||
/* inode.c */
|
/* inode.c */
|
||||||
extern struct inode *sysv_iget(struct super_block *, unsigned int);
|
extern struct inode *sysv_iget(struct super_block *, unsigned int);
|
||||||
|
|
Loading…
Reference in a new issue