Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve spec. reading superblock into cache (a little) by using v2 size #4491

Merged
merged 3 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/H5Fpkg.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@
(H5F_SUPERBLOCK_FIXED_SIZE + \
H5F_SUPERBLOCK_VARLEN_SIZE((s)->super_vers, (s)->sizeof_addr, (s)->sizeof_size))

/* Optimistic read size for superblock */
/* Size of a v2+ superblock, w/8-byte addresses & lengths */
#define H5F_SUPERBLOCK_SPEC_READ_SIZE (H5F_SUPERBLOCK_FIXED_SIZE + H5F_SUPERBLOCK_VARLEN_SIZE(2, 8, 8))

/* For superblock version 0 & 1:
Offset to the file consistency flags (status_flags) in the superblock (excluding H5F_SUPERBLOCK_FIXED_SIZE)
*/
Expand Down
3 changes: 1 addition & 2 deletions src/H5Fsuper.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, bool initial_read)
HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "can't get property list");

/* Make certain we can read the fixed-size portion of the superblock */
if (H5F__set_eoa(f, H5FD_MEM_SUPER,
(haddr_t)(H5F_SUPERBLOCK_FIXED_SIZE + H5F_SUPERBLOCK_MINIMAL_VARLEN_SIZE)) < 0)
if (H5F__set_eoa(f, H5FD_MEM_SUPER, (haddr_t)H5F_SUPERBLOCK_SPEC_READ_SIZE) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "set end of space allocation request failed");

/* Set up the user data for cache callbacks */
Expand Down
3 changes: 1 addition & 2 deletions src/H5Fsuper_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,7 @@ H5F__cache_superblock_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t
assert(image_len);

/* Set the initial image length size */
*image_len = H5F_SUPERBLOCK_FIXED_SIZE + /* Fixed size of superblock */
H5F_SUPERBLOCK_MINIMAL_VARLEN_SIZE;
*image_len = H5F_SUPERBLOCK_SPEC_READ_SIZE;

FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5F__cache_superblock_get_initial_load_size() */
Expand Down
Loading