diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-08-08 11:18:21 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-09-09 09:41:47 -0400 |
commit | 88d2ae0e6eb84e1ed58f339c6a0de16c24fa2a60 (patch) | |
tree | 21c47daf7096e43056272091ff3a11a879242954 | |
parent | 27663d7784b5dfd354a968e06b26452dc93f2a16 (diff) |
inode: make __iget() a static inline
bcachefs is switching to an rhashtable for vfs inodes instead of the
standard inode.c hashtable, so we need this exported, or - a static
inline makes more sense for a single atomic_inc().
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/inode.c | 8 | ||||
-rw-r--r-- | include/linux/fs.h | 9 |
2 files changed, 8 insertions, 9 deletions
diff --git a/fs/inode.c b/fs/inode.c index 86670941884b..5e7dcdeedd4d 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -439,14 +439,6 @@ static void init_once(void *foo) } /* - * inode->i_lock must be held - */ -void __iget(struct inode *inode) -{ - atomic_inc(&inode->i_count); -} - -/* * get additional reference to inode; caller must already hold one. */ void ihold(struct inode *inode) diff --git a/include/linux/fs.h b/include/linux/fs.h index fd34b5755c0b..8fc4bad3b6ae 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -3094,7 +3094,14 @@ static inline bool is_zero_ino(ino_t ino) return (u32)ino == 0; } -extern void __iget(struct inode * inode); +/* + * inode->i_lock must be held + */ +static inline void __iget(struct inode *inode) +{ + atomic_inc(&inode->i_count); +} + extern void iget_failed(struct inode *); extern void clear_inode(struct inode *); extern void __destroy_inode(struct inode *); |