mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
ext2: annotate ext2_init_block_alloc_info() as requiring truncate_mutex
ext2_init_block_alloc_info() sets up the inode's block reservation info and is already documented as needing truncate_mutex protection. Express that with __must_hold() for Clang's context analysis. Both callers (ext2_get_blocks() and ext2_ioctl()) already hold truncate_mutex. Signed-off-by: Timothy Day <timday@thelustrecollective.com> Acked-by: Marco Elver <elver@google.com> Link: https://patch.msgid.link/20260811160336.782342-6-timday@thelustrecollective.com Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
parent
023051c2d0
commit
7aa90b3c8e
|
|
@ -414,6 +414,7 @@ static inline int rsv_is_empty(struct ext2_reserve_window *rsv)
|
|||
* Needs truncate_mutex protection prior to calling this function.
|
||||
*/
|
||||
void ext2_init_block_alloc_info(struct inode *inode)
|
||||
__must_hold(&EXT2_I(inode)->truncate_mutex)
|
||||
{
|
||||
struct ext2_inode_info *ei = EXT2_I(inode);
|
||||
struct ext2_block_alloc_info *block_i;
|
||||
|
|
|
|||
|
|
@ -710,7 +710,8 @@ extern struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
|
|||
struct buffer_head ** bh);
|
||||
extern void ext2_discard_reservation (struct inode *);
|
||||
extern int ext2_should_retry_alloc(struct super_block *sb, int *retries);
|
||||
extern void ext2_init_block_alloc_info(struct inode *);
|
||||
extern void ext2_init_block_alloc_info(struct inode *inode)
|
||||
__must_hold(&EXT2_I(inode)->truncate_mutex);
|
||||
extern void ext2_rsv_window_add(struct super_block *sb, struct ext2_reserve_window_node *rsv);
|
||||
|
||||
/* dir.c */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user