diff options
author | John Mainzer <mainzer@hdfgroup.org> | 2007-04-09 18:58:42 (GMT) |
---|---|---|
committer | John Mainzer <mainzer@hdfgroup.org> | 2007-04-09 18:58:42 (GMT) |
commit | 030543bf0df05153d4189bc8556a6f8506cb0cff (patch) | |
tree | 07146066b5536e88e44b1bc35c22c953735b5c2c /src/H5AC.c | |
parent | a3d8f174dc6405b8c439485d04a4343564a20e4a (diff) | |
download | hdf5-030543bf0df05153d4189bc8556a6f8506cb0cff.zip hdf5-030543bf0df05153d4189bc8556a6f8506cb0cff.tar.gz hdf5-030543bf0df05153d4189bc8556a6f8506cb0cff.tar.bz2 |
[svn-r13618] Modified metadata cache to support multiple read only protects of
cache entries. Added test code to test the new feature. Also some
minor cleanum
h5committested -- passed on copper and sol. Failed on osage with
a configuration error that appears unrelated to my changes. Serial
test (debug mode) passes on Phoenix (Linux x86 2.6 kernel), so I
went ahead with the checkin.
Diffstat (limited to 'src/H5AC.c')
-rw-r--r-- | src/H5AC.c | 41 |
1 files changed, 36 insertions, 5 deletions
@@ -1872,6 +1872,14 @@ done: * JRM - 6/6/06 * Added trace file support. * + * JRM - 3/18/07 + * Modified code to support the new flags parameter for + * H5C_protect(). For now, that means passing in the + * H5C_READ_ONLY_FLAG if rw == H5AC_READ. + * + * Also updated the trace file output to save the + * rw parameter, since we are now doing something with it. + * *------------------------------------------------------------------------- */ void * @@ -1881,9 +1889,10 @@ H5AC_protect(H5F_t *f, haddr_t addr, const void *udata1, void *udata2, - H5AC_protect_t UNUSED rw) + H5AC_protect_t rw) { /* char * fcn_name = "H5AC_protect"; */ + unsigned protect_flags = H5C__NO_FLAGS_SET; void * thing = (void *)NULL; void * ret_value; /* Return value */ #if H5AC__TRACE_FILE_ENABLED @@ -1915,12 +1924,33 @@ H5AC_protect(H5F_t *f, ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0 ) && ( trace_file_ptr != NULL ) ) { - sprintf(trace, "H5AC_protect %lx %d", + char * rw_string; + + if ( rw == H5AC_WRITE ) { + + rw_string = "H5AC_WRITE"; + + } else if ( rw == H5AC_READ ) { + + rw_string = "H5AC_READ"; + + } else { + + rw_string = "???"; + } + + sprintf(trace, "H5AC_protect %lx %d %s", (unsigned long)addr, - (int)(type->id)); + (int)(type->id), + rw_string); } #endif /* H5AC__TRACE_FILE_ENABLED */ + if ( rw == H5AC_READ ) { + + protect_flags |= H5C__READ_ONLY_FLAG; + } + thing = H5C_protect(f, dxpl_id, H5AC_noblock_dxpl_id, @@ -1928,7 +1958,8 @@ H5AC_protect(H5F_t *f, type, addr, udata1, - udata2); + udata2, + protect_flags); if ( thing == NULL ) { @@ -2276,7 +2307,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0 ) && ( trace_file_ptr != NULL ) ) { - sprintf(trace, "H5AC_protect %lx %d", + sprintf(trace, "H5AC_unprotect %lx %d", (unsigned long)addr, (int)(type->id)); |