summaryrefslogtreecommitdiffstats
path: root/src/H5Fmount.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2014-09-05 21:36:55 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2014-09-05 21:36:55 (GMT)
commit05d51c036140f94a07efb75aab9675b3b4bd5ef0 (patch)
tree5fe046db1c355df5c771077164ba6d6c1f272866 /src/H5Fmount.c
parentf2e6cec0728a75f5982e3b6d91f0ce823d1206a6 (diff)
downloadhdf5-05d51c036140f94a07efb75aab9675b3b4bd5ef0.zip
hdf5-05d51c036140f94a07efb75aab9675b3b4bd5ef0.tar.gz
hdf5-05d51c036140f94a07efb75aab9675b3b4bd5ef0.tar.bz2
[svn-r25575] cleanup H5I usage in VOL by removing the use of the aux pointer and
make a higher level wrapper object around all VOL objects that includes the VOL information.
Diffstat (limited to 'src/H5Fmount.c')
-rw-r--r--src/H5Fmount.c41
1 files changed, 14 insertions, 27 deletions
diff --git a/src/H5Fmount.c b/src/H5Fmount.c
index b9fc596..fa230e2 100644
--- a/src/H5Fmount.c
+++ b/src/H5Fmount.c
@@ -28,7 +28,7 @@
#include "H5Iprivate.h" /* IDs */
#include "H5Pprivate.h" /* Property lists */
#include "H5MMprivate.h" /* Memory management */
-#include "H5VLprivate.h" /* VOL plugins */
+#include "H5VLprivate.h" /* VOL */
/* PRIVATE PROTOTYPES */
static void H5F_mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs);
@@ -468,10 +468,8 @@ H5F_is_mount(const H5F_t *file)
herr_t
H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id)
{
- void *obj;
- void *file;
- H5VL_t *vol_plugin1; /* VOL structure attached to loc_id */
- H5VL_t *vol_plugin2; /* VOL structure attached to child_id */
+ H5VL_object_t *obj;
+ H5VL_object_t *file;
H5I_type_t type;
herr_t ret_value = SUCCEED; /* Return value */
@@ -492,25 +490,19 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or group object")
}
- /* get the plugin pointers */
- if (NULL == (vol_plugin1 = (H5VL_t *)H5I_get_aux(loc_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information")
- if (NULL == (vol_plugin2 = (H5VL_t *)H5I_get_aux(child_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information")
-
- /* check if both objects are associated with the same VOL plugin */
- if (vol_plugin1->cls->value != vol_plugin2->cls->value)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Can't mount file onto object from different VOL plugin")
-
/* get the group/file object */
- if(NULL == (obj = (void *)H5I_object(loc_id)))
+ if(NULL == (obj = (H5VL_object_t *)H5I_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
/* get the file object */
- if(NULL == (file = (void *)H5I_object(child_id)))
+ if(NULL == (file = (H5VL_object_t *)H5I_object(child_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
- if(H5VL_file_specific(obj, vol_plugin1->cls, H5VL_FILE_MOUNT, H5AC_dxpl_id,
- H5_REQUEST_NULL, type, name, file, plist_id) < 0)
+ /* check if both objects are associated with the same VOL plugin */
+ if (obj->vol_info->vol_cls->value != file->vol_info->vol_cls->value)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Can't mount file onto object from different VOL plugin")
+
+ if(H5VL_file_specific(obj->vol_obj, obj->vol_info->vol_cls, H5VL_FILE_MOUNT, H5AC_dxpl_id,
+ H5_REQUEST_NULL, type, name, file->vol_obj, plist_id) < 0)
HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to mount file")
done:
@@ -540,8 +532,7 @@ done:
herr_t
H5Funmount(hid_t loc_id, const char *name)
{
- void *obj;
- H5VL_t *vol_plugin; /* VOL structure attached to loc_id */
+ H5VL_object_t *obj;
H5I_type_t type;
herr_t ret_value=SUCCEED; /* Return value */
@@ -557,15 +548,11 @@ H5Funmount(hid_t loc_id, const char *name)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or group object")
}
- /* get the plugin pointers */
- if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(loc_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information")
-
/* get the group/file object */
- if(NULL == (obj = (void *)H5I_object(loc_id)))
+ if(NULL == (obj = (H5VL_object_t *)H5I_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
- if(H5VL_file_specific(obj, vol_plugin->cls, H5VL_FILE_UNMOUNT, H5AC_dxpl_id,
+ if(H5VL_file_specific(obj->vol_obj, obj->vol_info->vol_cls, H5VL_FILE_UNMOUNT, H5AC_dxpl_id,
H5_REQUEST_NULL, type, name) < 0)
HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to unmount file")