.. | .. |
---|
38 | 38 | /* return value for read_node_page */ |
---|
39 | 39 | #define LOCKED_PAGE 1 |
---|
40 | 40 | |
---|
| 41 | +/* check pinned file's alignment status of physical blocks */ |
---|
| 42 | +#define FILE_NOT_ALIGNED 1 |
---|
| 43 | + |
---|
41 | 44 | /* For flag in struct node_info */ |
---|
42 | 45 | enum { |
---|
43 | 46 | IS_CHECKPOINTED, /* is it checkpointed before? */ |
---|
.. | .. |
---|
126 | 129 | |
---|
127 | 130 | static inline bool excess_dirty_nats(struct f2fs_sb_info *sbi) |
---|
128 | 131 | { |
---|
129 | | - return NM_I(sbi)->dirty_nat_cnt >= NM_I(sbi)->max_nid * |
---|
| 132 | + return NM_I(sbi)->nat_cnt[DIRTY_NAT] >= NM_I(sbi)->max_nid * |
---|
130 | 133 | NM_I(sbi)->dirty_nats_ratio / 100; |
---|
131 | 134 | } |
---|
132 | 135 | |
---|
133 | 136 | static inline bool excess_cached_nats(struct f2fs_sb_info *sbi) |
---|
134 | 137 | { |
---|
135 | | - return NM_I(sbi)->nat_cnt >= DEF_NAT_CACHE_THRESHOLD; |
---|
| 138 | + return NM_I(sbi)->nat_cnt[TOTAL_NAT] >= DEF_NAT_CACHE_THRESHOLD; |
---|
136 | 139 | } |
---|
137 | 140 | |
---|
138 | 141 | static inline bool excess_dirty_nodes(struct f2fs_sb_info *sbi) |
---|
.. | .. |
---|
145 | 148 | NAT_ENTRIES, /* indicates the cached nat entry */ |
---|
146 | 149 | DIRTY_DENTS, /* indicates dirty dentry pages */ |
---|
147 | 150 | INO_ENTRIES, /* indicates inode entries */ |
---|
148 | | - EXTENT_CACHE, /* indicates extent cache */ |
---|
| 151 | + READ_EXTENT_CACHE, /* indicates read extent cache */ |
---|
| 152 | + AGE_EXTENT_CACHE, /* indicates age extent cache */ |
---|
149 | 153 | INMEM_PAGES, /* indicates inmemory pages */ |
---|
| 154 | + DISCARD_CACHE, /* indicates memory of cached discard cmds */ |
---|
| 155 | + COMPRESS_PAGE, /* indicates memory of cached compressed pages */ |
---|
150 | 156 | BASE_CHECK, /* check kernel status */ |
---|
151 | 157 | }; |
---|
152 | 158 | |
---|
.. | .. |
---|
388 | 394 | * - Mark cold node blocks in their node footer |
---|
389 | 395 | * - Mark cold data pages in page cache |
---|
390 | 396 | */ |
---|
391 | | -static inline int is_cold_data(struct page *page) |
---|
392 | | -{ |
---|
393 | | - return PageChecked(page); |
---|
394 | | -} |
---|
395 | | - |
---|
396 | | -static inline void set_cold_data(struct page *page) |
---|
397 | | -{ |
---|
398 | | - SetPageChecked(page); |
---|
399 | | -} |
---|
400 | | - |
---|
401 | | -static inline void clear_cold_data(struct page *page) |
---|
402 | | -{ |
---|
403 | | - ClearPageChecked(page); |
---|
404 | | -} |
---|
405 | 397 | |
---|
406 | 398 | static inline int is_node(struct page *page, int type) |
---|
407 | 399 | { |
---|
.. | .. |
---|
412 | 404 | #define is_cold_node(page) is_node(page, COLD_BIT_SHIFT) |
---|
413 | 405 | #define is_fsync_dnode(page) is_node(page, FSYNC_BIT_SHIFT) |
---|
414 | 406 | #define is_dent_dnode(page) is_node(page, DENT_BIT_SHIFT) |
---|
415 | | - |
---|
416 | | -static inline int is_inline_node(struct page *page) |
---|
417 | | -{ |
---|
418 | | - return PageChecked(page); |
---|
419 | | -} |
---|
420 | | - |
---|
421 | | -static inline void set_inline_node(struct page *page) |
---|
422 | | -{ |
---|
423 | | - SetPageChecked(page); |
---|
424 | | -} |
---|
425 | | - |
---|
426 | | -static inline void clear_inline_node(struct page *page) |
---|
427 | | -{ |
---|
428 | | - ClearPageChecked(page); |
---|
429 | | -} |
---|
430 | 407 | |
---|
431 | 408 | static inline void set_cold_node(struct page *page, bool is_dir) |
---|
432 | 409 | { |
---|