f2fs: fix inconsistency between xattr node blocks and its inode
[deliverable/linux.git] / fs / f2fs / f2fs.h
CommitLineData
0a8165d7 1/*
39a53e0c
JK
2 * fs/f2fs/f2fs.h
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef _LINUX_F2FS_H
12#define _LINUX_F2FS_H
13
14#include <linux/types.h>
15#include <linux/page-flags.h>
16#include <linux/buffer_head.h>
39a53e0c
JK
17#include <linux/slab.h>
18#include <linux/crc32.h>
19#include <linux/magic.h>
c2d715d1 20#include <linux/kobject.h>
39a53e0c
JK
21
22/*
23 * For mount options
24 */
25#define F2FS_MOUNT_BG_GC 0x00000001
26#define F2FS_MOUNT_DISABLE_ROLL_FORWARD 0x00000002
27#define F2FS_MOUNT_DISCARD 0x00000004
28#define F2FS_MOUNT_NOHEAP 0x00000008
29#define F2FS_MOUNT_XATTR_USER 0x00000010
30#define F2FS_MOUNT_POSIX_ACL 0x00000020
31#define F2FS_MOUNT_DISABLE_EXT_IDENTIFY 0x00000040
32
33#define clear_opt(sbi, option) (sbi->mount_opt.opt &= ~F2FS_MOUNT_##option)
34#define set_opt(sbi, option) (sbi->mount_opt.opt |= F2FS_MOUNT_##option)
35#define test_opt(sbi, option) (sbi->mount_opt.opt & F2FS_MOUNT_##option)
36
37#define ver_after(a, b) (typecheck(unsigned long long, a) && \
38 typecheck(unsigned long long, b) && \
39 ((long long)((a) - (b)) > 0))
40
a9841c4d
JK
41typedef u32 block_t; /*
42 * should not change u32, since it is the on-disk block
43 * address format, __le32.
44 */
39a53e0c
JK
45typedef u32 nid_t;
46
47struct f2fs_mount_info {
48 unsigned int opt;
49};
50
7e586fa0
JK
51#define CRCPOLY_LE 0xedb88320
52
53static inline __u32 f2fs_crc32(void *buf, size_t len)
39a53e0c 54{
7e586fa0
JK
55 unsigned char *p = (unsigned char *)buf;
56 __u32 crc = F2FS_SUPER_MAGIC;
57 int i;
58
59 while (len--) {
60 crc ^= *p++;
61 for (i = 0; i < 8; i++)
62 crc = (crc >> 1) ^ ((crc & 1) ? CRCPOLY_LE : 0);
63 }
64 return crc;
39a53e0c
JK
65}
66
7e586fa0 67static inline bool f2fs_crc_valid(__u32 blk_crc, void *buf, size_t buf_size)
39a53e0c 68{
7e586fa0 69 return f2fs_crc32(buf, buf_size) == blk_crc;
39a53e0c
JK
70}
71
72/*
73 * For checkpoint manager
74 */
75enum {
76 NAT_BITMAP,
77 SIT_BITMAP
78};
79
80/* for the list of orphan inodes */
81struct orphan_inode_entry {
82 struct list_head list; /* list head */
83 nid_t ino; /* inode number */
84};
85
86/* for the list of directory inodes */
87struct dir_inode_entry {
88 struct list_head list; /* list head */
89 struct inode *inode; /* vfs inode pointer */
90};
91
92/* for the list of fsync inodes, used only during recovery */
93struct fsync_inode_entry {
94 struct list_head list; /* list head */
95 struct inode *inode; /* vfs inode pointer */
96 block_t blkaddr; /* block address locating the last inode */
97};
98
99#define nats_in_cursum(sum) (le16_to_cpu(sum->n_nats))
100#define sits_in_cursum(sum) (le16_to_cpu(sum->n_sits))
101
102#define nat_in_journal(sum, i) (sum->nat_j.entries[i].ne)
103#define nid_in_journal(sum, i) (sum->nat_j.entries[i].nid)
104#define sit_in_journal(sum, i) (sum->sit_j.entries[i].se)
105#define segno_in_journal(sum, i) (sum->sit_j.entries[i].segno)
106
107static inline int update_nats_in_cursum(struct f2fs_summary_block *rs, int i)
108{
109 int before = nats_in_cursum(rs);
110 rs->n_nats = cpu_to_le16(before + i);
111 return before;
112}
113
114static inline int update_sits_in_cursum(struct f2fs_summary_block *rs, int i)
115{
116 int before = sits_in_cursum(rs);
117 rs->n_sits = cpu_to_le16(before + i);
118 return before;
119}
120
e9750824
NJ
121/*
122 * ioctl commands
123 */
124#define F2FS_IOC_GETFLAGS FS_IOC_GETFLAGS
125#define F2FS_IOC_SETFLAGS FS_IOC_SETFLAGS
126
127#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
128/*
129 * ioctl commands in 32 bit emulation
130 */
131#define F2FS_IOC32_GETFLAGS FS_IOC32_GETFLAGS
132#define F2FS_IOC32_SETFLAGS FS_IOC32_SETFLAGS
133#endif
134
39a53e0c
JK
135/*
136 * For INODE and NODE manager
137 */
dbe6a5ff
JK
138/*
139 * XATTR_NODE_OFFSET stores xattrs to one node block per file keeping -1
140 * as its node offset to distinguish from index node blocks.
141 * But some bits are used to mark the node block.
142 */
143#define XATTR_NODE_OFFSET ((((unsigned int)-1) << OFFSET_BIT_SHIFT) \
144 >> OFFSET_BIT_SHIFT)
266e97a8
JK
145enum {
146 ALLOC_NODE, /* allocate a new node page if needed */
147 LOOKUP_NODE, /* look up a node without readahead */
148 LOOKUP_NODE_RA, /*
149 * look up a node with readahead called
150 * by get_datablock_ro.
39a53e0c 151 */
266e97a8
JK
152};
153
39a53e0c
JK
154#define F2FS_LINK_MAX 32000 /* maximum link count per file */
155
156/* for in-memory extent cache entry */
157struct extent_info {
158 rwlock_t ext_lock; /* rwlock for consistency */
159 unsigned int fofs; /* start offset in a file */
160 u32 blk_addr; /* start block address of the extent */
111d2495 161 unsigned int len; /* length of the extent */
39a53e0c
JK
162};
163
164/*
165 * i_advise uses FADVISE_XXX_BIT. We can add additional hints later.
166 */
167#define FADVISE_COLD_BIT 0x01
354a3399 168#define FADVISE_LOST_PINO_BIT 0x02
39a53e0c
JK
169
170struct f2fs_inode_info {
171 struct inode vfs_inode; /* serve a vfs inode */
172 unsigned long i_flags; /* keep an inode flags for ioctl */
173 unsigned char i_advise; /* use to give file attribute hints */
174 unsigned int i_current_depth; /* use only in directory structure */
6666e6aa 175 unsigned int i_pino; /* parent inode number */
39a53e0c
JK
176 umode_t i_acl_mode; /* keep file acl mode temporarily */
177
178 /* Use below internally in f2fs*/
179 unsigned long flags; /* use to pass per-file flags */
39a53e0c
JK
180 atomic_t dirty_dents; /* # of dirty dentry pages */
181 f2fs_hash_t chash; /* hash value of given file name */
182 unsigned int clevel; /* maximum level of given file name */
183 nid_t i_xattr_nid; /* node id that contains xattrs */
e518ff81 184 unsigned long long xattr_ver; /* cp version of xattr modification */
39a53e0c
JK
185 struct extent_info ext; /* in-memory extent cache entry */
186};
187
188static inline void get_extent_info(struct extent_info *ext,
189 struct f2fs_extent i_ext)
190{
191 write_lock(&ext->ext_lock);
192 ext->fofs = le32_to_cpu(i_ext.fofs);
193 ext->blk_addr = le32_to_cpu(i_ext.blk_addr);
194 ext->len = le32_to_cpu(i_ext.len);
195 write_unlock(&ext->ext_lock);
196}
197
198static inline void set_raw_extent(struct extent_info *ext,
199 struct f2fs_extent *i_ext)
200{
201 read_lock(&ext->ext_lock);
202 i_ext->fofs = cpu_to_le32(ext->fofs);
203 i_ext->blk_addr = cpu_to_le32(ext->blk_addr);
204 i_ext->len = cpu_to_le32(ext->len);
205 read_unlock(&ext->ext_lock);
206}
207
208struct f2fs_nm_info {
209 block_t nat_blkaddr; /* base disk address of NAT */
210 nid_t max_nid; /* maximum possible node ids */
39a53e0c
JK
211 nid_t next_scan_nid; /* the next nid to be scanned */
212
213 /* NAT cache management */
214 struct radix_tree_root nat_root;/* root of the nat entry cache */
215 rwlock_t nat_tree_lock; /* protect nat_tree_lock */
216 unsigned int nat_cnt; /* the # of cached nat entries */
217 struct list_head nat_entries; /* cached nat entry list (clean) */
218 struct list_head dirty_nat_entries; /* cached nat entry list (dirty) */
219
220 /* free node ids management */
221 struct list_head free_nid_list; /* a list for free nids */
222 spinlock_t free_nid_list_lock; /* protect free nid list */
223 unsigned int fcnt; /* the number of free node id */
224 struct mutex build_lock; /* lock for build free nids */
225
226 /* for checkpoint */
227 char *nat_bitmap; /* NAT bitmap pointer */
228 int bitmap_size; /* bitmap size */
229};
230
231/*
232 * this structure is used as one of function parameters.
233 * all the information are dedicated to a given direct node block determined
234 * by the data offset in a file.
235 */
236struct dnode_of_data {
237 struct inode *inode; /* vfs inode pointer */
238 struct page *inode_page; /* its inode page, NULL is possible */
239 struct page *node_page; /* cached direct node page */
240 nid_t nid; /* node id of the direct node block */
241 unsigned int ofs_in_node; /* data offset in the node page */
242 bool inode_page_locked; /* inode page is locked or not */
243 block_t data_blkaddr; /* block address of the node block */
244};
245
246static inline void set_new_dnode(struct dnode_of_data *dn, struct inode *inode,
247 struct page *ipage, struct page *npage, nid_t nid)
248{
d66d1f76 249 memset(dn, 0, sizeof(*dn));
39a53e0c
JK
250 dn->inode = inode;
251 dn->inode_page = ipage;
252 dn->node_page = npage;
253 dn->nid = nid;
39a53e0c
JK
254}
255
256/*
257 * For SIT manager
258 *
259 * By default, there are 6 active log areas across the whole main area.
260 * When considering hot and cold data separation to reduce cleaning overhead,
261 * we split 3 for data logs and 3 for node logs as hot, warm, and cold types,
262 * respectively.
263 * In the current design, you should not change the numbers intentionally.
264 * Instead, as a mount option such as active_logs=x, you can use 2, 4, and 6
265 * logs individually according to the underlying devices. (default: 6)
266 * Just in case, on-disk layout covers maximum 16 logs that consist of 8 for
267 * data and 8 for node logs.
268 */
269#define NR_CURSEG_DATA_TYPE (3)
270#define NR_CURSEG_NODE_TYPE (3)
271#define NR_CURSEG_TYPE (NR_CURSEG_DATA_TYPE + NR_CURSEG_NODE_TYPE)
272
273enum {
274 CURSEG_HOT_DATA = 0, /* directory entry blocks */
275 CURSEG_WARM_DATA, /* data blocks */
276 CURSEG_COLD_DATA, /* multimedia or GCed data blocks */
277 CURSEG_HOT_NODE, /* direct node blocks of directory files */
278 CURSEG_WARM_NODE, /* direct node blocks of normal files */
279 CURSEG_COLD_NODE, /* indirect node blocks */
280 NO_CHECK_TYPE
281};
282
283struct f2fs_sm_info {
284 struct sit_info *sit_info; /* whole segment information */
285 struct free_segmap_info *free_info; /* free segment information */
286 struct dirty_seglist_info *dirty_info; /* dirty segment information */
287 struct curseg_info *curseg_array; /* active segment information */
288
289 struct list_head wblist_head; /* list of under-writeback pages */
290 spinlock_t wblist_lock; /* lock for checkpoint */
291
292 block_t seg0_blkaddr; /* block address of 0'th segment */
293 block_t main_blkaddr; /* start block address of main area */
294 block_t ssa_blkaddr; /* start block address of SSA area */
295
296 unsigned int segment_count; /* total # of segments */
297 unsigned int main_segments; /* # of segments in main area */
298 unsigned int reserved_segments; /* # of reserved segments */
299 unsigned int ovp_segments; /* # of overprovision segments */
300};
301
302/*
303 * For directory operation
304 */
305#define NODE_DIR1_BLOCK (ADDRS_PER_INODE + 1)
306#define NODE_DIR2_BLOCK (ADDRS_PER_INODE + 2)
307#define NODE_IND1_BLOCK (ADDRS_PER_INODE + 3)
308#define NODE_IND2_BLOCK (ADDRS_PER_INODE + 4)
309#define NODE_DIND_BLOCK (ADDRS_PER_INODE + 5)
310
311/*
312 * For superblock
313 */
314/*
315 * COUNT_TYPE for monitoring
316 *
317 * f2fs monitors the number of several block types such as on-writeback,
318 * dirty dentry blocks, dirty node blocks, and dirty meta blocks.
319 */
320enum count_type {
321 F2FS_WRITEBACK,
322 F2FS_DIRTY_DENTS,
323 F2FS_DIRTY_NODES,
324 F2FS_DIRTY_META,
325 NR_COUNT_TYPE,
326};
327
328/*
39936837
JK
329 * Uses as sbi->fs_lock[NR_GLOBAL_LOCKS].
330 * The checkpoint procedure blocks all the locks in this fs_lock array.
331 * Some FS operations grab free locks, and if there is no free lock,
332 * then wait to grab a lock in a round-robin manner.
39a53e0c 333 */
39936837 334#define NR_GLOBAL_LOCKS 8
39a53e0c
JK
335
336/*
337 * The below are the page types of bios used in submti_bio().
338 * The available types are:
339 * DATA User data pages. It operates as async mode.
340 * NODE Node pages. It operates as async mode.
341 * META FS metadata pages such as SIT, NAT, CP.
342 * NR_PAGE_TYPE The number of page types.
343 * META_FLUSH Make sure the previous pages are written
344 * with waiting the bio's completion
345 * ... Only can be used with META.
346 */
347enum page_type {
348 DATA,
349 NODE,
350 META,
351 NR_PAGE_TYPE,
352 META_FLUSH,
353};
354
355struct f2fs_sb_info {
356 struct super_block *sb; /* pointer to VFS super block */
5e176d54 357 struct proc_dir_entry *s_proc; /* proc entry */
39a53e0c
JK
358 struct buffer_head *raw_super_buf; /* buffer head of raw sb */
359 struct f2fs_super_block *raw_super; /* raw super block pointer */
360 int s_dirty; /* dirty flag for checkpoint */
361
362 /* for node-related operations */
363 struct f2fs_nm_info *nm_info; /* node manager */
364 struct inode *node_inode; /* cache node blocks */
365
366 /* for segment-related operations */
367 struct f2fs_sm_info *sm_info; /* segment manager */
368 struct bio *bio[NR_PAGE_TYPE]; /* bios to merge */
369 sector_t last_block_in_bio[NR_PAGE_TYPE]; /* last block number */
370 struct rw_semaphore bio_sem; /* IO semaphore */
371
372 /* for checkpoint */
373 struct f2fs_checkpoint *ckpt; /* raw checkpoint pointer */
374 struct inode *meta_inode; /* cache meta blocks */
39936837
JK
375 struct mutex cp_mutex; /* checkpoint procedure lock */
376 struct mutex fs_lock[NR_GLOBAL_LOCKS]; /* blocking FS operations */
377 struct mutex node_write; /* locking node writes */
39a53e0c 378 struct mutex writepages; /* mutex for writepages() */
39936837 379 unsigned char next_lock_num; /* round-robin global locks */
39a53e0c 380 int por_doing; /* recovery is doing or not */
55008d84 381 int on_build_free_nids; /* build_free_nids is doing */
39a53e0c
JK
382
383 /* for orphan inode management */
384 struct list_head orphan_inode_list; /* orphan inode list */
385 struct mutex orphan_inode_mutex; /* for orphan inode list */
386 unsigned int n_orphans; /* # of orphan inodes */
387
388 /* for directory inode management */
389 struct list_head dir_inode_list; /* dir inode list */
390 spinlock_t dir_inode_lock; /* for dir inode list lock */
39a53e0c
JK
391
392 /* basic file system units */
393 unsigned int log_sectors_per_block; /* log2 sectors per block */
394 unsigned int log_blocksize; /* log2 block size */
395 unsigned int blocksize; /* block size */
396 unsigned int root_ino_num; /* root inode number*/
397 unsigned int node_ino_num; /* node inode number*/
398 unsigned int meta_ino_num; /* meta inode number*/
399 unsigned int log_blocks_per_seg; /* log2 blocks per segment */
400 unsigned int blocks_per_seg; /* blocks per segment */
401 unsigned int segs_per_sec; /* segments per section */
402 unsigned int secs_per_zone; /* sections per zone */
403 unsigned int total_sections; /* total section count */
404 unsigned int total_node_count; /* total node block count */
405 unsigned int total_valid_node_count; /* valid node block count */
406 unsigned int total_valid_inode_count; /* valid inode count */
407 int active_logs; /* # of active logs */
408
409 block_t user_block_count; /* # of user blocks */
410 block_t total_valid_block_count; /* # of valid blocks */
411 block_t alloc_valid_block_count; /* # of allocated blocks */
412 block_t last_valid_block_count; /* for recovery */
413 u32 s_next_generation; /* for NFS support */
414 atomic_t nr_pages[NR_COUNT_TYPE]; /* # of pages, see count_type */
415
416 struct f2fs_mount_info mount_opt; /* mount options */
417
418 /* for cleaning operations */
419 struct mutex gc_mutex; /* mutex for GC */
420 struct f2fs_gc_kthread *gc_thread; /* GC thread */
5ec4e49f 421 unsigned int cur_victim_sec; /* current victim section num */
39a53e0c
JK
422
423 /*
424 * for stat information.
425 * one is for the LFS mode, and the other is for the SSR mode.
426 */
35b09d82 427#ifdef CONFIG_F2FS_STAT_FS
39a53e0c
JK
428 struct f2fs_stat_info *stat_info; /* FS status information */
429 unsigned int segment_count[2]; /* # of allocated segments */
430 unsigned int block_count[2]; /* # of allocated blocks */
39a53e0c
JK
431 int total_hit_ext, read_hit_ext; /* extent cache hit ratio */
432 int bg_gc; /* background gc calls */
35b09d82
NJ
433 unsigned int n_dirty_dirs; /* # of dir inodes */
434#endif
435 unsigned int last_victim[2]; /* last victim segment # */
39a53e0c 436 spinlock_t stat_lock; /* lock for stat operations */
b59d0bae
NJ
437
438 /* For sysfs suppport */
439 struct kobject s_kobj;
440 struct completion s_kobj_unregister;
39a53e0c
JK
441};
442
443/*
444 * Inline functions
445 */
446static inline struct f2fs_inode_info *F2FS_I(struct inode *inode)
447{
448 return container_of(inode, struct f2fs_inode_info, vfs_inode);
449}
450
451static inline struct f2fs_sb_info *F2FS_SB(struct super_block *sb)
452{
453 return sb->s_fs_info;
454}
455
456static inline struct f2fs_super_block *F2FS_RAW_SUPER(struct f2fs_sb_info *sbi)
457{
458 return (struct f2fs_super_block *)(sbi->raw_super);
459}
460
461static inline struct f2fs_checkpoint *F2FS_CKPT(struct f2fs_sb_info *sbi)
462{
463 return (struct f2fs_checkpoint *)(sbi->ckpt);
464}
465
45590710
GZ
466static inline struct f2fs_node *F2FS_NODE(struct page *page)
467{
468 return (struct f2fs_node *)page_address(page);
469}
470
39a53e0c
JK
471static inline struct f2fs_nm_info *NM_I(struct f2fs_sb_info *sbi)
472{
473 return (struct f2fs_nm_info *)(sbi->nm_info);
474}
475
476static inline struct f2fs_sm_info *SM_I(struct f2fs_sb_info *sbi)
477{
478 return (struct f2fs_sm_info *)(sbi->sm_info);
479}
480
481static inline struct sit_info *SIT_I(struct f2fs_sb_info *sbi)
482{
483 return (struct sit_info *)(SM_I(sbi)->sit_info);
484}
485
486static inline struct free_segmap_info *FREE_I(struct f2fs_sb_info *sbi)
487{
488 return (struct free_segmap_info *)(SM_I(sbi)->free_info);
489}
490
491static inline struct dirty_seglist_info *DIRTY_I(struct f2fs_sb_info *sbi)
492{
493 return (struct dirty_seglist_info *)(SM_I(sbi)->dirty_info);
494}
495
496static inline void F2FS_SET_SB_DIRT(struct f2fs_sb_info *sbi)
497{
498 sbi->s_dirty = 1;
499}
500
501static inline void F2FS_RESET_SB_DIRT(struct f2fs_sb_info *sbi)
502{
503 sbi->s_dirty = 0;
504}
505
25ca923b
JK
506static inline bool is_set_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f)
507{
508 unsigned int ckpt_flags = le32_to_cpu(cp->ckpt_flags);
509 return ckpt_flags & f;
510}
511
512static inline void set_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f)
513{
514 unsigned int ckpt_flags = le32_to_cpu(cp->ckpt_flags);
515 ckpt_flags |= f;
516 cp->ckpt_flags = cpu_to_le32(ckpt_flags);
517}
518
519static inline void clear_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f)
520{
521 unsigned int ckpt_flags = le32_to_cpu(cp->ckpt_flags);
522 ckpt_flags &= (~f);
523 cp->ckpt_flags = cpu_to_le32(ckpt_flags);
524}
525
39936837
JK
526static inline void mutex_lock_all(struct f2fs_sb_info *sbi)
527{
bfe35965
PZ
528 int i;
529
530 for (i = 0; i < NR_GLOBAL_LOCKS; i++) {
531 /*
532 * This is the only time we take multiple fs_lock[]
533 * instances; the order is immaterial since we
534 * always hold cp_mutex, which serializes multiple
535 * such operations.
536 */
537 mutex_lock_nest_lock(&sbi->fs_lock[i], &sbi->cp_mutex);
538 }
39936837
JK
539}
540
541static inline void mutex_unlock_all(struct f2fs_sb_info *sbi)
39a53e0c 542{
39936837
JK
543 int i = 0;
544 for (; i < NR_GLOBAL_LOCKS; i++)
545 mutex_unlock(&sbi->fs_lock[i]);
39a53e0c
JK
546}
547
39936837 548static inline int mutex_lock_op(struct f2fs_sb_info *sbi)
39a53e0c 549{
39936837
JK
550 unsigned char next_lock = sbi->next_lock_num % NR_GLOBAL_LOCKS;
551 int i = 0;
552
553 for (; i < NR_GLOBAL_LOCKS; i++)
554 if (mutex_trylock(&sbi->fs_lock[i]))
555 return i;
556
557 mutex_lock(&sbi->fs_lock[next_lock]);
558 sbi->next_lock_num++;
559 return next_lock;
560}
561
562static inline void mutex_unlock_op(struct f2fs_sb_info *sbi, int ilock)
563{
564 if (ilock < 0)
565 return;
566 BUG_ON(ilock >= NR_GLOBAL_LOCKS);
567 mutex_unlock(&sbi->fs_lock[ilock]);
39a53e0c
JK
568}
569
570/*
571 * Check whether the given nid is within node id range.
572 */
064e0823 573static inline int check_nid_range(struct f2fs_sb_info *sbi, nid_t nid)
39a53e0c 574{
064e0823
NJ
575 WARN_ON((nid >= NM_I(sbi)->max_nid));
576 if (nid >= NM_I(sbi)->max_nid)
577 return -EINVAL;
578 return 0;
39a53e0c
JK
579}
580
581#define F2FS_DEFAULT_ALLOCATED_BLOCKS 1
582
583/*
584 * Check whether the inode has blocks or not
585 */
586static inline int F2FS_HAS_BLOCKS(struct inode *inode)
587{
588 if (F2FS_I(inode)->i_xattr_nid)
589 return (inode->i_blocks > F2FS_DEFAULT_ALLOCATED_BLOCKS + 1);
590 else
591 return (inode->i_blocks > F2FS_DEFAULT_ALLOCATED_BLOCKS);
592}
593
594static inline bool inc_valid_block_count(struct f2fs_sb_info *sbi,
595 struct inode *inode, blkcnt_t count)
596{
597 block_t valid_block_count;
598
599 spin_lock(&sbi->stat_lock);
600 valid_block_count =
601 sbi->total_valid_block_count + (block_t)count;
602 if (valid_block_count > sbi->user_block_count) {
603 spin_unlock(&sbi->stat_lock);
604 return false;
605 }
606 inode->i_blocks += count;
607 sbi->total_valid_block_count = valid_block_count;
608 sbi->alloc_valid_block_count += (block_t)count;
609 spin_unlock(&sbi->stat_lock);
610 return true;
611}
612
613static inline int dec_valid_block_count(struct f2fs_sb_info *sbi,
614 struct inode *inode,
615 blkcnt_t count)
616{
617 spin_lock(&sbi->stat_lock);
618 BUG_ON(sbi->total_valid_block_count < (block_t) count);
619 BUG_ON(inode->i_blocks < count);
620 inode->i_blocks -= count;
621 sbi->total_valid_block_count -= (block_t)count;
622 spin_unlock(&sbi->stat_lock);
623 return 0;
624}
625
626static inline void inc_page_count(struct f2fs_sb_info *sbi, int count_type)
627{
628 atomic_inc(&sbi->nr_pages[count_type]);
629 F2FS_SET_SB_DIRT(sbi);
630}
631
632static inline void inode_inc_dirty_dents(struct inode *inode)
633{
634 atomic_inc(&F2FS_I(inode)->dirty_dents);
635}
636
637static inline void dec_page_count(struct f2fs_sb_info *sbi, int count_type)
638{
639 atomic_dec(&sbi->nr_pages[count_type]);
640}
641
642static inline void inode_dec_dirty_dents(struct inode *inode)
643{
644 atomic_dec(&F2FS_I(inode)->dirty_dents);
645}
646
647static inline int get_pages(struct f2fs_sb_info *sbi, int count_type)
648{
649 return atomic_read(&sbi->nr_pages[count_type]);
650}
651
5ac206cf
NJ
652static inline int get_blocktype_secs(struct f2fs_sb_info *sbi, int block_type)
653{
654 unsigned int pages_per_sec = sbi->segs_per_sec *
655 (1 << sbi->log_blocks_per_seg);
656 return ((get_pages(sbi, block_type) + pages_per_sec - 1)
657 >> sbi->log_blocks_per_seg) / sbi->segs_per_sec;
658}
659
39a53e0c
JK
660static inline block_t valid_user_blocks(struct f2fs_sb_info *sbi)
661{
662 block_t ret;
663 spin_lock(&sbi->stat_lock);
664 ret = sbi->total_valid_block_count;
665 spin_unlock(&sbi->stat_lock);
666 return ret;
667}
668
669static inline unsigned long __bitmap_size(struct f2fs_sb_info *sbi, int flag)
670{
671 struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi);
672
673 /* return NAT or SIT bitmap */
674 if (flag == NAT_BITMAP)
675 return le32_to_cpu(ckpt->nat_ver_bitmap_bytesize);
676 else if (flag == SIT_BITMAP)
677 return le32_to_cpu(ckpt->sit_ver_bitmap_bytesize);
678
679 return 0;
680}
681
682static inline void *__bitmap_ptr(struct f2fs_sb_info *sbi, int flag)
683{
684 struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi);
25ca923b
JK
685 int offset = (flag == NAT_BITMAP) ?
686 le32_to_cpu(ckpt->sit_ver_bitmap_bytesize) : 0;
39a53e0c
JK
687 return &ckpt->sit_nat_version_bitmap + offset;
688}
689
690static inline block_t __start_cp_addr(struct f2fs_sb_info *sbi)
691{
692 block_t start_addr;
693 struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi);
694 unsigned long long ckpt_version = le64_to_cpu(ckpt->checkpoint_ver);
695
25ca923b 696 start_addr = le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_blkaddr);
39a53e0c
JK
697
698 /*
699 * odd numbered checkpoint should at cp segment 0
700 * and even segent must be at cp segment 1
701 */
702 if (!(ckpt_version & 1))
703 start_addr += sbi->blocks_per_seg;
704
705 return start_addr;
706}
707
708static inline block_t __start_sum_addr(struct f2fs_sb_info *sbi)
709{
710 return le32_to_cpu(F2FS_CKPT(sbi)->cp_pack_start_sum);
711}
712
713static inline bool inc_valid_node_count(struct f2fs_sb_info *sbi,
714 struct inode *inode,
715 unsigned int count)
716{
717 block_t valid_block_count;
718 unsigned int valid_node_count;
719
720 spin_lock(&sbi->stat_lock);
721
722 valid_block_count = sbi->total_valid_block_count + (block_t)count;
723 sbi->alloc_valid_block_count += (block_t)count;
724 valid_node_count = sbi->total_valid_node_count + count;
725
726 if (valid_block_count > sbi->user_block_count) {
727 spin_unlock(&sbi->stat_lock);
728 return false;
729 }
730
731 if (valid_node_count > sbi->total_node_count) {
732 spin_unlock(&sbi->stat_lock);
733 return false;
734 }
735
736 if (inode)
737 inode->i_blocks += count;
738 sbi->total_valid_node_count = valid_node_count;
739 sbi->total_valid_block_count = valid_block_count;
740 spin_unlock(&sbi->stat_lock);
741
742 return true;
743}
744
745static inline void dec_valid_node_count(struct f2fs_sb_info *sbi,
746 struct inode *inode,
747 unsigned int count)
748{
749 spin_lock(&sbi->stat_lock);
750
751 BUG_ON(sbi->total_valid_block_count < count);
752 BUG_ON(sbi->total_valid_node_count < count);
753 BUG_ON(inode->i_blocks < count);
754
755 inode->i_blocks -= count;
756 sbi->total_valid_node_count -= count;
757 sbi->total_valid_block_count -= (block_t)count;
758
759 spin_unlock(&sbi->stat_lock);
760}
761
762static inline unsigned int valid_node_count(struct f2fs_sb_info *sbi)
763{
764 unsigned int ret;
765 spin_lock(&sbi->stat_lock);
766 ret = sbi->total_valid_node_count;
767 spin_unlock(&sbi->stat_lock);
768 return ret;
769}
770
771static inline void inc_valid_inode_count(struct f2fs_sb_info *sbi)
772{
773 spin_lock(&sbi->stat_lock);
774 BUG_ON(sbi->total_valid_inode_count == sbi->total_node_count);
775 sbi->total_valid_inode_count++;
776 spin_unlock(&sbi->stat_lock);
777}
778
779static inline int dec_valid_inode_count(struct f2fs_sb_info *sbi)
780{
781 spin_lock(&sbi->stat_lock);
782 BUG_ON(!sbi->total_valid_inode_count);
783 sbi->total_valid_inode_count--;
784 spin_unlock(&sbi->stat_lock);
785 return 0;
786}
787
788static inline unsigned int valid_inode_count(struct f2fs_sb_info *sbi)
789{
790 unsigned int ret;
791 spin_lock(&sbi->stat_lock);
792 ret = sbi->total_valid_inode_count;
793 spin_unlock(&sbi->stat_lock);
794 return ret;
795}
796
797static inline void f2fs_put_page(struct page *page, int unlock)
798{
799 if (!page || IS_ERR(page))
800 return;
801
802 if (unlock) {
803 BUG_ON(!PageLocked(page));
804 unlock_page(page);
805 }
806 page_cache_release(page);
807}
808
809static inline void f2fs_put_dnode(struct dnode_of_data *dn)
810{
811 if (dn->node_page)
812 f2fs_put_page(dn->node_page, 1);
813 if (dn->inode_page && dn->node_page != dn->inode_page)
814 f2fs_put_page(dn->inode_page, 0);
815 dn->node_page = NULL;
816 dn->inode_page = NULL;
817}
818
819static inline struct kmem_cache *f2fs_kmem_cache_create(const char *name,
820 size_t size, void (*ctor)(void *))
821{
822 return kmem_cache_create(name, size, 0, SLAB_RECLAIM_ACCOUNT, ctor);
823}
824
825#define RAW_IS_INODE(p) ((p)->footer.nid == (p)->footer.ino)
826
827static inline bool IS_INODE(struct page *page)
828{
45590710 829 struct f2fs_node *p = F2FS_NODE(page);
39a53e0c
JK
830 return RAW_IS_INODE(p);
831}
832
833static inline __le32 *blkaddr_in_node(struct f2fs_node *node)
834{
835 return RAW_IS_INODE(node) ? node->i.i_addr : node->dn.addr;
836}
837
838static inline block_t datablock_addr(struct page *node_page,
839 unsigned int offset)
840{
841 struct f2fs_node *raw_node;
842 __le32 *addr_array;
45590710 843 raw_node = F2FS_NODE(node_page);
39a53e0c
JK
844 addr_array = blkaddr_in_node(raw_node);
845 return le32_to_cpu(addr_array[offset]);
846}
847
848static inline int f2fs_test_bit(unsigned int nr, char *addr)
849{
850 int mask;
851
852 addr += (nr >> 3);
853 mask = 1 << (7 - (nr & 0x07));
854 return mask & *addr;
855}
856
857static inline int f2fs_set_bit(unsigned int nr, char *addr)
858{
859 int mask;
860 int ret;
861
862 addr += (nr >> 3);
863 mask = 1 << (7 - (nr & 0x07));
864 ret = mask & *addr;
865 *addr |= mask;
866 return ret;
867}
868
869static inline int f2fs_clear_bit(unsigned int nr, char *addr)
870{
871 int mask;
872 int ret;
873
874 addr += (nr >> 3);
875 mask = 1 << (7 - (nr & 0x07));
876 ret = mask & *addr;
877 *addr &= ~mask;
878 return ret;
879}
880
881/* used for f2fs_inode_info->flags */
882enum {
883 FI_NEW_INODE, /* indicate newly allocated inode */
b3783873 884 FI_DIRTY_INODE, /* indicate inode is dirty or not */
39a53e0c
JK
885 FI_INC_LINK, /* need to increment i_nlink */
886 FI_ACL_MODE, /* indicate acl mode */
887 FI_NO_ALLOC, /* should not allocate any blocks */
699489bb 888 FI_UPDATE_DIR, /* should update inode block for consistency */
74d0b917 889 FI_DELAY_IPUT, /* used for the recovery */
39a53e0c
JK
890};
891
892static inline void set_inode_flag(struct f2fs_inode_info *fi, int flag)
893{
894 set_bit(flag, &fi->flags);
895}
896
897static inline int is_inode_flag_set(struct f2fs_inode_info *fi, int flag)
898{
899 return test_bit(flag, &fi->flags);
900}
901
902static inline void clear_inode_flag(struct f2fs_inode_info *fi, int flag)
903{
904 clear_bit(flag, &fi->flags);
905}
906
907static inline void set_acl_inode(struct f2fs_inode_info *fi, umode_t mode)
908{
909 fi->i_acl_mode = mode;
910 set_inode_flag(fi, FI_ACL_MODE);
911}
912
913static inline int cond_clear_inode_flag(struct f2fs_inode_info *fi, int flag)
914{
915 if (is_inode_flag_set(fi, FI_ACL_MODE)) {
916 clear_inode_flag(fi, FI_ACL_MODE);
917 return 1;
918 }
919 return 0;
920}
921
77888c1e
JK
922static inline int f2fs_readonly(struct super_block *sb)
923{
924 return sb->s_flags & MS_RDONLY;
925}
926
39a53e0c
JK
927/*
928 * file.c
929 */
930int f2fs_sync_file(struct file *, loff_t, loff_t, int);
931void truncate_data_blocks(struct dnode_of_data *);
932void f2fs_truncate(struct inode *);
2d4d9fb5 933int f2fs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
39a53e0c
JK
934int f2fs_setattr(struct dentry *, struct iattr *);
935int truncate_hole(struct inode *, pgoff_t, pgoff_t);
b292dcab 936int truncate_data_blocks_range(struct dnode_of_data *, int);
39a53e0c 937long f2fs_ioctl(struct file *, unsigned int, unsigned long);
e9750824 938long f2fs_compat_ioctl(struct file *, unsigned int, unsigned long);
39a53e0c
JK
939
940/*
941 * inode.c
942 */
943void f2fs_set_inode_flags(struct inode *);
39a53e0c
JK
944struct inode *f2fs_iget(struct super_block *, unsigned long);
945void update_inode(struct inode *, struct page *);
39936837 946int update_inode_page(struct inode *);
39a53e0c
JK
947int f2fs_write_inode(struct inode *, struct writeback_control *);
948void f2fs_evict_inode(struct inode *);
949
950/*
951 * namei.c
952 */
953struct dentry *f2fs_get_parent(struct dentry *child);
954
955/*
956 * dir.c
957 */
958struct f2fs_dir_entry *f2fs_find_entry(struct inode *, struct qstr *,
959 struct page **);
960struct f2fs_dir_entry *f2fs_parent_dir(struct inode *, struct page **);
961ino_t f2fs_inode_by_name(struct inode *, struct qstr *);
962void f2fs_set_link(struct inode *, struct f2fs_dir_entry *,
963 struct page *, struct inode *);
1cd14caf 964int update_dent_inode(struct inode *, const struct qstr *);
b7f7a5e0 965int __f2fs_add_link(struct inode *, const struct qstr *, struct inode *);
39a53e0c
JK
966void f2fs_delete_entry(struct f2fs_dir_entry *, struct page *, struct inode *);
967int f2fs_make_empty(struct inode *, struct inode *);
968bool f2fs_empty_dir(struct inode *);
969
b7f7a5e0
AV
970static inline int f2fs_add_link(struct dentry *dentry, struct inode *inode)
971{
972 return __f2fs_add_link(dentry->d_parent->d_inode, &dentry->d_name,
973 inode);
974}
975
39a53e0c
JK
976/*
977 * super.c
978 */
979int f2fs_sync_fs(struct super_block *, int);
a07ef784
NJ
980extern __printf(3, 4)
981void f2fs_msg(struct super_block *, const char *, const char *, ...);
39a53e0c
JK
982
983/*
984 * hash.c
985 */
9836b8b9 986f2fs_hash_t f2fs_dentry_hash(const char *, size_t);
39a53e0c
JK
987
988/*
989 * node.c
990 */
991struct dnode_of_data;
992struct node_info;
993
994int is_checkpointed_node(struct f2fs_sb_info *, nid_t);
995void get_node_info(struct f2fs_sb_info *, nid_t, struct node_info *);
996int get_dnode_of_data(struct dnode_of_data *, pgoff_t, int);
997int truncate_inode_blocks(struct inode *, pgoff_t);
998int remove_inode_page(struct inode *);
44a83ff6 999struct page *new_inode_page(struct inode *, const struct qstr *);
8ae8f162 1000struct page *new_node_page(struct dnode_of_data *, unsigned int, struct page *);
39a53e0c
JK
1001void ra_node_page(struct f2fs_sb_info *, nid_t);
1002struct page *get_node_page(struct f2fs_sb_info *, pgoff_t);
1003struct page *get_node_page_ra(struct page *, int);
1004void sync_inode_page(struct dnode_of_data *);
1005int sync_node_pages(struct f2fs_sb_info *, nid_t, struct writeback_control *);
1006bool alloc_nid(struct f2fs_sb_info *, nid_t *);
1007void alloc_nid_done(struct f2fs_sb_info *, nid_t);
1008void alloc_nid_failed(struct f2fs_sb_info *, nid_t);
1009void recover_node_page(struct f2fs_sb_info *, struct page *,
1010 struct f2fs_summary *, struct node_info *, block_t);
1011int recover_inode_page(struct f2fs_sb_info *, struct page *);
1012int restore_node_summary(struct f2fs_sb_info *, unsigned int,
1013 struct f2fs_summary_block *);
1014void flush_nat_entries(struct f2fs_sb_info *);
1015int build_node_manager(struct f2fs_sb_info *);
1016void destroy_node_manager(struct f2fs_sb_info *);
6e6093a8 1017int __init create_node_manager_caches(void);
39a53e0c
JK
1018void destroy_node_manager_caches(void);
1019
1020/*
1021 * segment.c
1022 */
1023void f2fs_balance_fs(struct f2fs_sb_info *);
1024void invalidate_blocks(struct f2fs_sb_info *, block_t);
39a53e0c
JK
1025void clear_prefree_segments(struct f2fs_sb_info *);
1026int npages_for_summary_flush(struct f2fs_sb_info *);
1027void allocate_new_segments(struct f2fs_sb_info *);
1028struct page *get_sum_page(struct f2fs_sb_info *, unsigned int);
3cd8a239 1029struct bio *f2fs_bio_alloc(struct block_device *, int);
a569469e
JX
1030void f2fs_submit_bio(struct f2fs_sb_info *, enum page_type, bool);
1031void f2fs_wait_on_page_writeback(struct page *, enum page_type, bool);
577e3495 1032void write_meta_page(struct f2fs_sb_info *, struct page *);
39a53e0c
JK
1033void write_node_page(struct f2fs_sb_info *, struct page *, unsigned int,
1034 block_t, block_t *);
1035void write_data_page(struct inode *, struct page *, struct dnode_of_data*,
1036 block_t, block_t *);
1037void rewrite_data_page(struct f2fs_sb_info *, struct page *, block_t);
1038void recover_data_page(struct f2fs_sb_info *, struct page *,
1039 struct f2fs_summary *, block_t, block_t);
1040void rewrite_node_page(struct f2fs_sb_info *, struct page *,
1041 struct f2fs_summary *, block_t, block_t);
1042void write_data_summaries(struct f2fs_sb_info *, block_t);
1043void write_node_summaries(struct f2fs_sb_info *, block_t);
1044int lookup_journal_in_cursum(struct f2fs_summary_block *,
1045 int, unsigned int, int);
1046void flush_sit_entries(struct f2fs_sb_info *);
1047int build_segment_manager(struct f2fs_sb_info *);
39a53e0c
JK
1048void destroy_segment_manager(struct f2fs_sb_info *);
1049
1050/*
1051 * checkpoint.c
1052 */
1053struct page *grab_meta_page(struct f2fs_sb_info *, pgoff_t);
1054struct page *get_meta_page(struct f2fs_sb_info *, pgoff_t);
1055long sync_meta_pages(struct f2fs_sb_info *, enum page_type, long);
cbd56e7d
JK
1056int acquire_orphan_inode(struct f2fs_sb_info *);
1057void release_orphan_inode(struct f2fs_sb_info *);
39a53e0c
JK
1058void add_orphan_inode(struct f2fs_sb_info *, nid_t);
1059void remove_orphan_inode(struct f2fs_sb_info *, nid_t);
1060int recover_orphan_inodes(struct f2fs_sb_info *);
1061int get_valid_checkpoint(struct f2fs_sb_info *);
1062void set_dirty_dir_page(struct inode *, struct page *);
5deb8267 1063void add_dirty_dir_inode(struct inode *);
39a53e0c 1064void remove_dirty_dir_inode(struct inode *);
74d0b917 1065struct inode *check_dirty_dir_inode(struct f2fs_sb_info *, nid_t);
39a53e0c 1066void sync_dirty_dir_inodes(struct f2fs_sb_info *);
43727527 1067void write_checkpoint(struct f2fs_sb_info *, bool);
39a53e0c 1068void init_orphan_info(struct f2fs_sb_info *);
6e6093a8 1069int __init create_checkpoint_caches(void);
39a53e0c
JK
1070void destroy_checkpoint_caches(void);
1071
1072/*
1073 * data.c
1074 */
1075int reserve_new_block(struct dnode_of_data *);
1076void update_extent_cache(block_t, struct dnode_of_data *);
c718379b 1077struct page *find_data_page(struct inode *, pgoff_t, bool);
39a53e0c 1078struct page *get_lock_data_page(struct inode *, pgoff_t);
64aa7ed9 1079struct page *get_new_data_page(struct inode *, struct page *, pgoff_t, bool);
39a53e0c
JK
1080int f2fs_readpage(struct f2fs_sb_info *, struct page *, block_t, int);
1081int do_write_data_page(struct page *);
1082
1083/*
1084 * gc.c
1085 */
1086int start_gc_thread(struct f2fs_sb_info *);
1087void stop_gc_thread(struct f2fs_sb_info *);
1088block_t start_bidx_of_node(unsigned int);
408e9375 1089int f2fs_gc(struct f2fs_sb_info *);
39a53e0c 1090void build_gc_manager(struct f2fs_sb_info *);
6e6093a8 1091int __init create_gc_caches(void);
39a53e0c
JK
1092void destroy_gc_caches(void);
1093
1094/*
1095 * recovery.c
1096 */
6ead1142 1097int recover_fsync_data(struct f2fs_sb_info *);
39a53e0c
JK
1098bool space_for_roll_forward(struct f2fs_sb_info *);
1099
1100/*
1101 * debug.c
1102 */
1103#ifdef CONFIG_F2FS_STAT_FS
1104struct f2fs_stat_info {
1105 struct list_head stat_list;
1106 struct f2fs_sb_info *sbi;
1107 struct mutex stat_lock;
1108 int all_area_segs, sit_area_segs, nat_area_segs, ssa_area_segs;
1109 int main_area_segs, main_area_sections, main_area_zones;
1110 int hit_ext, total_ext;
1111 int ndirty_node, ndirty_dent, ndirty_dirs, ndirty_meta;
1112 int nats, sits, fnids;
1113 int total_count, utilization;
1114 int bg_gc;
1115 unsigned int valid_count, valid_node_count, valid_inode_count;
1116 unsigned int bimodal, avg_vblocks;
1117 int util_free, util_valid, util_invalid;
1118 int rsvd_segs, overp_segs;
1119 int dirty_count, node_pages, meta_pages;
1120 int prefree_count, call_count;
1121 int tot_segs, node_segs, data_segs, free_segs, free_secs;
1122 int tot_blks, data_blks, node_blks;
1123 int curseg[NR_CURSEG_TYPE];
1124 int cursec[NR_CURSEG_TYPE];
1125 int curzone[NR_CURSEG_TYPE];
1126
1127 unsigned int segment_count[2];
1128 unsigned int block_count[2];
1129 unsigned base_mem, cache_mem;
1130};
1131
963d4f7d
GZ
1132static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi)
1133{
1134 return (struct f2fs_stat_info*)sbi->stat_info;
1135}
1136
39a53e0c
JK
1137#define stat_inc_call_count(si) ((si)->call_count++)
1138
1139#define stat_inc_seg_count(sbi, type) \
1140 do { \
963d4f7d 1141 struct f2fs_stat_info *si = F2FS_STAT(sbi); \
39a53e0c
JK
1142 (si)->tot_segs++; \
1143 if (type == SUM_TYPE_DATA) \
1144 si->data_segs++; \
1145 else \
1146 si->node_segs++; \
1147 } while (0)
1148
1149#define stat_inc_tot_blk_count(si, blks) \
1150 (si->tot_blks += (blks))
1151
1152#define stat_inc_data_blk_count(sbi, blks) \
1153 do { \
963d4f7d 1154 struct f2fs_stat_info *si = F2FS_STAT(sbi); \
39a53e0c
JK
1155 stat_inc_tot_blk_count(si, blks); \
1156 si->data_blks += (blks); \
1157 } while (0)
1158
1159#define stat_inc_node_blk_count(sbi, blks) \
1160 do { \
963d4f7d 1161 struct f2fs_stat_info *si = F2FS_STAT(sbi); \
39a53e0c
JK
1162 stat_inc_tot_blk_count(si, blks); \
1163 si->node_blks += (blks); \
1164 } while (0)
1165
1166int f2fs_build_stats(struct f2fs_sb_info *);
1167void f2fs_destroy_stats(struct f2fs_sb_info *);
6e6093a8 1168void __init f2fs_create_root_stats(void);
4589d25d 1169void f2fs_destroy_root_stats(void);
39a53e0c
JK
1170#else
1171#define stat_inc_call_count(si)
1172#define stat_inc_seg_count(si, type)
1173#define stat_inc_tot_blk_count(si, blks)
1174#define stat_inc_data_blk_count(si, blks)
1175#define stat_inc_node_blk_count(sbi, blks)
1176
1177static inline int f2fs_build_stats(struct f2fs_sb_info *sbi) { return 0; }
1178static inline void f2fs_destroy_stats(struct f2fs_sb_info *sbi) { }
6e6093a8 1179static inline void __init f2fs_create_root_stats(void) { }
4589d25d 1180static inline void f2fs_destroy_root_stats(void) { }
39a53e0c
JK
1181#endif
1182
1183extern const struct file_operations f2fs_dir_operations;
1184extern const struct file_operations f2fs_file_operations;
1185extern const struct inode_operations f2fs_file_inode_operations;
1186extern const struct address_space_operations f2fs_dblock_aops;
1187extern const struct address_space_operations f2fs_node_aops;
1188extern const struct address_space_operations f2fs_meta_aops;
1189extern const struct inode_operations f2fs_dir_inode_operations;
1190extern const struct inode_operations f2fs_symlink_inode_operations;
1191extern const struct inode_operations f2fs_special_inode_operations;
1192#endif
This page took 0.095361 seconds and 5 git commands to generate.