Lines Matching refs:sf

865 	struct btrfsic_stack_frame *sf;  in btrfsic_stack_frame_alloc()  local
867 sf = kzalloc(sizeof(*sf), GFP_NOFS); in btrfsic_stack_frame_alloc()
868 if (sf) in btrfsic_stack_frame_alloc()
869 sf->magic = BTRFSIC_BLOCK_STACK_FRAME_MAGIC_NUMBER; in btrfsic_stack_frame_alloc()
870 return sf; in btrfsic_stack_frame_alloc()
873 static void btrfsic_stack_frame_free(struct btrfsic_stack_frame *sf) in btrfsic_stack_frame_free() argument
875 BUG_ON(!(NULL == sf || in btrfsic_stack_frame_free()
876 BTRFSIC_BLOCK_STACK_FRAME_MAGIC_NUMBER == sf->magic)); in btrfsic_stack_frame_free()
877 kfree(sf); in btrfsic_stack_frame_free()
887 struct btrfsic_stack_frame *sf; in btrfsic_process_metablock() local
893 sf = &initial_stack_frame; in btrfsic_process_metablock()
894 sf->error = 0; in btrfsic_process_metablock()
895 sf->i = -1; in btrfsic_process_metablock()
896 sf->limit_nesting = first_limit_nesting; in btrfsic_process_metablock()
897 sf->block = first_block; in btrfsic_process_metablock()
898 sf->block_ctx = first_block_ctx; in btrfsic_process_metablock()
899 sf->next_block = NULL; in btrfsic_process_metablock()
900 sf->hdr = first_hdr; in btrfsic_process_metablock()
901 sf->prev = NULL; in btrfsic_process_metablock()
904 sf->block->generation = btrfs_stack_header_generation(sf->hdr); in btrfsic_process_metablock()
905 if (0 == sf->hdr->level) { in btrfsic_process_metablock()
907 (struct btrfs_leaf *)sf->hdr; in btrfsic_process_metablock()
909 if (-1 == sf->i) { in btrfsic_process_metablock()
910 sf->nr = btrfs_stack_header_nritems(&leafhdr->header); in btrfsic_process_metablock()
914 sf->block_ctx->start, sf->nr, in btrfsic_process_metablock()
922 if (0 == sf->num_copies || sf->mirror_num > sf->num_copies) { in btrfsic_process_metablock()
923 sf->i++; in btrfsic_process_metablock()
924 sf->num_copies = 0; in btrfsic_process_metablock()
927 if (sf->i < sf->nr) { in btrfsic_process_metablock()
930 (uintptr_t)(leafhdr->items + sf->i) - in btrfsic_process_metablock()
938 sf->block_ctx->len) { in btrfsic_process_metablock()
942 sf->block_ctx->start, in btrfsic_process_metablock()
943 sf->block_ctx->dev->bdev); in btrfsic_process_metablock()
946 btrfsic_read_from_block_data(sf->block_ctx, in btrfsic_process_metablock()
963 sf->block_ctx->len) in btrfsic_process_metablock()
966 sf->block_ctx, &root_item, in btrfsic_process_metablock()
971 sf->error = in btrfsic_process_metablock()
974 sf->block, in btrfsic_process_metablock()
975 sf->block_ctx, in btrfsic_process_metablock()
977 sf->limit_nesting, in btrfsic_process_metablock()
978 &sf->next_block_ctx, in btrfsic_process_metablock()
979 &sf->next_block, in btrfsic_process_metablock()
981 &sf->num_copies, in btrfsic_process_metablock()
982 &sf->mirror_num, in btrfsic_process_metablock()
986 if (sf->error) in btrfsic_process_metablock()
989 if (NULL != sf->next_block) { in btrfsic_process_metablock()
992 sf->next_block_ctx.datav[0]; in btrfsic_process_metablock()
997 sf->error = -1; in btrfsic_process_metablock()
999 &sf-> in btrfsic_process_metablock()
1005 next_stack->block = sf->next_block; in btrfsic_process_metablock()
1007 &sf->next_block_ctx; in btrfsic_process_metablock()
1011 sf->limit_nesting - 1; in btrfsic_process_metablock()
1012 next_stack->prev = sf; in btrfsic_process_metablock()
1013 sf = next_stack; in btrfsic_process_metablock()
1018 sf->error = btrfsic_handle_extent_data( in btrfsic_process_metablock()
1020 sf->block, in btrfsic_process_metablock()
1021 sf->block_ctx, in btrfsic_process_metablock()
1024 if (sf->error) in btrfsic_process_metablock()
1031 struct btrfs_node *const nodehdr = (struct btrfs_node *)sf->hdr; in btrfsic_process_metablock()
1033 if (-1 == sf->i) { in btrfsic_process_metablock()
1034 sf->nr = btrfs_stack_header_nritems(&nodehdr->header); in btrfsic_process_metablock()
1038 sf->block_ctx->start, in btrfsic_process_metablock()
1039 nodehdr->header.level, sf->nr, in btrfsic_process_metablock()
1047 if (0 == sf->num_copies || sf->mirror_num > sf->num_copies) { in btrfsic_process_metablock()
1048 sf->i++; in btrfsic_process_metablock()
1049 sf->num_copies = 0; in btrfsic_process_metablock()
1052 if (sf->i < sf->nr) { in btrfsic_process_metablock()
1057 key_ptr_offset = (uintptr_t)(nodehdr->ptrs + sf->i) - in btrfsic_process_metablock()
1060 sf->block_ctx->len) { in btrfsic_process_metablock()
1063 sf->block_ctx->start, in btrfsic_process_metablock()
1064 sf->block_ctx->dev->bdev); in btrfsic_process_metablock()
1068 sf->block_ctx, &key_ptr, key_ptr_offset, in btrfsic_process_metablock()
1072 sf->error = btrfsic_create_link_to_next_block( in btrfsic_process_metablock()
1074 sf->block, in btrfsic_process_metablock()
1075 sf->block_ctx, in btrfsic_process_metablock()
1077 sf->limit_nesting, in btrfsic_process_metablock()
1078 &sf->next_block_ctx, in btrfsic_process_metablock()
1079 &sf->next_block, in btrfsic_process_metablock()
1081 &sf->num_copies, in btrfsic_process_metablock()
1082 &sf->mirror_num, in btrfsic_process_metablock()
1085 if (sf->error) in btrfsic_process_metablock()
1088 if (NULL != sf->next_block) { in btrfsic_process_metablock()
1091 sf->next_block_ctx.datav[0]; in btrfsic_process_metablock()
1095 sf->error = -1; in btrfsic_process_metablock()
1100 next_stack->block = sf->next_block; in btrfsic_process_metablock()
1101 next_stack->block_ctx = &sf->next_block_ctx; in btrfsic_process_metablock()
1105 sf->limit_nesting - 1; in btrfsic_process_metablock()
1106 next_stack->prev = sf; in btrfsic_process_metablock()
1107 sf = next_stack; in btrfsic_process_metablock()
1116 if (NULL != sf->prev) { in btrfsic_process_metablock()
1117 struct btrfsic_stack_frame *const prev = sf->prev; in btrfsic_process_metablock()
1120 btrfsic_release_block_ctx(sf->block_ctx); in btrfsic_process_metablock()
1122 if (sf->error) { in btrfsic_process_metablock()
1123 prev->error = sf->error; in btrfsic_process_metablock()
1124 btrfsic_stack_frame_free(sf); in btrfsic_process_metablock()
1125 sf = prev; in btrfsic_process_metablock()
1129 btrfsic_stack_frame_free(sf); in btrfsic_process_metablock()
1130 sf = prev; in btrfsic_process_metablock()
1133 BUG_ON(&initial_stack_frame != sf); in btrfsic_process_metablock()
1136 return sf->error; in btrfsic_process_metablock()