Lines Matching refs:oh

60 static herr_t H5O_add_gap(H5F_t *f, H5O_t *oh, unsigned chunkno,
62 static herr_t H5O_eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied,
64 static herr_t H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t null_idx,
66 static htri_t H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
68 static herr_t H5O__alloc_find_best_nonnull(const H5F_t *f, const H5O_t *oh, size_t *size,
70 static herr_t H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size,
72 static herr_t H5O__alloc_find_best_null(const H5O_t *oh, size_t size, size_t *mesg_idx);
73 static htri_t H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u);
74 static htri_t H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh);
75 static htri_t H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh);
76 static htri_t H5O_remove_empty_chunks(H5F_t *f, hid_t dxpl_id, H5O_t *oh);
77 static herr_t H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
114 H5O_add_gap(H5F_t *f, H5O_t *oh, unsigned chunkno, hbool_t *chk_dirtied, in H5O_add_gap() argument
124 HDassert(oh); in H5O_add_gap()
125 HDassert(oh->version > H5O_VERSION_1); in H5O_add_gap()
135 if(H5AC_get_entry_status(f, oh->chunk[chunkno].addr, &chk_proxy_status) < 0) in H5O_add_gap()
145 for(u = 0; u < oh->nmesgs && !merged_with_null; u++) { in H5O_add_gap()
148 if(H5O_NULL_ID == oh->mesg[u].type->id && oh->mesg[u].chunkno == chunkno in H5O_add_gap()
151 HDassert(oh->chunk[chunkno].gap == 0); in H5O_add_gap()
154 if(H5O_eliminate_gap(oh, chk_dirtied, &oh->mesg[u], new_gap_loc, new_gap_size) < 0) in H5O_add_gap()
165 for(u = 0; u < oh->nmesgs; u++) in H5O_add_gap()
166 if(oh->mesg[u].chunkno == chunkno && oh->mesg[u].raw > new_gap_loc) in H5O_add_gap()
167 oh->mesg[u].raw -= new_gap_size; in H5O_add_gap()
171 …(size_t)((oh->chunk[chunkno].image + (oh->chunk[chunkno].size - H5O_SIZEOF_CHKSUM_OH(oh))) - (new_… in H5O_add_gap()
174 new_gap_size += oh->chunk[chunkno].gap; in H5O_add_gap()
177 if(new_gap_size >= (size_t)H5O_SIZEOF_MSGHDR_OH(oh)) { in H5O_add_gap()
181 if(oh->nmesgs >= oh->alloc_nmesgs) in H5O_add_gap()
182 if(H5O_alloc_msgs(oh, (size_t)1) < 0) in H5O_add_gap()
186 oh->chunk[chunkno].gap += new_gap_size; in H5O_add_gap()
189 null_msg = &(oh->mesg[oh->nmesgs++]); in H5O_add_gap()
192 null_msg->raw_size = new_gap_size - (size_t)H5O_SIZEOF_MSGHDR_OH(oh); in H5O_add_gap()
193 null_msg->raw = (oh->chunk[chunkno].image + oh->chunk[chunkno].size) in H5O_add_gap()
194 - (H5O_SIZEOF_CHKSUM_OH(oh) + null_msg->raw_size); in H5O_add_gap()
205 oh->chunk[chunkno].gap = 0; in H5O_add_gap()
208 oh->chunk[chunkno].gap = new_gap_size; in H5O_add_gap()
240 H5O_eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, in H5O_eliminate_gap() argument
249 HDassert(oh); in H5O_eliminate_gap()
250 HDassert(oh->version > H5O_VERSION_1); in H5O_eliminate_gap()
266 move_end = mesg->raw - H5O_SIZEOF_MSGHDR_OH(oh); in H5O_eliminate_gap()
275 for(u = 0; u < oh->nmesgs; u++) { in H5O_eliminate_gap()
278 msg_start = oh->mesg[u].raw - H5O_SIZEOF_MSGHDR_OH(oh); in H5O_eliminate_gap()
279 if(oh->mesg[u].chunkno == mesg->chunkno in H5O_eliminate_gap()
283 oh->mesg[u].raw += gap_size; in H5O_eliminate_gap()
285 oh->mesg[u].raw -= gap_size; in H5O_eliminate_gap()
303 HDmemmove(move_start - gap_size, move_start, mesg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh)); in H5O_eliminate_gap()
316 oh->chunk[mesg->chunkno].gap = 0; in H5O_eliminate_gap()
341 H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t null_idx, in H5O_alloc_null() argument
352 HDassert(oh); in H5O_alloc_null()
357 alloc_msg = &oh->mesg[null_idx]; in H5O_alloc_null()
360 if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, alloc_msg->chunkno))) in H5O_alloc_null()
366 if((alloc_msg->raw_size - new_size) < (size_t)H5O_SIZEOF_MSGHDR_OH(oh)) { in H5O_alloc_null()
373 …if(H5O_add_gap(f, oh, alloc_msg->chunkno, &chk_dirtied, null_idx, alloc_msg->raw + alloc_msg->raw_… in H5O_alloc_null()
377 …size_t new_mesg_size = new_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh); /* Total size of newly alloca… in H5O_alloc_null()
381 if(oh->nmesgs >= oh->alloc_nmesgs) { in H5O_alloc_null()
382 if(H5O_alloc_msgs(oh, (size_t)1) < 0) in H5O_alloc_null()
386 alloc_msg = &oh->mesg[null_idx]; in H5O_alloc_null()
390 null_msg = &(oh->mesg[oh->nmesgs++]); in H5O_alloc_null()
402 if(oh->chunk[null_msg->chunkno].gap > 0) { in H5O_alloc_null()
406 if(H5O_eliminate_gap(oh, &chk_dirtied, null_msg, in H5O_alloc_null()
407 …((oh->chunk[null_chunkno].image + oh->chunk[null_chunkno].size) - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->… in H5O_alloc_null()
408 oh->chunk[null_chunkno].gap) < 0) in H5O_alloc_null()
449 H5O_alloc_msgs(H5O_t *oh, size_t min_alloc) in H5O_alloc_msgs() argument
459 HDassert(oh); in H5O_alloc_msgs()
462 old_alloc = oh->alloc_nmesgs; in H5O_alloc_msgs()
463 na = oh->alloc_nmesgs + MAX(oh->alloc_nmesgs, min_alloc); /* At least double */ in H5O_alloc_msgs()
466 if(NULL == (new_mesg = H5FL_SEQ_REALLOC(H5O_mesg_t, oh->mesg, na))) in H5O_alloc_msgs()
470 oh->alloc_nmesgs = na; in H5O_alloc_msgs()
471 oh->mesg = new_mesg; in H5O_alloc_msgs()
474 HDmemset(&oh->mesg[old_alloc], 0, (oh->alloc_nmesgs - old_alloc) * sizeof(H5O_mesg_t)); in H5O_alloc_msgs()
510 H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, in H5O_alloc_extend_chunk() argument
516 size_t aligned_size = H5O_ALIGN_OH(oh, size); in H5O_alloc_extend_chunk()
532 HDassert(oh != NULL); in H5O_alloc_extend_chunk()
533 HDassert(chunkno < oh->nchunks); in H5O_alloc_extend_chunk()
536 HDassert(H5F_addr_defined(oh->chunk[chunkno].addr)); in H5O_alloc_extend_chunk()
541 for(u = 0; u < oh->nmesgs; u++) { in H5O_alloc_extend_chunk()
544 if(oh->mesg[u].chunkno == chunkno && H5O_NULL_ID == oh->mesg[u].type->id && in H5O_alloc_extend_chunk()
545 ((oh->mesg[u].raw + oh->mesg[u].raw_size) in H5O_alloc_extend_chunk()
546 == ((oh->chunk[chunkno].image + oh->chunk[chunkno].size) - in H5O_alloc_extend_chunk()
547 (oh->chunk[chunkno].gap + H5O_SIZEOF_CHKSUM_OH(oh))))) { in H5O_alloc_extend_chunk()
557 HDassert(oh->chunk[chunkno].gap == 0); in H5O_alloc_extend_chunk()
558 delta = aligned_size - oh->mesg[extend_msg].raw_size; in H5O_alloc_extend_chunk()
561 delta = (aligned_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh)) - oh->chunk[chunkno].gap; in H5O_alloc_extend_chunk()
562 delta = H5O_ALIGN_OH(oh, delta); in H5O_alloc_extend_chunk()
565 if(oh->version > H5O_VERSION_1 && chunkno == 0) { in H5O_alloc_extend_chunk()
567 …size_t orig_prfx_size = (size_t)1 << (oh->flags & H5O_HDR_CHUNK0_SIZE); /* Original prefix size … in H5O_alloc_extend_chunk()
569 HDassert(oh->chunk[0].size >= (size_t)H5O_SIZEOF_HDR(oh)); in H5O_alloc_extend_chunk()
570 chunk0_size = oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh); in H5O_alloc_extend_chunk()
593 if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, chunkno))) in H5O_alloc_extend_chunk()
597 was_extended = H5MF_try_extend(f, dxpl_id, H5FD_MEM_OHDR, oh->chunk[chunkno].addr, in H5O_alloc_extend_chunk()
598 … (hsize_t)(oh->chunk[chunkno].size), (hsize_t)(delta + extra_prfx_size)); in H5O_alloc_extend_chunk()
606 oh->flags = (uint8_t)(oh->flags & ~H5O_HDR_CHUNK0_SIZE); in H5O_alloc_extend_chunk()
607 oh->flags |= new_size_flags; in H5O_alloc_extend_chunk()
610 if(H5AC_mark_entry_dirty(oh) < 0) in H5O_alloc_extend_chunk()
617 oh->mesg[extend_msg].raw_size += delta; in H5O_alloc_extend_chunk()
622 if(oh->nmesgs >= oh->alloc_nmesgs) in H5O_alloc_extend_chunk()
623 if(H5O_alloc_msgs(oh, (size_t)1) < 0) in H5O_alloc_extend_chunk()
627 extend_msg = oh->nmesgs++; in H5O_alloc_extend_chunk()
630 oh->mesg[extend_msg].type = H5O_MSG_NULL; in H5O_alloc_extend_chunk()
631 oh->mesg[extend_msg].native = NULL; in H5O_alloc_extend_chunk()
632 oh->mesg[extend_msg].raw = ((oh->chunk[chunkno].image + oh->chunk[chunkno].size) in H5O_alloc_extend_chunk()
633 - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[chunkno].gap)) in H5O_alloc_extend_chunk()
634 + H5O_SIZEOF_MSGHDR_OH(oh); in H5O_alloc_extend_chunk()
635oh->mesg[extend_msg].raw_size = (delta + oh->chunk[chunkno].gap) - (size_t)H5O_SIZEOF_MSGHDR_OH(oh in H5O_alloc_extend_chunk()
636 oh->mesg[extend_msg].chunkno = chunkno; in H5O_alloc_extend_chunk()
640 oh->mesg[extend_msg].dirty = TRUE; in H5O_alloc_extend_chunk()
644 old_image = oh->chunk[chunkno].image; in H5O_alloc_extend_chunk()
645 old_size = oh->chunk[chunkno].size; in H5O_alloc_extend_chunk()
646 oh->chunk[chunkno].size += delta + extra_prfx_size; in H5O_alloc_extend_chunk()
647 oh->chunk[chunkno].image = H5FL_BLK_REALLOC(chunk_image, old_image, oh->chunk[chunkno].size); in H5O_alloc_extend_chunk()
648 if(NULL == oh->chunk[chunkno].image) in H5O_alloc_extend_chunk()
650 oh->chunk[chunkno].gap = 0; in H5O_alloc_extend_chunk()
653 HDmemset(oh->chunk[chunkno].image + old_size, 0, oh->chunk[chunkno].size - old_size); in H5O_alloc_extend_chunk()
657 HDmemmove(oh->chunk[0].image + H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh), in H5O_alloc_extend_chunk()
658oh->chunk[0].image + H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh) - extra_prfx_size, in H5O_alloc_extend_chunk()
659 old_size - (size_t)H5O_SIZEOF_HDR(oh) + extra_prfx_size); in H5O_alloc_extend_chunk()
662 for(u = 0; u < oh->nmesgs; u++) { in H5O_alloc_extend_chunk()
664 if(oh->mesg[u].chunkno == chunkno) in H5O_alloc_extend_chunk()
665oh->mesg[u].raw = oh->chunk[chunkno].image + extra_prfx_size + (oh->mesg[u].raw - old_image); in H5O_alloc_extend_chunk()
670 if(chunkno > 0 && (H5O_CONT_ID == oh->mesg[u].type->id) && in H5O_alloc_extend_chunk()
671 (((H5O_cont_t *)(oh->mesg[u].native))->chunkno == chunkno)) { in H5O_alloc_extend_chunk()
674 unsigned cont_chunkno = oh->mesg[u].chunkno; /* Chunk # for continuation message */ in H5O_alloc_extend_chunk()
677 if(NULL == (chk_proxy2 = H5O_chunk_protect(f, dxpl_id, oh, cont_chunkno))) in H5O_alloc_extend_chunk()
681 HDassert(((H5O_cont_t *)(oh->mesg[u].native))->size == old_size); in H5O_alloc_extend_chunk()
682 ((H5O_cont_t *)(oh->mesg[u].native))->size = oh->chunk[chunkno].size; in H5O_alloc_extend_chunk()
685 oh->mesg[u].dirty = TRUE; in H5O_alloc_extend_chunk()
695 if(H5O_chunk_resize(oh, chk_proxy) < 0) in H5O_alloc_extend_chunk()
739 H5O__alloc_find_best_nonnull(const H5F_t *f, const H5O_t *oh, size_t *size, in H5O__alloc_find_best_nonnull() argument
751 HDassert(oh); in H5O__alloc_find_best_nonnull()
766 cont_size = H5O_ALIGN_OH(oh, (size_t)(H5F_SIZEOF_ADDR(f) + H5F_SIZEOF_SIZE(f))); in H5O__alloc_find_best_nonnull()
768 for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) { in H5O__alloc_find_best_nonnull()
772 …uint8_t *end_chunk_data = (oh->chunk[msg_chunkno].image + oh->chunk[msg_chunkno].size) - (H5O_SIZE… in H5O__alloc_find_best_nonnull()
781 gap_size = oh->chunk[msg_chunkno].gap; in H5O__alloc_find_best_nonnull()
787 for(v = 0, tmp_msg = &oh->mesg[0]; v < oh->nmesgs; v++, tmp_msg++) { in H5O__alloc_find_best_nonnull()
788 … if(tmp_msg->type->id == H5O_NULL_ID && (tmp_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh)) == end_msg) { in H5O__alloc_find_best_nonnull()
790 null_size = (size_t)H5O_SIZEOF_MSGHDR_OH(oh) + tmp_msg->raw_size; in H5O__alloc_find_best_nonnull()
842 else if(found_msg->msgno < 0 && msg_chunkno == oh->nchunks - 1) in H5O__alloc_find_best_nonnull()
846 multi_size += curr_msg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh); in H5O__alloc_find_best_nonnull()
863 *size += (size_t)H5O_SIZEOF_MSGHDR_OH(oh) + oh->mesg[found_msg->msgno].raw_size; in H5O__alloc_find_best_nonnull()
888 H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, in H5O__alloc_chunk() argument
906 HDassert(oh); in H5O__alloc_chunk()
915 size = MAX(H5O_MIN_SIZE, size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh)); in H5O__alloc_chunk()
916 HDassert(size == H5O_ALIGN_OH(oh, size)); in H5O__alloc_chunk()
923 size += H5O_SIZEOF_CHKHDR_OH(oh); in H5O__alloc_chunk()
931 if(oh->nchunks >= oh->alloc_nchunks) { in H5O__alloc_chunk()
932 … size_t na = MAX(H5O_NCHUNKS, oh->alloc_nchunks * 2); /* Double # of chunks allocated */ in H5O__alloc_chunk()
935 if(NULL == (x = H5FL_SEQ_REALLOC(H5O_chunk_t, oh->chunk, na))) in H5O__alloc_chunk()
937 oh->alloc_nchunks = na; in H5O__alloc_chunk()
938 oh->chunk = x; in H5O__alloc_chunk()
941 H5_CHECKED_ASSIGN(chunkno, unsigned, oh->nchunks, size_t); in H5O__alloc_chunk()
942 oh->nchunks++; in H5O__alloc_chunk()
943 oh->chunk[chunkno].addr = new_chunk_addr; in H5O__alloc_chunk()
944 oh->chunk[chunkno].size = size; in H5O__alloc_chunk()
945 oh->chunk[chunkno].gap = 0; in H5O__alloc_chunk()
946 if(NULL == (oh->chunk[chunkno].image = p = H5FL_BLK_CALLOC(chunk_image, size))) in H5O__alloc_chunk()
948 oh->chunk[chunkno].chunk_proxy = NULL; in H5O__alloc_chunk()
953 if(oh->version > H5O_VERSION_1) { in H5O__alloc_chunk()
962 if(oh->nmesgs + 3 > oh->alloc_nmesgs) in H5O__alloc_chunk()
963 if(H5O_alloc_msgs(oh, (size_t)3) < 0) in H5O__alloc_chunk()
967 cont_size = H5O_ALIGN_OH(oh, (size_t)(H5F_SIZEOF_ADDR(f) + H5F_SIZEOF_SIZE(f))); in H5O__alloc_chunk()
968 if(found_null >= oh->nmesgs) { in H5O__alloc_chunk()
977 if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, chunkno - 1))) in H5O__alloc_chunk()
981 for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) in H5O__alloc_chunk()
985 if(u < oh->nmesgs - 1) in H5O__alloc_chunk()
986 … HDmemmove(curr_msg, curr_msg + 1, ((oh->nmesgs - 1) - u) * sizeof(H5O_mesg_t)); in H5O__alloc_chunk()
987 oh->nmesgs--; in H5O__alloc_chunk()
993 HDmemcpy(p, curr_msg->raw - (size_t)H5O_SIZEOF_MSGHDR_OH(oh), in H5O__alloc_chunk()
994 curr_msg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh)); in H5O__alloc_chunk()
998 curr_msg->raw = p + H5O_SIZEOF_MSGHDR_OH(oh); in H5O__alloc_chunk()
1001 p += (size_t)H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg->raw_size; in H5O__alloc_chunk()
1002 size -= (size_t)H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg->raw_size; in H5O__alloc_chunk()
1007 found_null = oh->nmesgs++; in H5O__alloc_chunk()
1008 null_msg = &(oh->mesg[found_null]); in H5O__alloc_chunk()
1012 null_msg->raw = oh->chunk[chunkno - 1].image in H5O__alloc_chunk()
1013 + ((chunkno == 1) ? H5O_SIZEOF_HDR(oh) : H5O_SIZEOF_CHKHDR_OH(oh)) in H5O__alloc_chunk()
1014 - H5O_SIZEOF_CHKSUM_OH(oh) + H5O_SIZEOF_MSGHDR_OH(oh); in H5O__alloc_chunk()
1015 null_msg->raw_size = oh->chunk[chunkno - 1].size in H5O__alloc_chunk()
1016 … - ((chunkno == 1) ? (size_t)H5O_SIZEOF_HDR(oh) : (size_t)H5O_SIZEOF_CHKHDR_OH(oh)) in H5O__alloc_chunk()
1017 - (size_t)H5O_SIZEOF_MSGHDR_OH(oh); in H5O__alloc_chunk()
1023 oh->chunk[chunkno - 1].gap = 0; in H5O__alloc_chunk()
1036 … if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, oh->mesg[found_msg->msgno].chunkno))) in H5O__alloc_chunk()
1040 found_null = oh->nmesgs++; in H5O__alloc_chunk()
1041 null_msg = &(oh->mesg[found_null]); in H5O__alloc_chunk()
1044 null_msg->raw = oh->mesg[found_msg->msgno].raw; in H5O__alloc_chunk()
1045 null_msg->raw_size = oh->mesg[found_msg->msgno].raw_size; in H5O__alloc_chunk()
1046 null_msg->chunkno = oh->mesg[found_msg->msgno].chunkno; in H5O__alloc_chunk()
1049 HDmemcpy(p, oh->mesg[found_msg->msgno].raw - H5O_SIZEOF_MSGHDR_OH(oh), in H5O__alloc_chunk()
1050 oh->mesg[found_msg->msgno].raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh)); in H5O__alloc_chunk()
1053 oh->mesg[found_msg->msgno].raw = p + H5O_SIZEOF_MSGHDR_OH(oh); in H5O__alloc_chunk()
1054 oh->mesg[found_msg->msgno].chunkno = chunkno; in H5O__alloc_chunk()
1057 p += (size_t)H5O_SIZEOF_MSGHDR_OH(oh) + oh->mesg[found_msg->msgno].raw_size; in H5O__alloc_chunk()
1058 size -= (size_t)H5O_SIZEOF_MSGHDR_OH(oh) + oh->mesg[found_msg->msgno].raw_size; in H5O__alloc_chunk()
1063 HDassert(oh->chunk[null_msg->chunkno].gap == found_msg->gap_size); in H5O__alloc_chunk()
1065 oh->chunk[null_msg->chunkno].gap = 0; in H5O__alloc_chunk()
1068 …H5O_mesg_t *old_null_msg = &oh->mesg[found_msg->null_msgno]; /* Pointer to NULL message to elimina… in H5O__alloc_chunk()
1071 … HDassert((null_msg->raw + null_msg->raw_size) == (old_null_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh))); in H5O__alloc_chunk()
1078 if(found_msg->null_msgno < (oh->nmesgs - 1)) in H5O__alloc_chunk()
1079 …HDmemmove(old_null_msg, old_null_msg + 1, ((oh->nmesgs - 1) - found_msg->null_msgno) * sizeof(H5O_… in H5O__alloc_chunk()
1083 oh->nmesgs--; in H5O__alloc_chunk()
1100 idx = oh->nmesgs++; in H5O__alloc_chunk()
1101 oh->mesg[idx].type = H5O_MSG_NULL; in H5O__alloc_chunk()
1102 oh->mesg[idx].dirty = TRUE; in H5O__alloc_chunk()
1103 oh->mesg[idx].native = NULL; in H5O__alloc_chunk()
1104 oh->mesg[idx].raw = p + H5O_SIZEOF_MSGHDR_OH(oh); in H5O__alloc_chunk()
1105 oh->mesg[idx].raw_size = size - (size_t)(H5O_SIZEOF_CHKHDR_OH(oh) + H5O_SIZEOF_MSGHDR_OH(oh)); in H5O__alloc_chunk()
1106 oh->mesg[idx].chunkno = chunkno; in H5O__alloc_chunk()
1109 if(H5O_chunk_add(f, dxpl_id, oh, chunkno, oh->mesg[found_null].chunkno) < 0) in H5O__alloc_chunk()
1115 cont->addr = oh->chunk[chunkno].addr; in H5O__alloc_chunk()
1116 cont->size = oh->chunk[chunkno].size; in H5O__alloc_chunk()
1120 if(H5O_alloc_null(f, dxpl_id, oh, found_null, H5O_MSG_CONT, cont, cont_size) < 0) in H5O__alloc_chunk()
1167 H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, size_t *new_idx) in H5O_alloc_new_chunk() argument
1177 HDassert(oh); in H5O_alloc_new_chunk()
1179 size = H5O_ALIGN_OH(oh, size); in H5O_alloc_new_chunk()
1182 idx = oh->nmesgs; in H5O_alloc_new_chunk()
1183 cont_size = H5O_ALIGN_OH(oh, (size_t)(H5F_SIZEOF_ADDR(f) + H5F_SIZEOF_SIZE(f))); in H5O_alloc_new_chunk()
1184 if(H5O__alloc_find_best_null(oh, cont_size, &idx) < 0) in H5O_alloc_new_chunk()
1188 if(idx >= oh->nmesgs) { in H5O_alloc_new_chunk()
1190 if(H5O__alloc_find_best_nonnull(f, oh, &size, &found_msg) < 0) in H5O_alloc_new_chunk()
1195 if(H5O__alloc_chunk(f, dxpl_id, oh, size, idx, &found_msg, new_idx) < 0) in H5O_alloc_new_chunk()
1218 H5O__alloc_find_best_null(const H5O_t *oh, size_t size, size_t *mesg_idx) in H5O__alloc_find_best_null() argument
1226 HDassert(oh); in H5O__alloc_find_best_null()
1232 for(idx = 0; idx < oh->nmesgs; idx++) { in H5O__alloc_find_best_null()
1233 if(H5O_NULL_ID == oh->mesg[idx].type->id) { in H5O__alloc_find_best_null()
1235 if(oh->mesg[idx].raw_size == size) { in H5O__alloc_find_best_null()
1241 if(oh->mesg[idx].chunkno < oh->mesg[found_null].chunkno) { in H5O__alloc_find_best_null()
1248 if(0 == oh->mesg[idx].chunkno) in H5O__alloc_find_best_null()
1253 else if(oh->mesg[idx].raw_size > size) { in H5O__alloc_find_best_null()
1259 if(oh->mesg[idx].raw_size < oh->mesg[found_null].raw_size) in H5O__alloc_find_best_null()
1263 if(oh->mesg[idx].raw_size == oh->mesg[found_null].raw_size) { in H5O__alloc_find_best_null()
1264 if(oh->mesg[idx].chunkno < oh->mesg[found_null].chunkno) in H5O__alloc_find_best_null()
1293 H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, in H5O_alloc() argument
1304 HDassert(oh); in H5O_alloc()
1315 aligned_size = H5O_ALIGN_OH(oh, raw_size); in H5O_alloc()
1318 idx = oh->nmesgs; in H5O_alloc()
1319 if(H5O__alloc_find_best_null(oh, aligned_size, &idx) < 0) in H5O_alloc()
1323 if(idx >= oh->nmesgs) { in H5O_alloc()
1332 for(chunkno = 0; chunkno < oh->nchunks; chunkno++) { in H5O_alloc()
1335 if((tri_result = H5O_alloc_extend_chunk(f, dxpl_id, oh, chunkno, raw_size, &idx)) < 0) in H5O_alloc()
1342 if(idx >= oh->nmesgs) in H5O_alloc()
1343 if(H5O_alloc_new_chunk(f, dxpl_id, oh, raw_size, &idx) < 0) in H5O_alloc()
1346 HDassert(idx < oh->nmesgs); in H5O_alloc()
1349 if(H5O_alloc_null(f, dxpl_id, oh, idx, type, NULL, aligned_size) < 0) in H5O_alloc()
1353 if(H5AC_mark_entry_dirty(oh) < 0) in H5O_alloc()
1379 H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, in H5O_release_mesg() argument
1390 HDassert(oh); in H5O_release_mesg()
1396 if(H5O_delete_mesg(f, dxpl_id, oh, mesg) < 0) in H5O_release_mesg()
1401 if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, mesg->chunkno))) in H5O_release_mesg()
1409 …g->raw + mesg->raw_size <= (oh->chunk[mesg->chunkno].image + oh->chunk[mesg->chunkno].size) - (H5O… in H5O_release_mesg()
1420 if(oh->chunk[mesg->chunkno].gap) { in H5O_release_mesg()
1422 if(H5O_eliminate_gap(oh, &chk_dirtied, mesg, in H5O_release_mesg()
1423 …((oh->chunk[mesg->chunkno].image + oh->chunk[mesg->chunkno].size) - (H5O_SIZEOF_CHKSUM_OH(oh) + oh in H5O_release_mesg()
1424 oh->chunk[mesg->chunkno].gap) < 0) in H5O_release_mesg()
1451 H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) in H5O_move_cont() argument
1463 HDassert(oh); in H5O_move_cont()
1466 cont_msg = &oh->mesg[cont_u]; in H5O_move_cont()
1467 H5O_LOAD_NATIVE(f, dxpl_id, 0, oh, cont_msg, FAIL) in H5O_move_cont()
1471 if(deleted_chunkno == (oh->nchunks - 1)) { in H5O_move_cont()
1479 for(v = 0, curr_msg = &oh->mesg[0]; v < oh->nmesgs; v++, curr_msg++) { in H5O_move_cont()
1484 nonnull_size += curr_msg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh); in H5O_move_cont()
1490 gap_size = oh->chunk[cont_msg->chunkno].gap; in H5O_move_cont()
1496 …nnull_size && nonnull_size <= (gap_size + cont_msg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh))) { in H5O_move_cont()
1501 move_start = cont_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh); in H5O_move_cont()
1507 if(H5O_release_mesg(f, dxpl_id, oh, cont_msg, FALSE) < 0) in H5O_move_cont()
1511 if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, cont_chunkno))) in H5O_move_cont()
1515 for(v = 0, curr_msg = &oh->mesg[0]; v < oh->nmesgs; v++, curr_msg++) in H5O_move_cont()
1523 move_size = curr_msg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh); in H5O_move_cont()
1526 HDmemcpy(move_start, curr_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh), move_size); in H5O_move_cont()
1527 curr_msg->raw = move_start + H5O_SIZEOF_MSGHDR_OH(oh); in H5O_move_cont()
1537 if(H5O_chunk_delete(f, dxpl_id, oh, deleted_chunkno) < 0) in H5O_move_cont()
1545 if(gap_size >= (size_t)H5O_SIZEOF_MSGHDR_OH(oh)) { in H5O_move_cont()
1547 cont_msg->raw_size = gap_size - (size_t)H5O_SIZEOF_MSGHDR_OH(oh); in H5O_move_cont()
1548 cont_msg->raw = move_start + H5O_SIZEOF_MSGHDR_OH(oh); in H5O_move_cont()
1556 … if(H5O_add_gap(f, oh, cont_chunkno, &chk_dirtied, cont_u, move_start, gap_size) < 0) in H5O_move_cont()
1562 if(cont_u < (oh->nmesgs - 1)) in H5O_move_cont()
1563 …HDmemmove(&oh->mesg[cont_u], &oh->mesg[cont_u + 1], ((oh->nmesgs - 1) - cont_u) * sizeof(H5O_mesg_… in H5O_move_cont()
1564 oh->nmesgs--; in H5O_move_cont()
1569 for(v = oh->nmesgs - 1, curr_msg = &oh->mesg[v]; v < oh->nmesgs; v--, curr_msg--) in H5O_move_cont()
1579 if(v < (oh->nmesgs - 1)) in H5O_move_cont()
1580 … HDmemmove(&oh->mesg[v], &oh->mesg[v + 1], ((oh->nmesgs - 1) - v) * sizeof(H5O_mesg_t)); in H5O_move_cont()
1581 oh->nmesgs--; in H5O_move_cont()
1586oh->chunk[deleted_chunkno].image = H5FL_BLK_FREE(chunk_image, oh->chunk[deleted_chunkno].image); in H5O_move_cont()
1587 oh->nchunks--; in H5O_move_cont()
1619 H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) in H5O_move_msgs_forward() argument
1633 HDassert(oh); in H5O_move_msgs_forward()
1647 for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) { in H5O_move_msgs_forward()
1652 chunk = &(oh->chunk[curr_msg->chunkno]); in H5O_move_msgs_forward()
1654 … != ((chunk->image + chunk->size) - (H5O_SIZEOF_CHKSUM_OH(oh) + chunk->gap))) { in H5O_move_msgs_forward()
1659 for(v = 0, nonnull_msg = &oh->mesg[0]; v < oh->nmesgs; v++, nonnull_msg++) { in H5O_move_msgs_forward()
1662 … ((curr_msg->raw + curr_msg->raw_size) == (nonnull_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh)))) { in H5O_move_msgs_forward()
1667 … if(NULL == (null_chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, curr_msg->chunkno))) in H5O_move_msgs_forward()
1671 HDmemmove(curr_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh), in H5O_move_msgs_forward()
1672 …nonnull_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh), nonnull_msg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH( in H5O_move_msgs_forward()
1679 nonnull_msg->raw_size + H5O_SIZEOF_MSGHDR_OH(oh); in H5O_move_msgs_forward()
1702 HDassert(v < oh->nmesgs); in H5O_move_msgs_forward()
1713 if((status = H5O_move_cont(f, dxpl_id, oh, u)) < 0) in H5O_move_msgs_forward()
1722 for(v = 0, null_msg = &oh->mesg[0]; v < oh->nmesgs; v++, null_msg++) { in H5O_move_msgs_forward()
1733 … if(NULL == (null_chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, null_msg->chunkno))) in H5O_move_msgs_forward()
1735 … if(NULL == (curr_chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, curr_msg->chunkno))) in H5O_move_msgs_forward()
1741 if(oh->swmr_write && (H5O_CONT_ID == curr_msg->type->id)) { in H5O_move_msgs_forward()
1748 ? (void *)oh in H5O_move_msgs_forward()
1757 …if(NULL == (cont_targ_chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, ((H5O_cont_t *)(curr_msg->nati… in H5O_move_msgs_forward()
1793 …raw - H5O_SIZEOF_MSGHDR_OH(oh), curr_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh), curr_msg->raw_size + (si… in H5O_move_msgs_forward()
1818 if(oh->chunk[old_chunkno].gap > 0) { in H5O_move_msgs_forward()
1820 if(H5O_eliminate_gap(oh, &null_chk_dirtied, null_msg, in H5O_move_msgs_forward()
1821 …((oh->chunk[old_chunkno].image + oh->chunk[old_chunkno].size) - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->ch… in H5O_move_msgs_forward()
1822 oh->chunk[old_chunkno].gap) < 0) in H5O_move_msgs_forward()
1836 … if((null_msg->raw_size - curr_msg->raw_size) < (size_t)H5O_SIZEOF_MSGHDR_OH(oh)) { in H5O_move_msgs_forward()
1847 …if(H5O_add_gap(f, oh, null_msg->chunkno, &null_chk_dirtied, v, null_msg->raw + null_msg->raw_size,… in H5O_move_msgs_forward()
1855 … null_msg->raw += curr_msg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh); in H5O_move_msgs_forward()
1856 … null_msg->raw_size -= curr_msg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh); in H5O_move_msgs_forward()
1863 if(oh->nmesgs >= oh->alloc_nmesgs) { in H5O_move_msgs_forward()
1864 if(H5O_alloc_msgs(oh, (size_t)1) < 0) in H5O_move_msgs_forward()
1868 curr_msg = &oh->mesg[u]; in H5O_move_msgs_forward()
1872 new_null_msg = oh->nmesgs++; in H5O_move_msgs_forward()
1882 oh->mesg[new_null_msg].type = H5O_MSG_NULL; in H5O_move_msgs_forward()
1883 oh->mesg[new_null_msg].native = NULL; in H5O_move_msgs_forward()
1884 oh->mesg[new_null_msg].raw = old_raw; in H5O_move_msgs_forward()
1885 oh->mesg[new_null_msg].raw_size = curr_msg->raw_size; in H5O_move_msgs_forward()
1886 oh->mesg[new_null_msg].chunkno = old_chunkno; in H5O_move_msgs_forward()
1889 oh->mesg[new_null_msg].dirty = TRUE; in H5O_move_msgs_forward()
1893 if(oh->chunk[old_chunkno].gap > 0) { in H5O_move_msgs_forward()
1895 if(H5O_eliminate_gap(oh, &curr_chk_dirtied, &oh->mesg[new_null_msg], in H5O_move_msgs_forward()
1896 …((oh->chunk[old_chunkno].image + oh->chunk[old_chunkno].size) - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->ch… in H5O_move_msgs_forward()
1897 oh->chunk[old_chunkno].gap) < 0) in H5O_move_msgs_forward()
1965 H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh) in H5O_merge_null() argument
1974 HDassert(oh != NULL); in H5O_merge_null()
1988 for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) { in H5O_merge_null()
1994 HDassert(oh->chunk[curr_msg->chunkno].gap == 0); in H5O_merge_null()
1997 for(v = 0, curr_msg2 = &oh->mesg[0]; v < oh->nmesgs; v++, curr_msg2++) { in H5O_merge_null()
2003 … if((curr_msg->raw + curr_msg->raw_size) == (curr_msg2->raw - H5O_SIZEOF_MSGHDR_OH(oh))) { in H5O_merge_null()
2006 adj_raw_size = (size_t)H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg2->raw_size; in H5O_merge_null()
2012 … else if((curr_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh)) == (curr_msg2->raw + curr_msg2->raw_size)) { in H5O_merge_null()
2014 … adj_raw = -((ssize_t)((size_t)H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg2->raw_size)); in H5O_merge_null()
2015 adj_raw_size = (size_t)H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg2->raw_size; in H5O_merge_null()
2030 … if(NULL == (curr_chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, curr_msg->chunkno))) in H5O_merge_null()
2045 if(v < (oh->nmesgs - 1)) in H5O_merge_null()
2046 … HDmemmove(&oh->mesg[v], &oh->mesg[v + 1], ((oh->nmesgs - 1) - v) * sizeof(H5O_mesg_t)); in H5O_merge_null()
2050 oh->nmesgs--; in H5O_merge_null()
2053 if((result = H5O_remove_empty_chunks(f, dxpl_id, oh)) < 0) in H5O_merge_null()
2061 if(H5O_alloc_shrink_chunk(f, dxpl_id, oh, curr_msg->chunkno) < 0) in H5O_merge_null()
2108 H5O_remove_empty_chunks(H5F_t *f, hid_t dxpl_id, H5O_t *oh) in H5O_remove_empty_chunks() argument
2117 HDassert(oh != NULL); in H5O_remove_empty_chunks()
2129 for(u = 0, null_msg = &oh->mesg[0]; u < oh->nmesgs; u++, null_msg++) { in H5O_remove_empty_chunks()
2134 ((size_t)H5O_SIZEOF_MSGHDR_OH(oh) + null_msg->raw_size) in H5O_remove_empty_chunks()
2135 == (oh->chunk[null_msg->chunkno].size - H5O_SIZEOF_CHKHDR_OH(oh))) { in H5O_remove_empty_chunks()
2141 for(v = 0, cont_msg = &oh->mesg[0]; v < oh->nmesgs; v++, cont_msg++) { in H5O_remove_empty_chunks()
2144 H5O_LOAD_NATIVE(f, dxpl_id, 0, oh, cont_msg, FAIL) in H5O_remove_empty_chunks()
2152 for(w = 0; w < oh->nchunks; w++) in H5O_remove_empty_chunks()
2153 if(oh->chunk[w].addr == ((H5O_cont_t *)(cont_msg->native))->addr) { in H5O_remove_empty_chunks()
2161 … if(oh->chunk[null_msg->chunkno].addr == ((H5O_cont_t *)(cont_msg->native))->addr) in H5O_remove_empty_chunks()
2166 HDassert(v < oh->nmesgs); in H5O_remove_empty_chunks()
2175 if(H5O_release_mesg(f, dxpl_id, oh, cont_msg, TRUE) < 0) in H5O_remove_empty_chunks()
2183oh->chunk[null_msg->chunkno].image = H5FL_BLK_FREE(chunk_image, oh->chunk[null_msg->chunkno].image… in H5O_remove_empty_chunks()
2186 if(null_msg->chunkno < (oh->nchunks - 1)) { in H5O_remove_empty_chunks()
2187 …HDmemmove(&oh->chunk[null_msg->chunkno], &oh->chunk[null_msg->chunkno + 1], ((oh->nchunks - 1) - n… in H5O_remove_empty_chunks()
2190 for(u = null_msg->chunkno; u < (oh->nchunks - 1); u++) { in H5O_remove_empty_chunks()
2194 if(H5AC_get_entry_status(f, oh->chunk[u].addr, &chk_proxy_status) < 0) in H5O_remove_empty_chunks()
2199 if(H5O_chunk_update_idx(f, dxpl_id, oh, u) < 0) in H5O_remove_empty_chunks()
2207 oh->nchunks--; in H5O_remove_empty_chunks()
2217 if(null_msg_no < (oh->nmesgs - 1)) in H5O_remove_empty_chunks()
2218 …HDmemmove(&oh->mesg[null_msg_no], &oh->mesg[null_msg_no + 1], ((oh->nmesgs - 1) - null_msg_no) * s… in H5O_remove_empty_chunks()
2222 oh->nmesgs--; in H5O_remove_empty_chunks()
2225 for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) { in H5O_remove_empty_chunks()
2236 H5O_LOAD_NATIVE(f, dxpl_id, 0, oh, curr_msg, FAIL) in H5O_remove_empty_chunks()
2244 for(w = 0; w < oh->nchunks; w++) in H5O_remove_empty_chunks()
2245 if(oh->chunk[w].addr == ((H5O_cont_t *)(curr_msg->native))->addr) { in H5O_remove_empty_chunks()
2298 H5O_condense_header(H5F_t *f, H5O_t *oh, hid_t dxpl_id) in H5O_condense_header() argument
2307 HDassert(oh != NULL); in H5O_condense_header()
2315 result = H5O_move_msgs_forward(f, dxpl_id, oh); in H5O_condense_header()
2322 result = H5O_merge_null(f, dxpl_id, oh); in H5O_condense_header()
2329 result = H5O_remove_empty_chunks(f, dxpl_id, oh); in H5O_condense_header()
2336 H5O_assert(oh); in H5O_condense_header()
2359 H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) in H5O_alloc_shrink_chunk() argument
2361 H5O_chunk_t *chunk = &oh->chunk[chunkno]; /* Chunk to shrink */ in H5O_alloc_shrink_chunk()
2368 size_t min_chunk_size = H5O_ALIGN_OH(oh, H5O_MIN_SIZE); /* Minimum chunk size */ in H5O_alloc_shrink_chunk()
2369 size_t sizeof_chksum = H5O_SIZEOF_CHKSUM_OH(oh); /* Size of chunk checksum */ in H5O_alloc_shrink_chunk()
2370 size_t sizeof_msghdr = H5O_SIZEOF_MSGHDR_OH(oh); /* Size of message header */ in H5O_alloc_shrink_chunk()
2381 HDassert(oh); in H5O_alloc_shrink_chunk()
2384 if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, chunkno))) in H5O_alloc_shrink_chunk()
2391 for(u = oh->nmesgs - 1, curr_msg = &oh->mesg[u]; u < oh->nmesgs; u--, curr_msg--) { in H5O_alloc_shrink_chunk()
2409 for(v = 0, curr_msg2 = &oh->mesg[0]; v < oh->nmesgs; v++, curr_msg2++) in H5O_alloc_shrink_chunk()
2421 if(u < (oh->nmesgs - 1)) in H5O_alloc_shrink_chunk()
2422 … HDmemmove(&oh->mesg[u], &oh->mesg[u+1], ((oh->nmesgs - 1) - u) * sizeof(H5O_mesg_t)); in H5O_alloc_shrink_chunk()
2426 oh->nmesgs--; in H5O_alloc_shrink_chunk()
2431 …total_msg_size = new_size - (size_t)(chunkno == 0 ? H5O_SIZEOF_HDR(oh) : H5O_SIZEOF_CHKHDR_OH(oh)); in H5O_alloc_shrink_chunk()
2433 HDassert(oh->alloc_nmesgs > oh->nmesgs); in H5O_alloc_shrink_chunk()
2434 oh->nmesgs++; in H5O_alloc_shrink_chunk()
2437 oh->mesg[oh->nmesgs].type = H5O_MSG_NULL; in H5O_alloc_shrink_chunk()
2438 oh->mesg[oh->nmesgs].dirty = TRUE; in H5O_alloc_shrink_chunk()
2439 oh->mesg[oh->nmesgs].native = NULL; in H5O_alloc_shrink_chunk()
2440 oh->mesg[oh->nmesgs].raw = old_image + new_size + sizeof_msghdr - sizeof_chksum; in H5O_alloc_shrink_chunk()
2441 oh->mesg[oh->nmesgs].raw_size = MAX(H5O_ALIGN_OH(oh, min_chunk_size - total_msg_size), in H5O_alloc_shrink_chunk()
2443 oh->mesg[oh->nmesgs].chunkno = chunkno; in H5O_alloc_shrink_chunk()
2446 new_size += oh->mesg[oh->nmesgs].raw_size + sizeof_msghdr; in H5O_alloc_shrink_chunk()
2450 if(oh->version > H5O_VERSION_1 && chunkno == 0) { in H5O_alloc_shrink_chunk()
2451 … uint64_t chunk0_newsize = new_size - (size_t)H5O_SIZEOF_HDR(oh); /* New size of chunk 0's data */ in H5O_alloc_shrink_chunk()
2452 …size_t orig_prfx_size = (size_t)1 << (oh->flags & H5O_HDR_CHUNK0_SIZE); /* Original prefix size … in H5O_alloc_shrink_chunk()
2476 oh->flags = (uint8_t)(oh->flags & ~H5O_HDR_CHUNK0_SIZE); in H5O_alloc_shrink_chunk()
2477 oh->flags |= new_size_flags; in H5O_alloc_shrink_chunk()
2480 HDmemmove(chunk->image + H5O_SIZEOF_HDR(oh) - sizeof_chksum, in H5O_alloc_shrink_chunk()
2481 chunk->image + H5O_SIZEOF_HDR(oh) - sizeof_chksum + less_prfx_size, in H5O_alloc_shrink_chunk()
2482 new_size - (size_t)H5O_SIZEOF_HDR(oh)); in H5O_alloc_shrink_chunk()
2492 if(NULL == oh->chunk[chunkno].image) in H5O_alloc_shrink_chunk()
2496 for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) { in H5O_alloc_shrink_chunk()
2510 if(NULL == (cont_chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, curr_msg->chunkno))) in H5O_alloc_shrink_chunk()
2529 if(H5O_chunk_resize(oh, chk_proxy) < 0) in H5O_alloc_shrink_chunk()