172
172
 
    /* Get external file cache */
173
173
 
    efc = parent->shared->efc;
174
174
 
175
175
 
    /* Check if the EFC exists.  If it does not, just call H5F_open().  We
176
176
 
     * support this so clients do not have to make 2 different calls depending
177
177
 
     * on the state of the efc. */
178
178
 
    if(!efc) {
179
179
 
        if(NULL == (ret_value = H5F_open(name, flags, fcpl_id, fapl_id)))
180
180
 
            HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open file")
181
181
 
 
182
+
        /* Make file post open call */
 
183
+
        if(H5F__post_open(ret_value) < 0)
 
184
+
            HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't finish opening file")
 
185
+
182
186
 
        /* Increment the number of open objects to prevent the file from being
183
187
 
         * closed out from under us - "simulate" having an open file id.  Note
184
188
 
         * that this behaviour replaces the calls to H5F_incr_nopen_objs() and
185
189
 
         * H5F_decr_nopen_objs() in H5L_extern_traverse(). */
186
190
 
        ret_value->nopen_objs++;
187
191
 
188
192
 
        HGOTO_DONE(ret_value)
189
193
 
    } /* end if */
190
194
 
191
195
 
    /* Search the skip list for name if the skip list exists, create the skip
Show more
244
248
 
                if(H5F__efc_remove_ent(efc, ent) < 0)
245
249
 
                    HGOTO_ERROR(H5E_FILE, H5E_CANTREMOVE, NULL, "can't remove entry from external file cache")
246
250
 
247
251
 
                /* Do not free ent, we will recycle it below */
248
252
 
            } /* end if */
249
253
 
            else {
250
254
 
                /* Cannot cache file, just open file and return */
251
255
 
                if(NULL == (ret_value = H5F_open(name, flags, fcpl_id, fapl_id)))
252
256
 
                    HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open file")
253
257
 
 
258
+
                /* Make file post open call */
 
259
+
                if(H5F__post_open(ret_value) < 0)
 
260
+
                    HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't finish opening file")
 
261
+
254
262
 
                /* Increment the number of open objects to prevent the file from
255
263
 
                 * being closed out from under us - "simulate" having an open
256
264
 
                 * file id */
257
265
 
                ret_value->nopen_objs++;
258
266
 
259
267
 
                HGOTO_DONE(ret_value)
260
268
 
            } /* end else */
261
269
 
        } /* end if */
262
270
 
        else
263
271
 
            /* Allocate new entry */
Show more
266
274
 
267
275
 
        /* Build new entry */
268
276
 
        if(NULL == (ent->name = H5MM_strdup(name)))
269
277
 
            HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
270
278
 
271
279
 
        /* Open the file */
272
280
 
        if(NULL == (ent->file = H5F_open(name, flags, fcpl_id, fapl_id)))
273
281
 
            HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open file")
274
282
 
        open_file = TRUE;
275
283
 
 
284
+
        /* Make file post open call */
 
285
+
        if(H5F__post_open(ent->file) < 0)
 
286
+
            HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't finish opening file")
 
287
+
276
288
 
        /* Increment the number of open objects to prevent the file from being
277
289
 
         * closed out from under us - "simulate" having an open file id */
278
290
 
        ent->file->nopen_objs++;
279
291
 
280
292
 
        /* Add the file to the cache */
281
293
 
        /* Skip list */
282
294
 
        if(H5SL_insert(efc->slist, ent, ent->name) < 0)
283
295
 
            HGOTO_ERROR(H5E_FILE, H5E_CANTINSERT, NULL, "can't insert entry into skip list")
284
296
 
285
297
 
        /* Add to head of LRU list and update tail if necessary */