hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/fs/nilfs2/nilfs.h
....@@ -28,7 +28,7 @@
2828 * @i_xattr: <TODO>
2929 * @i_dir_start_lookup: page index of last successful search
3030 * @i_cno: checkpoint number for GC inode
31
- * @i_btnode_cache: cached pages of b-tree nodes
31
+ * @i_assoc_inode: associated inode (B-tree node cache holder or back pointer)
3232 * @i_dirty: list for connecting dirty files
3333 * @xattr_sem: semaphore for extended attributes processing
3434 * @i_bh: buffer contains disk inode
....@@ -43,7 +43,7 @@
4343 __u64 i_xattr; /* sector_t ??? */
4444 __u32 i_dir_start_lookup;
4545 __u64 i_cno; /* check point number for GC inode */
46
- struct address_space i_btnode_cache;
46
+ struct inode *i_assoc_inode;
4747 struct list_head i_dirty; /* List for connecting dirty files */
4848
4949 #ifdef CONFIG_NILFS_XATTR
....@@ -75,13 +75,6 @@
7575 return container_of(bmap, struct nilfs_inode_info, i_bmap_data);
7676 }
7777
78
-static inline struct inode *NILFS_BTNC_I(struct address_space *btnc)
79
-{
80
- struct nilfs_inode_info *ii =
81
- container_of(btnc, struct nilfs_inode_info, i_btnode_cache);
82
- return &ii->vfs_inode;
83
-}
84
-
8578 /*
8679 * Dynamic state flags of NILFS on-memory inode (i_state)
8780 */
....@@ -98,6 +91,8 @@
9891 NILFS_I_INODE_SYNC, /* dsync is not allowed for inode */
9992 NILFS_I_BMAP, /* has bmap and btnode_cache */
10093 NILFS_I_GCINODE, /* inode for GC, on memory only */
94
+ NILFS_I_BTNC, /* inode for btree node cache */
95
+ NILFS_I_SHADOW, /* inode for shadowed page cache */
10196 };
10297
10398 /*
....@@ -203,6 +198,9 @@
203198
204199 static inline int nilfs_init_acl(struct inode *inode, struct inode *dir)
205200 {
201
+ if (S_ISLNK(inode->i_mode))
202
+ return 0;
203
+
206204 inode->i_mode &= ~current_umask();
207205 return 0;
208206 }
....@@ -252,7 +250,6 @@
252250 void nilfs_inode_add_blocks(struct inode *inode, int n);
253251 void nilfs_inode_sub_blocks(struct inode *inode, int n);
254252 extern struct inode *nilfs_new_inode(struct inode *, umode_t);
255
-extern void nilfs_free_inode(struct inode *);
256253 extern int nilfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
257254 extern void nilfs_set_inode_flags(struct inode *);
258255 extern int nilfs_read_inode_common(struct inode *, struct nilfs_inode *);
....@@ -265,6 +262,9 @@
265262 unsigned long ino);
266263 extern struct inode *nilfs_iget_for_gc(struct super_block *sb,
267264 unsigned long ino, __u64 cno);
265
+int nilfs_attach_btree_node_cache(struct inode *inode);
266
+void nilfs_detach_btree_node_cache(struct inode *inode);
267
+struct inode *nilfs_iget_for_shadow(struct inode *inode);
268268 extern void nilfs_update_inode(struct inode *, struct buffer_head *, int);
269269 extern void nilfs_truncate(struct inode *);
270270 extern void nilfs_evict_inode(struct inode *);
....@@ -289,11 +289,9 @@
289289
290290 /* super.c */
291291 extern struct inode *nilfs_alloc_inode(struct super_block *);
292
-extern void nilfs_destroy_inode(struct inode *);
293292
294
-extern __printf(3, 4)
295
-void __nilfs_msg(struct super_block *sb, const char *level,
296
- const char *fmt, ...);
293
+__printf(2, 3)
294
+void __nilfs_msg(struct super_block *sb, const char *fmt, ...);
297295 extern __printf(3, 4)
298296 void __nilfs_error(struct super_block *sb, const char *function,
299297 const char *fmt, ...);
....@@ -301,7 +299,7 @@
301299 #ifdef CONFIG_PRINTK
302300
303301 #define nilfs_msg(sb, level, fmt, ...) \
304
- __nilfs_msg(sb, level, fmt, ##__VA_ARGS__)
302
+ __nilfs_msg(sb, level fmt, ##__VA_ARGS__)
305303 #define nilfs_error(sb, fmt, ...) \
306304 __nilfs_error(sb, __func__, fmt, ##__VA_ARGS__)
307305
....@@ -309,7 +307,7 @@
309307
310308 #define nilfs_msg(sb, level, fmt, ...) \
311309 do { \
312
- no_printk(fmt, ##__VA_ARGS__); \
310
+ no_printk(level fmt, ##__VA_ARGS__); \
313311 (void)(sb); \
314312 } while (0)
315313 #define nilfs_error(sb, fmt, ...) \
....@@ -320,6 +318,15 @@
320318
321319 #endif /* CONFIG_PRINTK */
322320
321
+#define nilfs_crit(sb, fmt, ...) \
322
+ nilfs_msg(sb, KERN_CRIT, fmt, ##__VA_ARGS__)
323
+#define nilfs_err(sb, fmt, ...) \
324
+ nilfs_msg(sb, KERN_ERR, fmt, ##__VA_ARGS__)
325
+#define nilfs_warn(sb, fmt, ...) \
326
+ nilfs_msg(sb, KERN_WARNING, fmt, ##__VA_ARGS__)
327
+#define nilfs_info(sb, fmt, ...) \
328
+ nilfs_msg(sb, KERN_INFO, fmt, ##__VA_ARGS__)
329
+
323330 extern struct nilfs_super_block *
324331 nilfs_read_super_block(struct super_block *, u64, int, struct buffer_head **);
325332 extern int nilfs_store_magic_and_option(struct super_block *,