9 #include <linux/slab.h>
28 #define INOS_PER_WRAP (0x10000)
53 static void logfs_inode_setops(
struct inode *
inode)
92 if (err || inode->
i_nlink == 0) {
104 logfs_inode_setops(inode);
113 return __logfs_iget(sb, ino);
130 spin_lock(&logfs_inode_lock);
134 spin_unlock(&logfs_inode_lock);
138 spin_unlock(&logfs_inode_lock);
141 return __logfs_iget(sb, ino);
150 static void __logfs_destroy_inode(
struct inode *inode)
159 static void __logfs_destroy_meta_inode(
struct inode *inode)
166 static void logfs_destroy_inode(
struct inode *inode)
175 __logfs_destroy_meta_inode(inode);
180 spin_lock(&logfs_inode_lock);
183 __logfs_destroy_inode(inode);
184 spin_unlock(&logfs_inode_lock);
195 logfs_destroy_inode(inode);
202 static void logfs_init_inode(
struct super_block *sb,
struct inode *inode)
211 i_uid_write(inode, 0);
212 i_gid_write(inode, 0);
226 static struct inode *logfs_alloc_inode(
struct super_block *sb)
292 logfs_inode_setops(inode);
311 static int logfs_drop_inode(
struct inode *inode)
316 spin_lock(&logfs_inode_lock);
318 spin_unlock(&logfs_inode_lock);
319 return generic_drop_inode(inode);
322 static void logfs_set_ino_generation(
struct super_block *sb,
351 logfs_init_inode(sb, inode);
358 logfs_set_ino_generation(sb, inode);
361 logfs_inode_setops(inode);
362 insert_inode_hash(inode);
367 static void logfs_init_once(
void *_li)
388 static void logfs_put_super(
struct super_block *sb)
398 .alloc_inode = logfs_alloc_inode,
399 .destroy_inode = logfs_destroy_inode,
401 .drop_inode = logfs_drop_inode,
402 .put_super = logfs_put_super,
403 .write_inode = logfs_write_inode,
405 .sync_fs = logfs_sync_fs,
413 if (!logfs_inode_cache)