inode: make __iget() a static inline
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 8 Aug 2024 15:18:21 +0000 (11:18 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 9 Sep 2024 13:41:47 +0000 (09:41 -0400)
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>
fs/inode.c
include/linux/fs.h

index 86670941884b48737acdfb46858d4611b0592cc0..5e7dcdeedd4db5a053379d4b5ffd720bbf6973a6 100644 (file)
@@ -438,14 +438,6 @@ static void init_once(void *foo)
        inode_init_once(inode);
 }
 
-/*
- * 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.
  */
index fd34b5755c0b52988a7131493cd56fa8ea640ad9..8fc4bad3b6aed00fcb5223a2d7c623cbccbbf5f6 100644 (file)
@@ -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 *);