mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2026-01-27 12:47:24 +01:00
fs: add iput_not_last()
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com> Link: https://patch.msgid.link/20251105212025.807549-1-mjguzik@gmail.com Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
3cd1548a27
commit
1274162464
12
fs/inode.c
12
fs/inode.c
|
|
@ -1967,6 +1967,18 @@ retry:
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(iput);
|
EXPORT_SYMBOL(iput);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* iput_not_last - put an inode assuming this is not the last reference
|
||||||
|
* @inode: inode to put
|
||||||
|
*/
|
||||||
|
void iput_not_last(struct inode *inode)
|
||||||
|
{
|
||||||
|
VFS_BUG_ON_INODE(atomic_read(&inode->i_count) < 2, inode);
|
||||||
|
|
||||||
|
WARN_ON(atomic_sub_return(1, &inode->i_count) == 0);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(iput_not_last);
|
||||||
|
|
||||||
#ifdef CONFIG_BLOCK
|
#ifdef CONFIG_BLOCK
|
||||||
/**
|
/**
|
||||||
* bmap - find a block number in a file
|
* bmap - find a block number in a file
|
||||||
|
|
|
||||||
|
|
@ -2824,6 +2824,7 @@ extern int current_umask(void);
|
||||||
|
|
||||||
extern void ihold(struct inode * inode);
|
extern void ihold(struct inode * inode);
|
||||||
extern void iput(struct inode *);
|
extern void iput(struct inode *);
|
||||||
|
void iput_not_last(struct inode *);
|
||||||
int inode_update_timestamps(struct inode *inode, int flags);
|
int inode_update_timestamps(struct inode *inode, int flags);
|
||||||
int generic_update_time(struct inode *, int);
|
int generic_update_time(struct inode *, int);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user