/* Get external file cache */
efc = parent->shared->efc;
/* Check if the EFC exists. If it does not, just call H5F_open(). We
* support this so clients do not have to make 2 different calls depending
* on the state of the efc. */
if(NULL == (ret_value = H5F_open(name, flags, fcpl_id, fapl_id)))
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open file")
/* Make file post open call */
if(H5F__post_open(ret_value) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't finish opening file")
/* Increment the number of open objects to prevent the file from being
* closed out from under us - "simulate" having an open file id. Note
* that this behaviour replaces the calls to H5F_incr_nopen_objs() and
* H5F_decr_nopen_objs() in H5L_extern_traverse(). */
/* Search the skip list for name if the skip list exists, create the skip
if(H5F__efc_remove_ent(efc, ent) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTREMOVE, NULL, "can't remove entry from external file cache")
/* Do not free ent, we will recycle it below */
/* Cannot cache file, just open file and return */
if(NULL == (ret_value = H5F_open(name, flags, fcpl_id, fapl_id)))
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open file")
/* Make file post open call */
if(H5F__post_open(ret_value) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't finish opening file")
/* Increment the number of open objects to prevent the file from
* being closed out from under us - "simulate" having an open
if(NULL == (ent->name = H5MM_strdup(name)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
if(NULL == (ent->file = H5F_open(name, flags, fcpl_id, fapl_id)))
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open file")
/* Make file post open call */
if(H5F__post_open(ent->file) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't finish opening file")
/* Increment the number of open objects to prevent the file from being
* closed out from under us - "simulate" having an open file id */
/* Add the file to the cache */
if(H5SL_insert(efc->slist, ent, ent->name) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINSERT, NULL, "can't insert entry into skip list")
/* Add to head of LRU list and update tail if necessary */