diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2008-08-07 21:32:36 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2008-08-07 21:32:36 (GMT) |
commit | 2df9af6ae8fd7bf4658e702b3e5046382dc5a852 (patch) | |
tree | 8192f956e40224566862d7d4ff640e61bba6ae45 /src/H5F.c | |
parent | c827f0450cf1324cb972b90d70b2d8d4faecdb9e (diff) | |
download | hdf5-2df9af6ae8fd7bf4658e702b3e5046382dc5a852.zip hdf5-2df9af6ae8fd7bf4658e702b3e5046382dc5a852.tar.gz hdf5-2df9af6ae8fd7bf4658e702b3e5046382dc5a852.tar.bz2 |
[svn-r15450] Purpose: Fix various problems that were occurring when using mounted files.
Description:
Moved mount table from top file structure to shared file structure. Moved
parent out of mount table and back into top file structure. mounted files can
now be accessed from any handle of the parent file. Changes to how files are
closed. Stricter cycle checking on mounted files. Removed unused function
H5F_has_mount().
Tested:
kagiso, smirom, linew (h5committest)
Diffstat (limited to 'src/H5F.c')
-rw-r--r-- | src/H5F.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -1058,6 +1058,10 @@ H5F_dest(H5F_t *f, hid_t dxpl_id) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "problems closing file") + /* Free mount table */ + f->shared->mtab.child = H5MM_xfree(f->shared->mtab.child); + f->shared->mtab.nalloc = 0; + /* Destroy shared file struct */ f->shared = H5FL_FREE(H5F_file_t,f->shared); @@ -1072,8 +1076,6 @@ H5F_dest(H5F_t *f, hid_t dxpl_id) /* Free the non-shared part of the file */ f->name = H5MM_xfree(f->name); f->extpath = H5MM_xfree(f->extpath); - f->mtab.child = H5MM_xfree(f->mtab.child); - f->mtab.nalloc = 0; if(H5FO_top_dest(f) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "problems closing file") f->shared = NULL; @@ -1701,14 +1703,14 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope, unsigned flags) /* Flush other files, depending on scope */ if(H5F_SCOPE_GLOBAL == scope) { - while(f->mtab.parent) - f = f->mtab.parent; + while(f->parent) + f = f->parent; scope = H5F_SCOPE_DOWN; } /* end while */ if(H5F_SCOPE_DOWN == scope) - for(i = 0; i < f->mtab.nmounts; i++) - if(H5F_flush(f->mtab.child[i].file, dxpl_id, scope, flags) < 0) + for(i = 0; i < f->shared->mtab.nmounts; i++) + if(H5F_flush(f->shared->mtab.child[i].file, dxpl_id, scope, flags) < 0) nerrors++; /* Flush any cached dataset storage raw data */ @@ -1938,8 +1940,8 @@ H5F_try_close(H5F_t *f) /* Check if this is a child file in a mounting hierarchy & proceed up the * hierarchy if so. */ - if(f->mtab.parent) - if(H5F_try_close(f->mtab.parent) < 0) + if(f->parent) + if(H5F_try_close(f->parent) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close parent file") /* Unmount and close each child before closing the current file. */ |