summaryrefslogtreecommitdiffstats
path: root/src/H5VLnative.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2012-06-06 21:38:06 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2012-06-06 21:38:06 (GMT)
commit6d5505282c353aeeae1c5bd4420607cd7489c996 (patch)
treea3836814f1db688e841c1a06608d284fc3698815 /src/H5VLnative.c
parentf38d9a2149d189fa82b5b5d491f7ed10feffc900 (diff)
downloadhdf5-6d5505282c353aeeae1c5bd4420607cd7489c996.zip
hdf5-6d5505282c353aeeae1c5bd4420607cd7489c996.tar.gz
hdf5-6d5505282c353aeeae1c5bd4420607cd7489c996.tar.bz2
[svn-r22439] file image and mount operations handled in VOL
Diffstat (limited to 'src/H5VLnative.c')
-rw-r--r--src/H5VLnative.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/H5VLnative.c b/src/H5VLnative.c
index 24b8947..1ef7b09 100644
--- a/src/H5VLnative.c
+++ b/src/H5VLnative.c
@@ -1678,6 +1678,43 @@ H5VL_native_file_misc(hid_t loc_id, H5VL_file_misc_t misc_type, hid_t UNUSED req
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't determine if file is an HDF5 file")
break;
}
+ /* H5Fmount */
+ case H5VL_FILE_MOUNT:
+ {
+ const char *name = va_arg (arguments, const char *);
+ hid_t child_id = va_arg (arguments, hid_t);
+ hid_t plist_id = va_arg (arguments, hid_t);
+ H5G_loc_t loc;
+ H5F_t *child = NULL;
+
+ /* Check arguments */
+ if(H5G_loc(loc_id, &loc) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ if(NULL == (child = (H5F_t *)H5I_object_verify(child_id, H5I_FILE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file")
+
+ /* Do the mount */
+ if(H5F_mount(&loc, name, child, plist_id, H5AC_dxpl_id) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to mount file")
+
+ break;
+ }
+ /* H5Fmount */
+ case H5VL_FILE_UNMOUNT:
+ {
+ const char *name = va_arg (arguments, const char *);
+ H5G_loc_t loc;
+
+ /* Check arguments */
+ if(H5G_loc(loc_id, &loc) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+
+ /* Unmount */
+ if (H5F_unmount(&loc, name, H5AC_dxpl_id) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to unmount file")
+
+ break;
+ }
default:
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't recognize this operation type")
}
@@ -1734,6 +1771,18 @@ H5VL_native_file_optional(hid_t id, H5VL_file_optional_t optional_type, hid_t UN
*ret = (hsize_t)eof;
break;
}
+ /* H5Fget_file_image */
+ case H5VL_FILE_GET_FILE_IMAGE:
+ {
+ void *buf_ptr = va_arg (arguments, void *);
+ ssize_t *ret = va_arg (arguments, ssize_t *);
+ size_t buf_len = va_arg (arguments, size_t );
+
+ /* Do the actual work */
+ if((*ret = H5F_get_file_image(f, buf_ptr, buf_len)) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "get file image failed")
+ break;
+ }
/* H5Fget_freespace */
case H5VL_FILE_GET_FREE_SPACE:
{