00001
00002
00003
00004
00005
00006
00007
00008 #include "ad_pvfs2.h"
00009 #include "adio.h"
00010
00011 #include "ad_pvfs2_common.h"
00012
00013 void ADIOI_PVFS2_Delete(char *filename, int *error_code)
00014 {
00015 PVFS_credentials credentials;
00016 PVFS_sysresp_getparent resp_getparent;
00017 int ret;
00018 PVFS_fs_id cur_fs;
00019 static char myname[] = "ADIOI_PVFS2_DELETE";
00020 char pvfs_path[PVFS_NAME_MAX] = {0};
00021
00022 ADIOI_PVFS2_Init(error_code);
00023
00024 if (*error_code != MPI_SUCCESS)
00025 {
00026
00027 return;
00028 }
00029
00030
00031
00032
00033 ADIOI_PVFS2_makecredentials(&credentials);
00034
00035
00036 ret = PVFS_util_resolve(filename, &cur_fs, pvfs_path, PVFS_NAME_MAX);
00037
00038 if (ret != 0) {
00039 *error_code = MPIO_Err_create_code(MPI_SUCCESS,
00040 MPIR_ERR_RECOVERABLE,
00041 myname, __LINE__,
00042 ADIOI_PVFS2_error_convert(ret),
00043 "Error in PVFS_util_resolve", 0);
00044 return;
00045 }
00046
00047
00048 ret = PVFS_sys_getparent(cur_fs, pvfs_path, &credentials, &resp_getparent);
00049
00050 ret = PVFS_sys_remove(resp_getparent.basename,
00051 resp_getparent.parent_ref, &credentials);
00052
00053 if (ret != 0) {
00054 *error_code = MPIO_Err_create_code(MPI_SUCCESS,
00055 MPIR_ERR_RECOVERABLE,
00056 myname, __LINE__,
00057 ADIOI_PVFS2_error_convert(ret),
00058 "Error in PVFS_sys_remove", 0);
00059 return;
00060 }
00061
00062
00063 *error_code = MPI_SUCCESS;
00064 return;
00065 }
00066
00067
00068
00069