summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2009-03-25 19:49:19 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2009-03-25 19:49:19 (GMT)
commit2def5e4c85b2fa2cdc992f360a90dc2a103e9e17 (patch)
tree5302b31883ca82722868483b48e06e7c6b66f05f
parent30ccff2212467bfb342b566752c41de94cd4bf85 (diff)
downloadhdf5-2def5e4c85b2fa2cdc992f360a90dc2a103e9e17.zip
hdf5-2def5e4c85b2fa2cdc992f360a90dc2a103e9e17.tar.gz
hdf5-2def5e4c85b2fa2cdc992f360a90dc2a103e9e17.tar.bz2
[svn-r16613] In previous checkin (r16609), the flag "write_driver" wasn't necessary as Quincey pointed out.
I took it out and used the driver address instead. Tested on jam - simple change.
-rw-r--r--src/H5F.c1
-rw-r--r--src/H5Fpkg.h1
-rw-r--r--src/H5Fsuper.c20
-rw-r--r--test/vfd.c4
4 files changed, 11 insertions, 15 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 6ca852a..e7b4cd3 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -891,7 +891,6 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf)
for(u = 0; u < NELMTS(f->shared->fs_addr); u++)
f->shared->fs_addr[u] = HADDR_UNDEF;
f->shared->driver_addr = HADDR_UNDEF;
- f->shared->write_driver = TRUE;
f->shared->accum.loc = HADDR_UNDEF;
f->shared->lf = lf;
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index 6434017..4080705 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -134,7 +134,6 @@ typedef struct H5F_file_t {
unsigned sohm_vers; /* Version of shared message table on disk */
unsigned sohm_nindexes; /* Number of shared messages indexes in the table */
haddr_t driver_addr; /* File driver information block address*/
- hbool_t write_driver; /* Whether to write file driver block in the superblock */
unsigned long feature_flags; /* VFL Driver feature Flags */
haddr_t maxaddr; /* Maximum address for file */
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c
index 69c7a8d..04abfb2 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -466,16 +466,6 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc)
if(H5FD_sb_decode(lf, drv_name, p) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to decode driver information")
} /* end if */
- else
- /* This flag is false only if a file was created with v1.6 library or
- * before and no driver info was saved in the superblock. When the file is
- * closed and superblock is written to the file, v1.8 library or after
- * doesn't write the driver info in the superblock. Otherwise, the newly
- * added driver block will overwrite the (meta)data right after the
- * superblock. SLU - 2009/3/24
- */
- shared->write_driver = FALSE;
-
} /* end if */
else {
haddr_t root_addr; /* Address of root group */
@@ -944,7 +934,15 @@ H5F_super_write(H5F_t *f, hid_t dxpl_id)
/* Encode the driver information block. */
H5_ASSIGN_OVERFLOW(driver_size, H5FD_sb_size(f->shared->lf), hsize_t, size_t);
- if(driver_size > 0 && f->shared->write_driver) {
+
+ /* Checking whether driver block address is defined here is to handle backward
+ * compatibility. If the file was created with v1.6 library or earlier and no
+ * driver info block was written in the superblock, we don't write it either even
+ * though there's some driver info. Otherwise, the driver block extended will
+ * overwrite the (meta)data right after the superblock. This situation happens to
+ * the family driver particularly. SLU - 2009/3/24
+ */
+ if(driver_size > 0 && H5F_addr_defined(f->shared->driver_addr)) {
char driver_name[9]; /* Name of driver, for driver info block */
uint8_t *dbuf = p; /* Pointer to beginning of driver info */
diff --git a/test/vfd.c b/test/vfd.c
index 3e792cc..57798a5 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -831,7 +831,7 @@ test_family_compat(void)
if((file = H5Fopen(pathname, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR;
- if((dset = H5Dopen(file, dname, H5P_DEFAULT)) < 0)
+ if((dset = H5Dopen2(file, dname, H5P_DEFAULT)) < 0)
TEST_ERROR;
if(H5Dclose(dset) < 0)
@@ -844,7 +844,7 @@ test_family_compat(void)
if((file = H5Fopen(pathname, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR;
- if((dset = H5Dopen(file, dname, H5P_DEFAULT)) < 0)
+ if((dset = H5Dopen2(file, dname, H5P_DEFAULT)) < 0)
TEST_ERROR;
if(H5Dclose(dset) < 0)