diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-08-24 15:07:17 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-08-24 15:07:17 (GMT) |
commit | e3f4e81b5f98c28df2705974625ba2f97286897c (patch) | |
tree | 23a7161a3f47c8ab952075a5cb1abe2d2f7f7615 | |
parent | 1a3c594abf9db1c0d2672fcb7b6f6def01c439d1 (diff) | |
download | hdf5-e3f4e81b5f98c28df2705974625ba2f97286897c.zip hdf5-e3f4e81b5f98c28df2705974625ba2f97286897c.tar.gz hdf5-e3f4e81b5f98c28df2705974625ba2f97286897c.tar.bz2 |
[svn-r17413] Description:
Remove vestigial intermediate routine for flushing file and move it
into API routine. Also, remove private, unused (now) 'H5F_FLUSH_DOWN' symbol
from public header file.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
-rw-r--r-- | src/H5F.c | 80 | ||||
-rw-r--r-- | src/H5Fmount.c | 2 | ||||
-rw-r--r-- | src/H5Fpkg.h | 2 | ||||
-rw-r--r-- | src/H5Fpublic.h | 3 | ||||
-rw-r--r-- | src/H5trace.c | 4 |
5 files changed, 29 insertions, 62 deletions
@@ -71,7 +71,6 @@ static herr_t H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, void** file_hand static H5F_t *H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf); static herr_t H5F_dest(H5F_t *f, hid_t dxpl_id); -static herr_t H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope); static herr_t H5F_close(H5F_t *f); /* Declare a free list to manage the H5F_t struct */ @@ -1615,12 +1614,21 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) * Nothing to do if the file is read only. This determination is * made at the shared open(2) flags level, implying that opening a * file twice, once for read-only and once for read-write, and then - * calling H5F_flush() with the read-only handle, still causes data + * calling H5Fflush() with the read-only handle, still causes data * to be flushed. */ if(H5F_ACC_RDWR & f->shared->flags) { - if(H5F_flush(f, H5AC_dxpl_id, scope) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "flush failed") + /* Flush other files, depending on scope */ + if(H5F_SCOPE_GLOBAL == scope) { + /* Call the flush routine for mounted file hierarchies */ + if(H5F_flush_mounts(f, H5AC_dxpl_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush mounted file hierarchy") + } /* end if */ + else { + /* Call the flush routine, for this file */ + if(H5F_flush(f, H5AC_dxpl_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") + } /* end else */ } /* end if */ done: @@ -1631,47 +1639,6 @@ done: /*------------------------------------------------------------------------- * Function: H5F_flush * - * Purpose: Flushes cached data, possibly in all mounted files, - * depending on the SCOPE. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Aug 29 1997 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5F_flush) - - /* Sanity check arguments */ - HDassert(f); - - /* Flush other files, depending on scope */ - if(H5F_SCOPE_GLOBAL == scope) { - /* Call the flush routine for mounted file hierarchies */ - if(H5F_flush_mounts(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush mounted file hierarchy") - } /* end if */ - else { - /* Call the "real" flush routine, for this file */ - if(H5F_flush_real(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") - } /* end else */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_flush() */ - - -/*------------------------------------------------------------------------- - * Function: H5F_flush_real - * * Purpose: Flushes cached data. * * Return: Non-negative on success/Negative on failure @@ -1683,18 +1650,19 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_flush_real(H5F_t *f, hid_t dxpl_id) +H5F_flush(H5F_t *f, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5F_flush_real, FAIL) + FUNC_ENTER_NOAPI(H5F_flush, FAIL) /* Sanity check arguments */ HDassert(f); /* Flush any cached dataset storage raw data */ if(H5D_flush(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush dataset cache") + /* Push error, but keep going*/ + HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush dataset cache") /* Release any space allocated to space aggregators, so that the eoa value * corresponds to the end of the space written to in the file. @@ -1703,23 +1671,27 @@ H5F_flush_real(H5F_t *f, hid_t dxpl_id) * 'eoa' value is written in superblock -QAK) */ if(H5MF_free_aggrs(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release file space") + /* Push error, but keep going*/ + HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release file space") /* Flush the entire metadata cache */ if(H5AC_flush(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache") + /* Push error, but keep going*/ + HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache") /* Flush out the metadata accumulator */ if(H5F_accum_flush(f, dxpl_id) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush metadata accumulator") + /* Push error, but keep going*/ + HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush metadata accumulator") /* Flush file buffers to disk. */ if(H5FD_flush(f->shared->lf, dxpl_id, FALSE) < 0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "low level flush failed") + /* Push error, but keep going*/ + HDONE_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "low level flush failed") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_flush_real() */ +} /* end H5F_flush() */ /*------------------------------------------------------------------------- @@ -1925,7 +1897,7 @@ H5F_try_close(H5F_t *f) */ if(f->intent&H5F_ACC_RDWR) { /* Flush all caches */ - if(H5F_flush_real(f, H5AC_dxpl_id) < 0) + if(H5F_flush(f, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") } /* end if */ diff --git a/src/H5Fmount.c b/src/H5Fmount.c index 0d26edf..f70a7c6 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -658,7 +658,7 @@ H5F_flush_mounts_recurse(H5F_t *f, hid_t dxpl_id) nerrors++; /* Call the "real" flush routine, for this file */ - if(H5F_flush_real(f, dxpl_id) < 0) + if(H5F_flush(f, dxpl_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") /* Check flush errors for children - errors are already on the stack */ diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 0b4c9be..37ad094 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -288,7 +288,7 @@ H5_DLLVAR const H5AC_class_t H5AC_SUPERBLOCK[1]; /* General routines */ H5_DLL herr_t H5F_init(void); H5_DLL haddr_t H5F_locate_signature(H5FD_t *file, hid_t dxpl_id); -H5_DLL herr_t H5F_flush_real(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5F_flush(H5F_t *f, hid_t dxpl_id); /* File mount related routines */ H5_DLL herr_t H5F_close_mounts(H5F_t *f); diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index e23ad2d..20814b6 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -79,8 +79,7 @@ /* The difference between a single file and a set of mounted files */ typedef enum H5F_scope_t { H5F_SCOPE_LOCAL = 0, /*specified file handle only */ - H5F_SCOPE_GLOBAL = 1, /*entire virtual file */ - H5F_SCOPE_DOWN = 2 /*for internal use only */ + H5F_SCOPE_GLOBAL = 1 /*entire virtual file */ } H5F_scope_t; /* Unlimited file size for H5Pset_external() */ diff --git a/src/H5trace.c b/src/H5trace.c index 172a7f7..5f1e128 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -674,10 +674,6 @@ H5_trace (const double *returning, const char *func, const char *type, ...) case H5F_SCOPE_GLOBAL: fprintf(out, "H5F_SCOPE_GLOBAL"); break; - case H5F_SCOPE_DOWN: - fprintf(out, "H5F_SCOPE_DOWN " - "/*FOR INTERNAL USE ONLY!*/"); - break; default: fprintf(out, "%ld", (long)scope); break; |