| .. | .. |
|---|
| 28 | 28 | * @i_xattr: <TODO> |
|---|
| 29 | 29 | * @i_dir_start_lookup: page index of last successful search |
|---|
| 30 | 30 | * @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) |
|---|
| 32 | 32 | * @i_dirty: list for connecting dirty files |
|---|
| 33 | 33 | * @xattr_sem: semaphore for extended attributes processing |
|---|
| 34 | 34 | * @i_bh: buffer contains disk inode |
|---|
| .. | .. |
|---|
| 43 | 43 | __u64 i_xattr; /* sector_t ??? */ |
|---|
| 44 | 44 | __u32 i_dir_start_lookup; |
|---|
| 45 | 45 | __u64 i_cno; /* check point number for GC inode */ |
|---|
| 46 | | - struct address_space i_btnode_cache; |
|---|
| 46 | + struct inode *i_assoc_inode; |
|---|
| 47 | 47 | struct list_head i_dirty; /* List for connecting dirty files */ |
|---|
| 48 | 48 | |
|---|
| 49 | 49 | #ifdef CONFIG_NILFS_XATTR |
|---|
| .. | .. |
|---|
| 75 | 75 | return container_of(bmap, struct nilfs_inode_info, i_bmap_data); |
|---|
| 76 | 76 | } |
|---|
| 77 | 77 | |
|---|
| 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 | | - |
|---|
| 85 | 78 | /* |
|---|
| 86 | 79 | * Dynamic state flags of NILFS on-memory inode (i_state) |
|---|
| 87 | 80 | */ |
|---|
| .. | .. |
|---|
| 98 | 91 | NILFS_I_INODE_SYNC, /* dsync is not allowed for inode */ |
|---|
| 99 | 92 | NILFS_I_BMAP, /* has bmap and btnode_cache */ |
|---|
| 100 | 93 | 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 */ |
|---|
| 101 | 96 | }; |
|---|
| 102 | 97 | |
|---|
| 103 | 98 | /* |
|---|
| .. | .. |
|---|
| 203 | 198 | |
|---|
| 204 | 199 | static inline int nilfs_init_acl(struct inode *inode, struct inode *dir) |
|---|
| 205 | 200 | { |
|---|
| 201 | + if (S_ISLNK(inode->i_mode)) |
|---|
| 202 | + return 0; |
|---|
| 203 | + |
|---|
| 206 | 204 | inode->i_mode &= ~current_umask(); |
|---|
| 207 | 205 | return 0; |
|---|
| 208 | 206 | } |
|---|
| .. | .. |
|---|
| 252 | 250 | void nilfs_inode_add_blocks(struct inode *inode, int n); |
|---|
| 253 | 251 | void nilfs_inode_sub_blocks(struct inode *inode, int n); |
|---|
| 254 | 252 | extern struct inode *nilfs_new_inode(struct inode *, umode_t); |
|---|
| 255 | | -extern void nilfs_free_inode(struct inode *); |
|---|
| 256 | 253 | extern int nilfs_get_block(struct inode *, sector_t, struct buffer_head *, int); |
|---|
| 257 | 254 | extern void nilfs_set_inode_flags(struct inode *); |
|---|
| 258 | 255 | extern int nilfs_read_inode_common(struct inode *, struct nilfs_inode *); |
|---|
| .. | .. |
|---|
| 265 | 262 | unsigned long ino); |
|---|
| 266 | 263 | extern struct inode *nilfs_iget_for_gc(struct super_block *sb, |
|---|
| 267 | 264 | 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); |
|---|
| 268 | 268 | extern void nilfs_update_inode(struct inode *, struct buffer_head *, int); |
|---|
| 269 | 269 | extern void nilfs_truncate(struct inode *); |
|---|
| 270 | 270 | extern void nilfs_evict_inode(struct inode *); |
|---|
| .. | .. |
|---|
| 289 | 289 | |
|---|
| 290 | 290 | /* super.c */ |
|---|
| 291 | 291 | extern struct inode *nilfs_alloc_inode(struct super_block *); |
|---|
| 292 | | -extern void nilfs_destroy_inode(struct inode *); |
|---|
| 293 | 292 | |
|---|
| 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, ...); |
|---|
| 297 | 295 | extern __printf(3, 4) |
|---|
| 298 | 296 | void __nilfs_error(struct super_block *sb, const char *function, |
|---|
| 299 | 297 | const char *fmt, ...); |
|---|
| .. | .. |
|---|
| 301 | 299 | #ifdef CONFIG_PRINTK |
|---|
| 302 | 300 | |
|---|
| 303 | 301 | #define nilfs_msg(sb, level, fmt, ...) \ |
|---|
| 304 | | - __nilfs_msg(sb, level, fmt, ##__VA_ARGS__) |
|---|
| 302 | + __nilfs_msg(sb, level fmt, ##__VA_ARGS__) |
|---|
| 305 | 303 | #define nilfs_error(sb, fmt, ...) \ |
|---|
| 306 | 304 | __nilfs_error(sb, __func__, fmt, ##__VA_ARGS__) |
|---|
| 307 | 305 | |
|---|
| .. | .. |
|---|
| 309 | 307 | |
|---|
| 310 | 308 | #define nilfs_msg(sb, level, fmt, ...) \ |
|---|
| 311 | 309 | do { \ |
|---|
| 312 | | - no_printk(fmt, ##__VA_ARGS__); \ |
|---|
| 310 | + no_printk(level fmt, ##__VA_ARGS__); \ |
|---|
| 313 | 311 | (void)(sb); \ |
|---|
| 314 | 312 | } while (0) |
|---|
| 315 | 313 | #define nilfs_error(sb, fmt, ...) \ |
|---|
| .. | .. |
|---|
| 320 | 318 | |
|---|
| 321 | 319 | #endif /* CONFIG_PRINTK */ |
|---|
| 322 | 320 | |
|---|
| 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 | + |
|---|
| 323 | 330 | extern struct nilfs_super_block * |
|---|
| 324 | 331 | nilfs_read_super_block(struct super_block *, u64, int, struct buffer_head **); |
|---|
| 325 | 332 | extern int nilfs_store_magic_and_option(struct super_block *, |
|---|