Lines Matching refs:ri
62 static void __get_inode_rdev(struct inode *inode, struct f2fs_inode *ri) in __get_inode_rdev() argument
68 if (ri->i_addr[extra_size]) in __get_inode_rdev()
70 le32_to_cpu(ri->i_addr[extra_size])); in __get_inode_rdev()
73 le32_to_cpu(ri->i_addr[extra_size + 1])); in __get_inode_rdev()
78 struct f2fs_inode *ri) in __written_first_block() argument
80 block_t addr = le32_to_cpu(ri->i_addr[offset_in_addr(ri)]); in __written_first_block()
91 static void __set_inode_rdev(struct inode *inode, struct f2fs_inode *ri) in __set_inode_rdev() argument
97 ri->i_addr[extra_size] = in __set_inode_rdev()
99 ri->i_addr[extra_size + 1] = 0; in __set_inode_rdev()
101 ri->i_addr[extra_size] = 0; in __set_inode_rdev()
102 ri->i_addr[extra_size + 1] = in __set_inode_rdev()
104 ri->i_addr[extra_size + 2] = 0; in __set_inode_rdev()
130 struct f2fs_inode *ri = &F2FS_NODE(page)->i; in f2fs_enable_inode_chksum() local
135 if (!IS_INODE(page) || !(ri->i_inline & F2FS_EXTRA_ATTR)) in f2fs_enable_inode_chksum()
138 if (!F2FS_FITS_IN_INODE(ri, le16_to_cpu(ri->i_extra_isize), in f2fs_enable_inode_chksum()
148 struct f2fs_inode *ri = &node->i; in f2fs_inode_chksum() local
150 __le32 gen = ri->i_generation; in f2fs_inode_chksum()
160 chksum = f2fs_chksum(sbi, chksum_seed, (__u8 *)ri, offset); in f2fs_inode_chksum()
163 chksum = f2fs_chksum(sbi, chksum, (__u8 *)ri + offset, in f2fs_inode_chksum()
170 struct f2fs_inode *ri; in f2fs_inode_chksum_verify() local
184 ri = &F2FS_NODE(page)->i; in f2fs_inode_chksum_verify()
185 provided = le32_to_cpu(ri->i_inode_checksum); in f2fs_inode_chksum_verify()
197 struct f2fs_inode *ri = &F2FS_NODE(page)->i; in f2fs_inode_chksum_set() local
202 ri->i_inode_checksum = cpu_to_le32(f2fs_inode_chksum(sbi, page)); in f2fs_inode_chksum_set()
209 struct f2fs_inode *ri = F2FS_INODE(node_page); in sanity_check_inode() local
304 F2FS_FITS_IN_INODE(ri, fi->i_extra_isize, in sanity_check_inode()
306 if (ri->i_compress_algorithm >= COMPRESS_MAX) { in sanity_check_inode()
311 ri->i_compress_algorithm); in sanity_check_inode()
314 if (le64_to_cpu(ri->i_compr_blocks) > in sanity_check_inode()
320 le64_to_cpu(ri->i_compr_blocks), in sanity_check_inode()
324 if (ri->i_log_cluster_size < MIN_COMPRESS_LOG_SIZE || in sanity_check_inode()
325 ri->i_log_cluster_size > MAX_COMPRESS_LOG_SIZE) { in sanity_check_inode()
330 ri->i_log_cluster_size); in sanity_check_inode()
353 struct f2fs_inode *ri; in do_read_inode() local
365 ri = F2FS_INODE(node_page); in do_read_inode()
367 inode->i_mode = le16_to_cpu(ri->i_mode); in do_read_inode()
368 i_uid_write(inode, le32_to_cpu(ri->i_uid)); in do_read_inode()
369 i_gid_write(inode, le32_to_cpu(ri->i_gid)); in do_read_inode()
370 set_nlink(inode, le32_to_cpu(ri->i_links)); in do_read_inode()
371 inode->i_size = le64_to_cpu(ri->i_size); in do_read_inode()
372 inode->i_blocks = SECTOR_FROM_BLOCK(le64_to_cpu(ri->i_blocks) - 1); in do_read_inode()
374 inode->i_atime.tv_sec = le64_to_cpu(ri->i_atime); in do_read_inode()
375 inode->i_ctime.tv_sec = le64_to_cpu(ri->i_ctime); in do_read_inode()
376 inode->i_mtime.tv_sec = le64_to_cpu(ri->i_mtime); in do_read_inode()
377 inode->i_atime.tv_nsec = le32_to_cpu(ri->i_atime_nsec); in do_read_inode()
378 inode->i_ctime.tv_nsec = le32_to_cpu(ri->i_ctime_nsec); in do_read_inode()
379 inode->i_mtime.tv_nsec = le32_to_cpu(ri->i_mtime_nsec); in do_read_inode()
380 inode->i_generation = le32_to_cpu(ri->i_generation); in do_read_inode()
382 fi->i_current_depth = le32_to_cpu(ri->i_current_depth); in do_read_inode()
385 le16_to_cpu(ri->i_gc_failures); in do_read_inode()
386 fi->i_xattr_nid = le32_to_cpu(ri->i_xattr_nid); in do_read_inode()
387 fi->i_flags = le32_to_cpu(ri->i_flags); in do_read_inode()
391 fi->i_advise = ri->i_advise; in do_read_inode()
392 fi->i_pino = le32_to_cpu(ri->i_pino); in do_read_inode()
393 fi->i_dir_level = ri->i_dir_level; in do_read_inode()
397 get_inline_info(inode, ri); in do_read_inode()
400 le16_to_cpu(ri->i_extra_isize) : 0; in do_read_inode()
403 fi->i_inline_xattr_size = le16_to_cpu(ri->i_inline_xattr_size); in do_read_inode()
436 __get_inode_rdev(inode, ri); in do_read_inode()
439 err = __written_first_block(sbi, ri); in do_read_inode()
455 F2FS_FITS_IN_INODE(ri, fi->i_extra_isize, i_projid)) in do_read_inode()
456 i_projid = (projid_t)le32_to_cpu(ri->i_projid); in do_read_inode()
462 F2FS_FITS_IN_INODE(ri, fi->i_extra_isize, i_crtime)) { in do_read_inode()
463 fi->i_crtime.tv_sec = le64_to_cpu(ri->i_crtime); in do_read_inode()
464 fi->i_crtime.tv_nsec = le32_to_cpu(ri->i_crtime_nsec); in do_read_inode()
469 if (F2FS_FITS_IN_INODE(ri, fi->i_extra_isize, in do_read_inode()
472 le64_to_cpu(ri->i_compr_blocks)); in do_read_inode()
473 fi->i_compress_algorithm = ri->i_compress_algorithm; in do_read_inode()
474 fi->i_log_cluster_size = ri->i_log_cluster_size; in do_read_inode()
475 fi->i_compress_flag = le16_to_cpu(ri->i_compress_flag); in do_read_inode()
609 struct f2fs_inode *ri; in f2fs_update_inode() local
617 ri = F2FS_INODE(node_page); in f2fs_update_inode()
619 ri->i_mode = cpu_to_le16(inode->i_mode); in f2fs_update_inode()
620 ri->i_advise = F2FS_I(inode)->i_advise; in f2fs_update_inode()
621 ri->i_uid = cpu_to_le32(i_uid_read(inode)); in f2fs_update_inode()
622 ri->i_gid = cpu_to_le32(i_gid_read(inode)); in f2fs_update_inode()
623 ri->i_links = cpu_to_le32(inode->i_nlink); in f2fs_update_inode()
624 ri->i_size = cpu_to_le64(i_size_read(inode)); in f2fs_update_inode()
625 ri->i_blocks = cpu_to_le64(SECTOR_TO_BLOCK(inode->i_blocks) + 1); in f2fs_update_inode()
629 set_raw_extent(&et->largest, &ri->i_ext); in f2fs_update_inode()
632 memset(&ri->i_ext, 0, sizeof(ri->i_ext)); in f2fs_update_inode()
634 set_raw_inline(inode, ri); in f2fs_update_inode()
636 ri->i_atime = cpu_to_le64(inode->i_atime.tv_sec); in f2fs_update_inode()
637 ri->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); in f2fs_update_inode()
638 ri->i_mtime = cpu_to_le64(inode->i_mtime.tv_sec); in f2fs_update_inode()
639 ri->i_atime_nsec = cpu_to_le32(inode->i_atime.tv_nsec); in f2fs_update_inode()
640 ri->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); in f2fs_update_inode()
641 ri->i_mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); in f2fs_update_inode()
643 ri->i_current_depth = in f2fs_update_inode()
646 ri->i_gc_failures = in f2fs_update_inode()
648 ri->i_xattr_nid = cpu_to_le32(F2FS_I(inode)->i_xattr_nid); in f2fs_update_inode()
649 ri->i_flags = cpu_to_le32(F2FS_I(inode)->i_flags); in f2fs_update_inode()
650 ri->i_pino = cpu_to_le32(F2FS_I(inode)->i_pino); in f2fs_update_inode()
651 ri->i_generation = cpu_to_le32(inode->i_generation); in f2fs_update_inode()
652 ri->i_dir_level = F2FS_I(inode)->i_dir_level; in f2fs_update_inode()
655 ri->i_extra_isize = cpu_to_le16(F2FS_I(inode)->i_extra_isize); in f2fs_update_inode()
658 ri->i_inline_xattr_size = in f2fs_update_inode()
662 F2FS_FITS_IN_INODE(ri, F2FS_I(inode)->i_extra_isize, in f2fs_update_inode()
668 ri->i_projid = cpu_to_le32(i_projid); in f2fs_update_inode()
672 F2FS_FITS_IN_INODE(ri, F2FS_I(inode)->i_extra_isize, in f2fs_update_inode()
674 ri->i_crtime = in f2fs_update_inode()
676 ri->i_crtime_nsec = in f2fs_update_inode()
681 F2FS_FITS_IN_INODE(ri, F2FS_I(inode)->i_extra_isize, in f2fs_update_inode()
683 ri->i_compr_blocks = in f2fs_update_inode()
686 ri->i_compress_algorithm = in f2fs_update_inode()
688 ri->i_compress_flag = in f2fs_update_inode()
690 ri->i_log_cluster_size = in f2fs_update_inode()
695 __set_inode_rdev(inode, ri); in f2fs_update_inode()