Lines Matching full:cp

73 	struct nilfs_checkpoint *cp;  in nilfs_cpfile_block_add_valid_checkpoints()  local
76 cp = kmap_local_folio(bh->b_folio, in nilfs_cpfile_block_add_valid_checkpoints()
78 count = le32_to_cpu(cp->cp_checkpoints_count) + n; in nilfs_cpfile_block_add_valid_checkpoints()
79 cp->cp_checkpoints_count = cpu_to_le32(count); in nilfs_cpfile_block_add_valid_checkpoints()
80 kunmap_local(cp); in nilfs_cpfile_block_add_valid_checkpoints()
89 struct nilfs_checkpoint *cp; in nilfs_cpfile_block_sub_valid_checkpoints() local
92 cp = kmap_local_folio(bh->b_folio, in nilfs_cpfile_block_sub_valid_checkpoints()
94 WARN_ON(le32_to_cpu(cp->cp_checkpoints_count) < n); in nilfs_cpfile_block_sub_valid_checkpoints()
95 count = le32_to_cpu(cp->cp_checkpoints_count) - n; in nilfs_cpfile_block_sub_valid_checkpoints()
96 cp->cp_checkpoints_count = cpu_to_le32(count); in nilfs_cpfile_block_sub_valid_checkpoints()
97 kunmap_local(cp); in nilfs_cpfile_block_sub_valid_checkpoints()
105 struct nilfs_checkpoint *cp = from; in nilfs_cpfile_block_init() local
110 nilfs_checkpoint_set_invalid(cp); in nilfs_cpfile_block_init()
111 cp = (void *)cp + cpsz; in nilfs_cpfile_block_init()
251 struct nilfs_checkpoint *cp; in nilfs_cpfile_read_checkpoint() local
267 cp = kmap_local_folio(cp_bh->b_folio, offset); in nilfs_cpfile_read_checkpoint()
268 if (nilfs_checkpoint_invalid(cp)) { in nilfs_cpfile_read_checkpoint()
273 ret = nilfs_read_inode_common(ifile, &cp->cp_ifile_inode); in nilfs_cpfile_read_checkpoint()
287 atomic64_set(&root->inodes_count, le64_to_cpu(cp->cp_inodes_count)); in nilfs_cpfile_read_checkpoint()
288 atomic64_set(&root->blocks_count, le64_to_cpu(cp->cp_blocks_count)); in nilfs_cpfile_read_checkpoint()
292 kunmap_local(cp); in nilfs_cpfile_read_checkpoint()
319 struct nilfs_checkpoint *cp; in nilfs_cpfile_create_checkpoint() local
336 cp = kmap_local_folio(cp_bh->b_folio, offset); in nilfs_cpfile_create_checkpoint()
337 if (nilfs_checkpoint_invalid(cp)) { in nilfs_cpfile_create_checkpoint()
339 nilfs_checkpoint_clear_invalid(cp); in nilfs_cpfile_create_checkpoint()
340 kunmap_local(cp); in nilfs_cpfile_create_checkpoint()
350 kunmap_local(cp); in nilfs_cpfile_create_checkpoint()
388 struct nilfs_checkpoint *cp; in nilfs_cpfile_finalize_checkpoint() local
404 cp = kmap_local_folio(cp_bh->b_folio, offset); in nilfs_cpfile_finalize_checkpoint()
405 if (unlikely(nilfs_checkpoint_invalid(cp))) { in nilfs_cpfile_finalize_checkpoint()
406 kunmap_local(cp); in nilfs_cpfile_finalize_checkpoint()
411 cp->cp_snapshot_list.ssl_next = 0; in nilfs_cpfile_finalize_checkpoint()
412 cp->cp_snapshot_list.ssl_prev = 0; in nilfs_cpfile_finalize_checkpoint()
413 cp->cp_inodes_count = cpu_to_le64(atomic64_read(&root->inodes_count)); in nilfs_cpfile_finalize_checkpoint()
414 cp->cp_blocks_count = cpu_to_le64(atomic64_read(&root->blocks_count)); in nilfs_cpfile_finalize_checkpoint()
415 cp->cp_nblk_inc = cpu_to_le64(blkinc); in nilfs_cpfile_finalize_checkpoint()
416 cp->cp_create = cpu_to_le64(ctime); in nilfs_cpfile_finalize_checkpoint()
417 cp->cp_cno = cpu_to_le64(cno); in nilfs_cpfile_finalize_checkpoint()
420 nilfs_checkpoint_set_minor(cp); in nilfs_cpfile_finalize_checkpoint()
422 nilfs_checkpoint_clear_minor(cp); in nilfs_cpfile_finalize_checkpoint()
424 nilfs_write_inode_common(root->ifile, &cp->cp_ifile_inode); in nilfs_cpfile_finalize_checkpoint()
425 nilfs_bmap_write(NILFS_I(root->ifile)->i_bmap, &cp->cp_ifile_inode); in nilfs_cpfile_finalize_checkpoint()
427 kunmap_local(cp); in nilfs_cpfile_finalize_checkpoint()
465 struct nilfs_checkpoint *cp; in nilfs_cpfile_delete_checkpoints() local
500 cp = kaddr = kmap_local_folio(cp_bh->b_folio, offset); in nilfs_cpfile_delete_checkpoints()
502 for (i = 0; i < ncps; i++, cp = (void *)cp + cpsz) { in nilfs_cpfile_delete_checkpoints()
503 if (nilfs_checkpoint_snapshot(cp)) { in nilfs_cpfile_delete_checkpoints()
505 } else if (!nilfs_checkpoint_invalid(cp)) { in nilfs_cpfile_delete_checkpoints()
506 nilfs_checkpoint_set_invalid(cp); in nilfs_cpfile_delete_checkpoints()
558 struct nilfs_checkpoint *cp, in nilfs_cpfile_checkpoint_to_cpinfo() argument
561 ci->ci_flags = le32_to_cpu(cp->cp_flags); in nilfs_cpfile_checkpoint_to_cpinfo()
562 ci->ci_cno = le64_to_cpu(cp->cp_cno); in nilfs_cpfile_checkpoint_to_cpinfo()
563 ci->ci_create = le64_to_cpu(cp->cp_create); in nilfs_cpfile_checkpoint_to_cpinfo()
564 ci->ci_nblk_inc = le64_to_cpu(cp->cp_nblk_inc); in nilfs_cpfile_checkpoint_to_cpinfo()
565 ci->ci_inodes_count = le64_to_cpu(cp->cp_inodes_count); in nilfs_cpfile_checkpoint_to_cpinfo()
566 ci->ci_blocks_count = le64_to_cpu(cp->cp_blocks_count); in nilfs_cpfile_checkpoint_to_cpinfo()
567 ci->ci_next = le64_to_cpu(cp->cp_snapshot_list.ssl_next); in nilfs_cpfile_checkpoint_to_cpinfo()
574 struct nilfs_checkpoint *cp; in nilfs_cpfile_do_get_cpinfo() local
599 cp = kaddr = kmap_local_folio(bh->b_folio, offset); in nilfs_cpfile_do_get_cpinfo()
600 for (i = 0; i < ncps && n < nci; i++, cp = (void *)cp + cpsz) { in nilfs_cpfile_do_get_cpinfo()
601 if (!nilfs_checkpoint_invalid(cp)) { in nilfs_cpfile_do_get_cpinfo()
602 nilfs_cpfile_checkpoint_to_cpinfo(cpfile, cp, in nilfs_cpfile_do_get_cpinfo()
629 struct nilfs_checkpoint *cp; in nilfs_cpfile_do_get_ssinfo() local
663 cp = kmap_local_folio(bh->b_folio, offset); in nilfs_cpfile_do_get_ssinfo()
666 if (unlikely(nilfs_checkpoint_invalid(cp) || in nilfs_cpfile_do_get_ssinfo()
667 !nilfs_checkpoint_snapshot(cp))) in nilfs_cpfile_do_get_ssinfo()
669 nilfs_cpfile_checkpoint_to_cpinfo(cpfile, cp, ci); in nilfs_cpfile_do_get_ssinfo()
672 next = le64_to_cpu(cp->cp_snapshot_list.ssl_next); in nilfs_cpfile_do_get_ssinfo()
676 kunmap_local(cp); in nilfs_cpfile_do_get_ssinfo()
688 cp = kmap_local_folio(bh->b_folio, offset); in nilfs_cpfile_do_get_ssinfo()
692 kunmap_local(cp); in nilfs_cpfile_do_get_ssinfo()
773 struct nilfs_checkpoint *cp; in nilfs_cpfile_set_snapshot() local
793 cp = kmap_local_folio(cp_bh->b_folio, offset); in nilfs_cpfile_set_snapshot()
794 if (nilfs_checkpoint_invalid(cp)) { in nilfs_cpfile_set_snapshot()
796 kunmap_local(cp); in nilfs_cpfile_set_snapshot()
799 if (nilfs_checkpoint_snapshot(cp)) { in nilfs_cpfile_set_snapshot()
801 kunmap_local(cp); in nilfs_cpfile_set_snapshot()
804 kunmap_local(cp); in nilfs_cpfile_set_snapshot()
859 cp = kmap_local_folio(cp_bh->b_folio, offset); in nilfs_cpfile_set_snapshot()
860 cp->cp_snapshot_list.ssl_next = cpu_to_le64(curr); in nilfs_cpfile_set_snapshot()
861 cp->cp_snapshot_list.ssl_prev = cpu_to_le64(prev); in nilfs_cpfile_set_snapshot()
862 nilfs_checkpoint_set_snapshot(cp); in nilfs_cpfile_set_snapshot()
863 kunmap_local(cp); in nilfs_cpfile_set_snapshot()
901 struct nilfs_checkpoint *cp; in nilfs_cpfile_clear_snapshot() local
920 cp = kmap_local_folio(cp_bh->b_folio, offset); in nilfs_cpfile_clear_snapshot()
921 if (nilfs_checkpoint_invalid(cp)) { in nilfs_cpfile_clear_snapshot()
923 kunmap_local(cp); in nilfs_cpfile_clear_snapshot()
926 if (!nilfs_checkpoint_snapshot(cp)) { in nilfs_cpfile_clear_snapshot()
928 kunmap_local(cp); in nilfs_cpfile_clear_snapshot()
932 list = &cp->cp_snapshot_list; in nilfs_cpfile_clear_snapshot()
935 kunmap_local(cp); in nilfs_cpfile_clear_snapshot()
975 cp = kmap_local_folio(cp_bh->b_folio, offset); in nilfs_cpfile_clear_snapshot()
976 cp->cp_snapshot_list.ssl_next = cpu_to_le64(0); in nilfs_cpfile_clear_snapshot()
977 cp->cp_snapshot_list.ssl_prev = cpu_to_le64(0); in nilfs_cpfile_clear_snapshot()
978 nilfs_checkpoint_clear_snapshot(cp); in nilfs_cpfile_clear_snapshot()
979 kunmap_local(cp); in nilfs_cpfile_clear_snapshot()
1022 struct nilfs_checkpoint *cp; in nilfs_cpfile_is_snapshot() local
1027 * CP number is invalid if it's zero or larger than the in nilfs_cpfile_is_snapshot()
1039 cp = kmap_local_folio(bh->b_folio, offset); in nilfs_cpfile_is_snapshot()
1040 if (nilfs_checkpoint_invalid(cp)) in nilfs_cpfile_is_snapshot()
1043 ret = nilfs_checkpoint_snapshot(cp); in nilfs_cpfile_is_snapshot()
1044 kunmap_local(cp); in nilfs_cpfile_is_snapshot()