mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
fs: Switch inode_has_buffers() to take mapping_metadata_bhs
As part of a move towards placing mapping_metadata_bhs in fs-private inode part, switch inode_has_buffers() to take mapping_metadata_bhs and rename the function to mmb_has_buffers(). Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/20260326095354.16340-74-jack@suse.cz Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
c86f5d2551
commit
025c9af1a2
14
fs/buffer.c
14
fs/buffer.c
|
|
@ -468,7 +468,7 @@ EXPORT_SYMBOL(mark_buffer_async_write);
|
|||
* written back and waited upon before fsync() returns.
|
||||
*
|
||||
* The functions mark_buffer_dirty_inode(), fsync_inode_buffers(),
|
||||
* inode_has_buffers() and invalidate_inode_buffers() are provided for the
|
||||
* mmb_has_buffers() and invalidate_inode_buffers() are provided for the
|
||||
* management of a list of dependent buffers in mapping_metadata_bhs struct.
|
||||
*
|
||||
* The locking is a little subtle: The list of buffer heads is protected by
|
||||
|
|
@ -526,11 +526,11 @@ static void remove_assoc_queue(struct buffer_head *bh)
|
|||
}
|
||||
}
|
||||
|
||||
int inode_has_buffers(struct inode *inode)
|
||||
bool mmb_has_buffers(struct mapping_metadata_bhs *mmb)
|
||||
{
|
||||
return !list_empty(&inode->i_data.i_metadata_bhs.list);
|
||||
return !list_empty(&mmb->list);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(inode_has_buffers);
|
||||
EXPORT_SYMBOL_GPL(mmb_has_buffers);
|
||||
|
||||
/**
|
||||
* sync_mapping_buffers - write out & wait upon a mapping's "associated" buffers
|
||||
|
|
@ -561,7 +561,7 @@ int sync_mapping_buffers(struct address_space *mapping)
|
|||
struct blk_plug plug;
|
||||
LIST_HEAD(tmp);
|
||||
|
||||
if (list_empty(&mmb->list))
|
||||
if (!mmb_has_buffers(mmb))
|
||||
return 0;
|
||||
|
||||
blk_start_plug(&plug);
|
||||
|
|
@ -803,9 +803,9 @@ EXPORT_SYMBOL(block_dirty_folio);
|
|||
*/
|
||||
void invalidate_inode_buffers(struct inode *inode)
|
||||
{
|
||||
if (inode_has_buffers(inode)) {
|
||||
struct mapping_metadata_bhs *mmb = &inode->i_data.i_metadata_bhs;
|
||||
struct mapping_metadata_bhs *mmb = &inode->i_data.i_metadata_bhs;
|
||||
|
||||
if (mmb_has_buffers(mmb)) {
|
||||
spin_lock(&mmb->lock);
|
||||
while (!list_empty(&mmb->list))
|
||||
__remove_assoc_queue(mmb, BH_ENTRY(mmb->list.next));
|
||||
|
|
|
|||
|
|
@ -3436,7 +3436,7 @@ static bool ext4_inode_datasync_dirty(struct inode *inode)
|
|||
}
|
||||
|
||||
/* Any metadata buffers to write? */
|
||||
if (inode_has_buffers(inode))
|
||||
if (mmb_has_buffers(&inode->i_mapping->i_metadata_bhs))
|
||||
return true;
|
||||
return inode_state_read_once(inode) & I_DIRTY_DATASYNC;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -515,7 +515,7 @@ bool block_dirty_folio(struct address_space *mapping, struct folio *folio);
|
|||
|
||||
void buffer_init(void);
|
||||
bool try_to_free_buffers(struct folio *folio);
|
||||
int inode_has_buffers(struct inode *inode);
|
||||
bool mmb_has_buffers(struct mapping_metadata_bhs *mmb);
|
||||
void invalidate_inode_buffers(struct inode *inode);
|
||||
int sync_mapping_buffers(struct address_space *mapping);
|
||||
void invalidate_bh_lrus(void);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user