summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2008-08-07 21:49:05 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2008-08-07 21:49:05 (GMT)
commite980307ed9ee9acc414c6166e5f76282fc44bacd (patch)
tree9c79db2c965b1df62d50bde9f0cad71456b40310 /src/H5F.c
parenta5de140500d6655c80272b82c748a23440539273 (diff)
downloadhdf5-e980307ed9ee9acc414c6166e5f76282fc44bacd.zip
hdf5-e980307ed9ee9acc414c6166e5f76282fc44bacd.tar.gz
hdf5-e980307ed9ee9acc414c6166e5f76282fc44bacd.tar.bz2
[svn-r15451] 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: committest in 1.8 branch. Committing now due to the urgency of the fix. No changes here are specific to the trunk, but I will keep an eye on the daily tests.
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 80c28bc..a5427db 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -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. */