Jaegeuk Kim | 0a8165d | 2012-11-29 13:28:09 +0900 | [diff] [blame] | 1 | /* |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 2 | * fs/f2fs/node.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 | /* start node id of a node block dedicated to the given node id */ |
| 12 | #define START_NID(nid) ((nid / NAT_ENTRY_PER_BLOCK) * NAT_ENTRY_PER_BLOCK) |
| 13 | |
| 14 | /* node block offset on the NAT area dedicated to the given start node id */ |
| 15 | #define NAT_BLOCK_OFFSET(start_nid) (start_nid / NAT_ENTRY_PER_BLOCK) |
| 16 | |
| 17 | /* # of pages to perform readahead before building free nids */ |
| 18 | #define FREE_NID_PAGES 4 |
| 19 | |
| 20 | /* maximum # of free node ids to produce during build_free_nids */ |
| 21 | #define MAX_FREE_NIDS (NAT_ENTRY_PER_BLOCK * FREE_NID_PAGES) |
| 22 | |
| 23 | /* maximum readahead size for node during getting data blocks */ |
| 24 | #define MAX_RA_NODE 128 |
| 25 | |
| 26 | /* maximum cached nat entries to manage memory footprint */ |
| 27 | #define NM_WOUT_THRESHOLD (64 * NAT_ENTRY_PER_BLOCK) |
| 28 | |
| 29 | /* vector size for gang look-up from nat cache that consists of radix tree */ |
| 30 | #define NATVEC_SIZE 64 |
| 31 | |
Jaegeuk Kim | 56ae674 | 2013-03-31 12:47:20 +0900 | [diff] [blame] | 32 | /* return value for read_node_page */ |
| 33 | #define LOCKED_PAGE 1 |
| 34 | |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 35 | /* |
| 36 | * For node information |
| 37 | */ |
| 38 | struct node_info { |
| 39 | nid_t nid; /* node id */ |
| 40 | nid_t ino; /* inode number of the node's owner */ |
| 41 | block_t blk_addr; /* block address of the node */ |
| 42 | unsigned char version; /* version of the node */ |
| 43 | }; |
| 44 | |
| 45 | struct nat_entry { |
| 46 | struct list_head list; /* for clean or dirty nat list */ |
| 47 | bool checkpointed; /* whether it is checkpointed or not */ |
| 48 | struct node_info ni; /* in-memory node information */ |
| 49 | }; |
| 50 | |
| 51 | #define nat_get_nid(nat) (nat->ni.nid) |
| 52 | #define nat_set_nid(nat, n) (nat->ni.nid = n) |
| 53 | #define nat_get_blkaddr(nat) (nat->ni.blk_addr) |
| 54 | #define nat_set_blkaddr(nat, b) (nat->ni.blk_addr = b) |
| 55 | #define nat_get_ino(nat) (nat->ni.ino) |
| 56 | #define nat_set_ino(nat, i) (nat->ni.ino = i) |
| 57 | #define nat_get_version(nat) (nat->ni.version) |
| 58 | #define nat_set_version(nat, v) (nat->ni.version = v) |
| 59 | |
| 60 | #define __set_nat_cache_dirty(nm_i, ne) \ |
Jaegeuk Kim | fffc2a0 | 2014-02-21 13:17:22 +0900 | [diff] [blame] | 61 | do { \ |
| 62 | ne->checkpointed = false; \ |
| 63 | list_move_tail(&ne->list, &nm_i->dirty_nat_entries); \ |
| 64 | } while (0); |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 65 | #define __clear_nat_cache_dirty(nm_i, ne) \ |
Jaegeuk Kim | fffc2a0 | 2014-02-21 13:17:22 +0900 | [diff] [blame] | 66 | do { \ |
| 67 | ne->checkpointed = true; \ |
| 68 | list_move_tail(&ne->list, &nm_i->nat_entries); \ |
| 69 | } while (0); |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 70 | #define inc_node_version(version) (++version) |
| 71 | |
| 72 | static inline void node_info_from_raw_nat(struct node_info *ni, |
| 73 | struct f2fs_nat_entry *raw_ne) |
| 74 | { |
| 75 | ni->ino = le32_to_cpu(raw_ne->ino); |
| 76 | ni->blk_addr = le32_to_cpu(raw_ne->block_addr); |
| 77 | ni->version = raw_ne->version; |
| 78 | } |
| 79 | |
| 80 | /* |
| 81 | * For free nid mangement |
| 82 | */ |
| 83 | enum nid_state { |
| 84 | NID_NEW, /* newly added to free nid list */ |
| 85 | NID_ALLOC /* it is allocated */ |
| 86 | }; |
| 87 | |
| 88 | struct free_nid { |
| 89 | struct list_head list; /* for free node id list */ |
| 90 | nid_t nid; /* node id */ |
| 91 | int state; /* in use or not: NID_NEW or NID_ALLOC */ |
| 92 | }; |
| 93 | |
| 94 | static inline int next_free_nid(struct f2fs_sb_info *sbi, nid_t *nid) |
| 95 | { |
| 96 | struct f2fs_nm_info *nm_i = NM_I(sbi); |
| 97 | struct free_nid *fnid; |
| 98 | |
| 99 | if (nm_i->fcnt <= 0) |
| 100 | return -1; |
| 101 | spin_lock(&nm_i->free_nid_list_lock); |
| 102 | fnid = list_entry(nm_i->free_nid_list.next, struct free_nid, list); |
| 103 | *nid = fnid->nid; |
| 104 | spin_unlock(&nm_i->free_nid_list_lock); |
| 105 | return 0; |
| 106 | } |
| 107 | |
| 108 | /* |
| 109 | * inline functions |
| 110 | */ |
| 111 | static inline void get_nat_bitmap(struct f2fs_sb_info *sbi, void *addr) |
| 112 | { |
| 113 | struct f2fs_nm_info *nm_i = NM_I(sbi); |
| 114 | memcpy(addr, nm_i->nat_bitmap, nm_i->bitmap_size); |
| 115 | } |
| 116 | |
| 117 | static inline pgoff_t current_nat_addr(struct f2fs_sb_info *sbi, nid_t start) |
| 118 | { |
| 119 | struct f2fs_nm_info *nm_i = NM_I(sbi); |
| 120 | pgoff_t block_off; |
| 121 | pgoff_t block_addr; |
| 122 | int seg_off; |
| 123 | |
| 124 | block_off = NAT_BLOCK_OFFSET(start); |
| 125 | seg_off = block_off >> sbi->log_blocks_per_seg; |
| 126 | |
| 127 | block_addr = (pgoff_t)(nm_i->nat_blkaddr + |
| 128 | (seg_off << sbi->log_blocks_per_seg << 1) + |
| 129 | (block_off & ((1 << sbi->log_blocks_per_seg) - 1))); |
| 130 | |
| 131 | if (f2fs_test_bit(block_off, nm_i->nat_bitmap)) |
| 132 | block_addr += sbi->blocks_per_seg; |
| 133 | |
| 134 | return block_addr; |
| 135 | } |
| 136 | |
| 137 | static inline pgoff_t next_nat_addr(struct f2fs_sb_info *sbi, |
| 138 | pgoff_t block_addr) |
| 139 | { |
| 140 | struct f2fs_nm_info *nm_i = NM_I(sbi); |
| 141 | |
| 142 | block_addr -= nm_i->nat_blkaddr; |
| 143 | if ((block_addr >> sbi->log_blocks_per_seg) % 2) |
| 144 | block_addr -= sbi->blocks_per_seg; |
| 145 | else |
| 146 | block_addr += sbi->blocks_per_seg; |
| 147 | |
| 148 | return block_addr + nm_i->nat_blkaddr; |
| 149 | } |
| 150 | |
| 151 | static inline void set_to_next_nat(struct f2fs_nm_info *nm_i, nid_t start_nid) |
| 152 | { |
| 153 | unsigned int block_off = NAT_BLOCK_OFFSET(start_nid); |
| 154 | |
| 155 | if (f2fs_test_bit(block_off, nm_i->nat_bitmap)) |
| 156 | f2fs_clear_bit(block_off, nm_i->nat_bitmap); |
| 157 | else |
| 158 | f2fs_set_bit(block_off, nm_i->nat_bitmap); |
| 159 | } |
| 160 | |
| 161 | static inline void fill_node_footer(struct page *page, nid_t nid, |
| 162 | nid_t ino, unsigned int ofs, bool reset) |
| 163 | { |
Gu Zheng | 4559071 | 2013-07-15 17:57:38 +0800 | [diff] [blame] | 164 | struct f2fs_node *rn = F2FS_NODE(page); |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 165 | if (reset) |
| 166 | memset(rn, 0, sizeof(*rn)); |
| 167 | rn->footer.nid = cpu_to_le32(nid); |
| 168 | rn->footer.ino = cpu_to_le32(ino); |
| 169 | rn->footer.flag = cpu_to_le32(ofs << OFFSET_BIT_SHIFT); |
| 170 | } |
| 171 | |
| 172 | static inline void copy_node_footer(struct page *dst, struct page *src) |
| 173 | { |
Gu Zheng | 4559071 | 2013-07-15 17:57:38 +0800 | [diff] [blame] | 174 | struct f2fs_node *src_rn = F2FS_NODE(src); |
| 175 | struct f2fs_node *dst_rn = F2FS_NODE(dst); |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 176 | memcpy(&dst_rn->footer, &src_rn->footer, sizeof(struct node_footer)); |
| 177 | } |
| 178 | |
| 179 | static inline void fill_node_footer_blkaddr(struct page *page, block_t blkaddr) |
| 180 | { |
| 181 | struct f2fs_sb_info *sbi = F2FS_SB(page->mapping->host->i_sb); |
| 182 | struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi); |
Gu Zheng | 4559071 | 2013-07-15 17:57:38 +0800 | [diff] [blame] | 183 | struct f2fs_node *rn = F2FS_NODE(page); |
| 184 | |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 185 | rn->footer.cp_ver = ckpt->checkpoint_ver; |
Jaegeuk Kim | 25ca923 | 2012-11-28 16:12:41 +0900 | [diff] [blame] | 186 | rn->footer.next_blkaddr = cpu_to_le32(blkaddr); |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 187 | } |
| 188 | |
| 189 | static inline nid_t ino_of_node(struct page *node_page) |
| 190 | { |
Gu Zheng | 4559071 | 2013-07-15 17:57:38 +0800 | [diff] [blame] | 191 | struct f2fs_node *rn = F2FS_NODE(node_page); |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 192 | return le32_to_cpu(rn->footer.ino); |
| 193 | } |
| 194 | |
| 195 | static inline nid_t nid_of_node(struct page *node_page) |
| 196 | { |
Gu Zheng | 4559071 | 2013-07-15 17:57:38 +0800 | [diff] [blame] | 197 | struct f2fs_node *rn = F2FS_NODE(node_page); |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 198 | return le32_to_cpu(rn->footer.nid); |
| 199 | } |
| 200 | |
| 201 | static inline unsigned int ofs_of_node(struct page *node_page) |
| 202 | { |
Gu Zheng | 4559071 | 2013-07-15 17:57:38 +0800 | [diff] [blame] | 203 | struct f2fs_node *rn = F2FS_NODE(node_page); |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 204 | unsigned flag = le32_to_cpu(rn->footer.flag); |
| 205 | return flag >> OFFSET_BIT_SHIFT; |
| 206 | } |
| 207 | |
| 208 | static inline unsigned long long cpver_of_node(struct page *node_page) |
| 209 | { |
Gu Zheng | 4559071 | 2013-07-15 17:57:38 +0800 | [diff] [blame] | 210 | struct f2fs_node *rn = F2FS_NODE(node_page); |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 211 | return le64_to_cpu(rn->footer.cp_ver); |
| 212 | } |
| 213 | |
| 214 | static inline block_t next_blkaddr_of_node(struct page *node_page) |
| 215 | { |
Gu Zheng | 4559071 | 2013-07-15 17:57:38 +0800 | [diff] [blame] | 216 | struct f2fs_node *rn = F2FS_NODE(node_page); |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 217 | return le32_to_cpu(rn->footer.next_blkaddr); |
| 218 | } |
| 219 | |
| 220 | /* |
| 221 | * f2fs assigns the following node offsets described as (num). |
| 222 | * N = NIDS_PER_BLOCK |
| 223 | * |
| 224 | * Inode block (0) |
| 225 | * |- direct node (1) |
| 226 | * |- direct node (2) |
| 227 | * |- indirect node (3) |
| 228 | * | `- direct node (4 => 4 + N - 1) |
| 229 | * |- indirect node (4 + N) |
| 230 | * | `- direct node (5 + N => 5 + 2N - 1) |
| 231 | * `- double indirect node (5 + 2N) |
| 232 | * `- indirect node (6 + 2N) |
Chao Yu | 4f4124d | 2013-12-21 18:02:14 +0800 | [diff] [blame] | 233 | * `- direct node |
| 234 | * ...... |
| 235 | * `- indirect node ((6 + 2N) + x(N + 1)) |
| 236 | * `- direct node |
| 237 | * ...... |
| 238 | * `- indirect node ((6 + 2N) + (N - 1)(N + 1)) |
| 239 | * `- direct node |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 240 | */ |
| 241 | static inline bool IS_DNODE(struct page *node_page) |
| 242 | { |
| 243 | unsigned int ofs = ofs_of_node(node_page); |
Jaegeuk Kim | dbe6a5f | 2013-08-09 08:14:06 +0900 | [diff] [blame] | 244 | |
Chao Yu | 4bc8e9b | 2014-03-17 16:35:06 +0800 | [diff] [blame^] | 245 | if (f2fs_has_xattr_block(ofs)) |
Jaegeuk Kim | dbe6a5f | 2013-08-09 08:14:06 +0900 | [diff] [blame] | 246 | return false; |
| 247 | |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 248 | if (ofs == 3 || ofs == 4 + NIDS_PER_BLOCK || |
| 249 | ofs == 5 + 2 * NIDS_PER_BLOCK) |
| 250 | return false; |
| 251 | if (ofs >= 6 + 2 * NIDS_PER_BLOCK) { |
| 252 | ofs -= 6 + 2 * NIDS_PER_BLOCK; |
Zhihui Zhang | 3315101 | 2013-04-07 12:57:04 -0400 | [diff] [blame] | 253 | if (!((long int)ofs % (NIDS_PER_BLOCK + 1))) |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 254 | return false; |
| 255 | } |
| 256 | return true; |
| 257 | } |
| 258 | |
| 259 | static inline void set_nid(struct page *p, int off, nid_t nid, bool i) |
| 260 | { |
Gu Zheng | 4559071 | 2013-07-15 17:57:38 +0800 | [diff] [blame] | 261 | struct f2fs_node *rn = F2FS_NODE(p); |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 262 | |
| 263 | wait_on_page_writeback(p); |
| 264 | |
| 265 | if (i) |
| 266 | rn->i.i_nid[off - NODE_DIR1_BLOCK] = cpu_to_le32(nid); |
| 267 | else |
| 268 | rn->in.nid[off] = cpu_to_le32(nid); |
| 269 | set_page_dirty(p); |
| 270 | } |
| 271 | |
| 272 | static inline nid_t get_nid(struct page *p, int off, bool i) |
| 273 | { |
Gu Zheng | 4559071 | 2013-07-15 17:57:38 +0800 | [diff] [blame] | 274 | struct f2fs_node *rn = F2FS_NODE(p); |
| 275 | |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 276 | if (i) |
| 277 | return le32_to_cpu(rn->i.i_nid[off - NODE_DIR1_BLOCK]); |
| 278 | return le32_to_cpu(rn->in.nid[off]); |
| 279 | } |
| 280 | |
| 281 | /* |
| 282 | * Coldness identification: |
| 283 | * - Mark cold files in f2fs_inode_info |
| 284 | * - Mark cold node blocks in their node footer |
| 285 | * - Mark cold data pages in page cache |
| 286 | */ |
Namjae Jeon | a06a241 | 2013-05-23 22:58:40 +0900 | [diff] [blame] | 287 | static inline int is_file(struct inode *inode, int type) |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 288 | { |
Namjae Jeon | a06a241 | 2013-05-23 22:58:40 +0900 | [diff] [blame] | 289 | return F2FS_I(inode)->i_advise & type; |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 290 | } |
| 291 | |
Namjae Jeon | a06a241 | 2013-05-23 22:58:40 +0900 | [diff] [blame] | 292 | static inline void set_file(struct inode *inode, int type) |
Jaegeuk Kim | 953a3e2 | 2013-03-21 15:21:57 +0900 | [diff] [blame] | 293 | { |
Namjae Jeon | a06a241 | 2013-05-23 22:58:40 +0900 | [diff] [blame] | 294 | F2FS_I(inode)->i_advise |= type; |
Jaegeuk Kim | 953a3e2 | 2013-03-21 15:21:57 +0900 | [diff] [blame] | 295 | } |
| 296 | |
Jaegeuk Kim | 354a339 | 2013-06-14 08:52:35 +0900 | [diff] [blame] | 297 | static inline void clear_file(struct inode *inode, int type) |
| 298 | { |
| 299 | F2FS_I(inode)->i_advise &= ~type; |
| 300 | } |
| 301 | |
| 302 | #define file_is_cold(inode) is_file(inode, FADVISE_COLD_BIT) |
| 303 | #define file_wrong_pino(inode) is_file(inode, FADVISE_LOST_PINO_BIT) |
| 304 | #define file_set_cold(inode) set_file(inode, FADVISE_COLD_BIT) |
| 305 | #define file_lost_pino(inode) set_file(inode, FADVISE_LOST_PINO_BIT) |
| 306 | #define file_clear_cold(inode) clear_file(inode, FADVISE_COLD_BIT) |
| 307 | #define file_got_pino(inode) clear_file(inode, FADVISE_LOST_PINO_BIT) |
Jaegeuk Kim | 953a3e2 | 2013-03-21 15:21:57 +0900 | [diff] [blame] | 308 | |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 309 | static inline int is_cold_data(struct page *page) |
| 310 | { |
| 311 | return PageChecked(page); |
| 312 | } |
| 313 | |
| 314 | static inline void set_cold_data(struct page *page) |
| 315 | { |
| 316 | SetPageChecked(page); |
| 317 | } |
| 318 | |
| 319 | static inline void clear_cold_data(struct page *page) |
| 320 | { |
| 321 | ClearPageChecked(page); |
| 322 | } |
| 323 | |
Namjae Jeon | a06a241 | 2013-05-23 22:58:40 +0900 | [diff] [blame] | 324 | static inline int is_node(struct page *page, int type) |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 325 | { |
Gu Zheng | 4559071 | 2013-07-15 17:57:38 +0800 | [diff] [blame] | 326 | struct f2fs_node *rn = F2FS_NODE(page); |
Namjae Jeon | a06a241 | 2013-05-23 22:58:40 +0900 | [diff] [blame] | 327 | return le32_to_cpu(rn->footer.flag) & (1 << type); |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 328 | } |
| 329 | |
Namjae Jeon | a06a241 | 2013-05-23 22:58:40 +0900 | [diff] [blame] | 330 | #define is_cold_node(page) is_node(page, COLD_BIT_SHIFT) |
| 331 | #define is_fsync_dnode(page) is_node(page, FSYNC_BIT_SHIFT) |
| 332 | #define is_dent_dnode(page) is_node(page, DENT_BIT_SHIFT) |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 333 | |
| 334 | static inline void set_cold_node(struct inode *inode, struct page *page) |
| 335 | { |
Gu Zheng | 4559071 | 2013-07-15 17:57:38 +0800 | [diff] [blame] | 336 | struct f2fs_node *rn = F2FS_NODE(page); |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 337 | unsigned int flag = le32_to_cpu(rn->footer.flag); |
| 338 | |
| 339 | if (S_ISDIR(inode->i_mode)) |
| 340 | flag &= ~(0x1 << COLD_BIT_SHIFT); |
| 341 | else |
| 342 | flag |= (0x1 << COLD_BIT_SHIFT); |
| 343 | rn->footer.flag = cpu_to_le32(flag); |
| 344 | } |
| 345 | |
Namjae Jeon | a06a241 | 2013-05-23 22:58:40 +0900 | [diff] [blame] | 346 | static inline void set_mark(struct page *page, int mark, int type) |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 347 | { |
Gu Zheng | 4559071 | 2013-07-15 17:57:38 +0800 | [diff] [blame] | 348 | struct f2fs_node *rn = F2FS_NODE(page); |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 349 | unsigned int flag = le32_to_cpu(rn->footer.flag); |
| 350 | if (mark) |
Namjae Jeon | a06a241 | 2013-05-23 22:58:40 +0900 | [diff] [blame] | 351 | flag |= (0x1 << type); |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 352 | else |
Namjae Jeon | a06a241 | 2013-05-23 22:58:40 +0900 | [diff] [blame] | 353 | flag &= ~(0x1 << type); |
Jaegeuk Kim | 39a53e0 | 2012-11-28 13:37:31 +0900 | [diff] [blame] | 354 | rn->footer.flag = cpu_to_le32(flag); |
| 355 | } |
Namjae Jeon | a06a241 | 2013-05-23 22:58:40 +0900 | [diff] [blame] | 356 | #define set_dentry_mark(page, mark) set_mark(page, mark, DENT_BIT_SHIFT) |
| 357 | #define set_fsync_mark(page, mark) set_mark(page, mark, FSYNC_BIT_SHIFT) |