| 1 |
/* |
| 2 |
* Copyright (C) by Argonne National Laboratory |
| 3 |
* See COPYRIGHT in top-level directory |
| 4 |
*/ |
| 5 |
|
| 6 |
#include "ad_daos.h" |
| 7 |
|
| 8 |
void ADIOI_DAOS_Fcntl(ADIO_File fd, int flag, ADIO_Fcntl_t * fcntl_struct, int *error_code) |
| 9 |
{ |
| 10 |
int rc; |
| 11 |
struct ADIO_DAOS_cont *cont = fd->fs_ptr; |
| 12 |
static char myname[] = "ADIOI_DAOS_FCNTL"; |
| 13 |
|
| 14 |
switch (flag) { |
| 15 |
case ADIO_FCNTL_GET_FSIZE: |
| 16 |
{ |
| 17 |
daos_size_t fsize; |
| 18 |
|
| 19 |
rc = dfs_get_size(cont->dfs, cont->obj, &fsize); |
| 20 |
if (rc != 0) { |
| 21 |
*error_code = ADIOI_DAOS_err(myname, cont->obj_name, __LINE__, rc); |
| 22 |
break; |
| 23 |
} |
| 24 |
*error_code = MPI_SUCCESS; |
| 25 |
fcntl_struct->fsize = (ADIO_Offset) fsize; |
| 26 |
break; |
| 27 |
} |
| 28 |
case ADIO_FCNTL_SET_DISKSPACE: |
| 29 |
case ADIO_FCNTL_SET_ATOMICITY: |
| 30 |
default: |
| 31 |
*error_code = MPIO_Err_create_code(MPI_SUCCESS, |
| 32 |
MPIR_ERR_RECOVERABLE, |
| 33 |
myname, __LINE__, |
| 34 |
MPI_ERR_ARG, "**flag", "**flag %d", flag); |
| 35 |
} |
| 36 |
} |