diff options
author | Vailin Choi <vchoi@jam.ad.hdfgroup.org> | 2018-05-14 17:26:48 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@jam.ad.hdfgroup.org> | 2018-05-14 17:26:48 (GMT) |
commit | b178d80be0946e3d332ecf575b2f145837cc9454 (patch) | |
tree | a40288aab4c8446a5666c898c51afac2c2daac89 /src | |
parent | ea66ac1e67bf2e5ccc59f30e6b648bb39c8f5e42 (diff) | |
download | hdf5-b178d80be0946e3d332ecf575b2f145837cc9454.zip hdf5-b178d80be0946e3d332ecf575b2f145837cc9454.tar.gz hdf5-b178d80be0946e3d332ecf575b2f145837cc9454.tar.bz2 |
Changes made based on feedback from pull request #1039.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Gdeprec.c | 2 | ||||
-rw-r--r-- | src/H5Gnode.c | 4 | ||||
-rw-r--r-- | src/H5Oint.c | 27 | ||||
-rw-r--r-- | src/H5Opublic.h | 16 |
4 files changed, 25 insertions, 24 deletions
diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index bd1b0ec..f6c6d8f 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -1118,7 +1118,7 @@ H5G__get_objinfo_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, c /* Go retrieve the object information */ /* (don't need index & heap info) */ HDassert(obj_loc); - if(H5O_get_info(obj_loc->oloc, &oinfo, H5O_INFO_TIME | H5O_INFO_HDR) < 0) + if(H5O_get_info(obj_loc->oloc, &oinfo, H5O_INFO_BASIC|H5O_INFO_TIME|H5O_INFO_HDR) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to get object info") /* Get mapped object type */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index bf77833..72b3633 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -1274,8 +1274,8 @@ H5G__node_copy(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get link name") /* Check if the object pointed by the soft link exists in the source file */ - /* Only basic information is needed therefore pass in "0" for field selection */ - if(H5G_loc_info(&grp_loc, link_name, &oinfo, 0) >= 0) { + /* Only basic information is needed */ + if(H5G_loc_info(&grp_loc, link_name, &oinfo, H5O_INFO_BASIC) >= 0) { tmp_src_ent.header = oinfo.addr; src_ent = &tmp_src_ent; } /* end if */ diff --git a/src/H5Oint.c b/src/H5Oint.c index 7c5977f..2752a25 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -2243,24 +2243,27 @@ H5O_get_info(const H5O_loc_t *loc, H5O_info_t *oinfo, unsigned fields) if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") + /* Get class for object */ + if(NULL == (obj_class = H5O__obj_class_real(oh))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine object class") + /* Reset the object info structure */ HDmemset(oinfo, 0, sizeof(*oinfo)); - /* Retrieve the file's fileno */ - H5F_GET_FILENO(loc->file, oinfo->fileno); - - /* Set the object's address */ - oinfo->addr = loc->addr; + /* Get basic information, if requested */ + if(fields & H5O_INFO_BASIC) { + /* Retrieve the file's fileno */ + H5F_GET_FILENO(loc->file, oinfo->fileno); - /* Get class for object */ - if(NULL == (obj_class = H5O__obj_class_real(oh))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine object class") + /* Set the object's address */ + oinfo->addr = loc->addr; - /* Retrieve the type of the object */ - oinfo->type = obj_class->type; + /* Retrieve the type of the object */ + oinfo->type = obj_class->type; - /* Set the object's reference count */ - oinfo->rc = oh->nlink; + /* Set the object's reference count */ + oinfo->rc = oh->nlink; + } /* Get time information, if requested */ if(fields & H5O_INFO_TIME) { diff --git a/src/H5Opublic.h b/src/H5Opublic.h index 54869bc..da2910d 100644 --- a/src/H5Opublic.h +++ b/src/H5Opublic.h @@ -75,16 +75,14 @@ /* Flags for H5Oget_info. * Theses flags determine which fields will be filled in in the H5O_info_t - * struct. Some fields are always filled in because there is no performance - * penalty. - * A value of 0 returns basic information: fileno, addr, type, rc and will be - * returned regardless. + * struct. */ -#define H5O_INFO_TIME 0x0001u /* Fill in the atime, mtime, ctime, and btime fields */ -#define H5O_INFO_NUM_ATTRS 0x0002u /* Fill in the num_attrs field */ -#define H5O_INFO_HDR 0x0004u /* Fill in the hdr field */ -#define H5O_INFO_META_SIZE 0x0008u /* Fill in the meta_size field */ -#define H5O_INFO_ALL (H5O_INFO_TIME | H5O_INFO_NUM_ATTRS | H5O_INFO_HDR | H5O_INFO_META_SIZE) +#define H5O_INFO_BASIC 0x0001u /* Fill in the fileno, addr, type, and rc fields */ +#define H5O_INFO_TIME 0x0002u /* Fill in the atime, mtime, ctime, and btime fields */ +#define H5O_INFO_NUM_ATTRS 0x0004u /* Fill in the num_attrs field */ +#define H5O_INFO_HDR 0x0008u /* Fill in the hdr field */ +#define H5O_INFO_META_SIZE 0x0010u /* Fill in the meta_size field */ +#define H5O_INFO_ALL (H5O_INFO_BASIC | H5O_INFO_TIME | H5O_INFO_NUM_ATTRS | H5O_INFO_HDR | H5O_INFO_META_SIZE) /*******************/ /* Public Typedefs */ |