1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 herr_t
 ss_aio_hdf5_cb(int fd, hid_t dxpl, haddr_t addr, size_t size, const void *buf)
 {
     SS_ENTER(ss_aio_hdf5_cb, herr_t);
     ss_aio_t    *req;
     int         retval=0;

     if (H5Pget(dxpl, "async_req", &req)<0) SS_ERROR_FMT(HDF5, ("no async_req property"));
     if (!req || req->aio_buf!=buf) {
         retval = -1; /* cause HDF5 to process request synchronously, but this is not an error condition */
         goto done;
     }
     req->aio_fildes = fd;
     req->aio_offset = addr;
     req->aio_nbytes = size;
     if (ss_aio_write(req)>=0) {
         req = NULL;
         H5Pset(dxpl, "async_req", &req);
     }

 done:
 SS_CLEANUP:
     SS_LEAVE(retval);
 }