diff options
author | Robb Matzke <matzke@llnl.gov> | 1997-08-29 19:05:50 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1997-08-29 19:05:50 (GMT) |
commit | c48f8b7590ed6bc334a6d62ab651cda8124ba90f (patch) | |
tree | b782b9397109c8307122692a5da4656a79b76dbe /src/H5D.c | |
parent | 3d526ab6cb594c656497fce7efe0589c0f840272 (diff) | |
download | hdf5-c48f8b7590ed6bc334a6d62ab651cda8124ba90f.zip hdf5-c48f8b7590ed6bc334a6d62ab651cda8124ba90f.tar.gz hdf5-c48f8b7590ed6bc334a6d62ab651cda8124ba90f.tar.bz2 |
[svn-r52] ./src/H5O.c
If the symbol table entry doesn't change then the ent_modified
argument to H5O_modify() doesn't change. This allows us to
set ent_modified to false and then call H5O_modify() a whole
bunch of times and easily determine if any of the calls
modified the symbol table entry.
./src/H5D.c
Fixed caching of things in the symbol table entry using the
scheme we came up with a couple months ago.
Diffstat (limited to 'src/H5D.c')
-rw-r--r-- | src/H5D.c | 65 |
1 files changed, 43 insertions, 22 deletions
@@ -300,19 +300,17 @@ herr_t H5D_flush(hatom_t oid) /* * Write the necessary messages to the header. */ - /* - * Quincey? It should be just a matter of filling in the - * appropriate H5O_*_t struct and passing it to - * H5O_modify() along with &d_sym. - */ +/*------------------------------------------------------------------------- + * Quincey? It should be just a matter of filling in the + * appropriate H5O_*_t struct and passing it to + * H5O_modify() along with &d_sym. + *------------------------------------------------------------------------- + */ /* * Give the object header a name so others can access it. */ -#if 1 /* SEE_BELOW */ - d_sym.type = H5G_NOTHING_CACHED; -#endif if (H5G_insert (file, file->root_sym, NULL, dataset->name, &d_sym)<0) { HGOTO_ERROR (H5E_SYM, H5E_CANTINIT, FAIL); /*can't name header*/ @@ -324,22 +322,45 @@ herr_t H5D_flush(hatom_t oid) * Update existing header messages if necessary. If updating the * header messages changes the symbol table entry because new * info is cached, then we must re-insert the symbol entry into - * the directory. I'm still working on caching things in symbol - * table entries, so the easiest thing to do is: - * - * A. Don't change any messages, or - * B. Don't let the message cache anything, or - * C. Uncomment the `SEE_BELOW' statement above. + * the directory. + */ + hbool_t entry_changed = FALSE; + +/*------------------------------------------------------------------------- + * Quincey, you can get rid of this statement if either of the + * following are true: You don't change any messages or the + * changed messages aren't cached in the symbol table entry. + *------------------------------------------------------------------------- + */ + if (H5G_find (file, file->root_sym, NULL, dataset->name, &d_sym)<0) { + HGOTO_ERROR (H5E_SYM, H5E_CANTINIT, FAIL); + } + + /* + * Change any messaages that need to be updated. */ - - /* - * Quincey? It should be just a matter of filling in the - * appropriate H5O_*_t structs and passing them to - * H5O_modify(). Don't worry about caching things in - * the symbol table entry yet (pass NULL for the - * symbol table entry). - */ +#if 0 + H5O_modify (file, d_sym.header, &d_sym, &entry_changed, + H5O_WHATEVER, 0, &the_message); + H5O_modify (file, d_sym.header, &d_sym, &entry_changed, + H5O_WHATEVER, 0, &the_message); + H5O_modify (file, d_sym.header, &d_sym, &entry_changed, + H5O_WHATEVER, 0, &the_message); +#endif + +/*------------------------------------------------------------------------- + * Quincey, you can get rid of this `if' statement and the + * H5G_modify() call subject to the same constraints as above. + *------------------------------------------------------------------------- + */ + if (entry_changed) { + /* + * Make sure the symbol table entry as modified by the + * changing of messages gets back to the file. + */ + H5G_modify (file, file->root_sym, NULL, dataset->name, &d_sym); + } } dataset->modified = FALSE; } |