Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Mateusz Guzik and committed by
Christian Brauner
12741624 3cd1548a

+13
+12
fs/inode.c
··· 1967 1967 } 1968 1968 EXPORT_SYMBOL(iput); 1969 1969 1970 + /** 1971 + * iput_not_last - put an inode assuming this is not the last reference 1972 + * @inode: inode to put 1973 + */ 1974 + void iput_not_last(struct inode *inode) 1975 + { 1976 + VFS_BUG_ON_INODE(atomic_read(&inode->i_count) < 2, inode); 1977 + 1978 + WARN_ON(atomic_sub_return(1, &inode->i_count) == 0); 1979 + } 1980 + EXPORT_SYMBOL(iput_not_last); 1981 + 1970 1982 #ifdef CONFIG_BLOCK 1971 1983 /** 1972 1984 * bmap - find a block number in a file
+1
include/linux/fs.h
··· 2824 2824 2825 2825 extern void ihold(struct inode * inode); 2826 2826 extern void iput(struct inode *); 2827 + void iput_not_last(struct inode *); 2827 2828 int inode_update_timestamps(struct inode *inode, int flags); 2828 2829 int generic_update_time(struct inode *, int); 2829 2830