From 46434499668593bb2421a58365700e53c128cb10 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 10 Oct 2000 14:55:09 -0500 Subject: [svn-r2656] Purpose: Bug Fix Description: When parallel I/O is turned on, there were some macros used in the H5D routines which poked around in the H5F_t structure. This breaks the privacy of that structure and ties the H5D code too tightly to the H5F_t struct. Solution: Added a small function to retrieve the the value (driver_id) needed from the H5F_t function. Platforms tested: Eyeballed only, Albert needs this right away... --- src/H5F.c | 27 +++++++++++++++++++++++++++ src/H5FDmpio.h | 2 +- src/H5Fprivate.h | 1 + 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/H5F.c b/src/H5F.c index db39416..06cd4e7 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -2507,6 +2507,33 @@ H5F_sizeof_size(H5F_t *f) /*------------------------------------------------------------------------- + * Function: H5F_get_intent + * + * Purpose: Quick and dirty routine to retrieve the file's 'driver_id' value + * (Mainly added to stop non-file routines from poking about in the + * H5F_t data structure) + * + * Return: 'driver_id' on success/abort on failure (shouldn't fail) + * + * Programmer: Quincey Koziol + * October 10, 2000 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +hid_t +H5F_get_driver_id(H5F_t *f) +{ + FUNC_ENTER(H5F_get_driver_id, 0); + + assert(f); + + FUNC_LEAVE(f->shared->lf->driver_id); +} + + +/*------------------------------------------------------------------------- * Function: H5F_block_read * * Purpose: Reads some data from a file/server/etc into a buffer. diff --git a/src/H5FDmpio.h b/src/H5FDmpio.h index e7df072..c0f8068 100644 --- a/src/H5FDmpio.h +++ b/src/H5FDmpio.h @@ -44,7 +44,7 @@ typedef struct H5FD_mpio_dxpl_t { #endif #define IS_H5FD_MPIO(f) /* (H5F_t *f) */ \ - (H5FD_MPIO==f->shared->lf->driver_id) + (H5FD_MPIO==H5F_get_driver_id(f)) /* Function prototypes */ __DLL__ hid_t H5FD_mpio_init(void); diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index d643f9e..d007614 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -307,6 +307,7 @@ struct H5S_t; /* Private functions, not part of the publicly documented API */ __DLL__ herr_t H5F_init(void); __DLL__ uintn H5F_get_intent(H5F_t *f); +__DLL__ hid_t H5F_get_driver_id(H5F_t *f); /* Functions that operate on array storage */ __DLL__ herr_t H5F_arr_create(H5F_t *f, -- cgit v0.12