Пример #1
0
void ADIOI_PVFS_Delete(char *filename, int *error_code)
{
    int err;
    static char myname[] = "ADIOI_PVFS_DELETE";

    err = pvfs_unlink(filename);
    if (err == -1) {
	*error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
					   myname, __LINE__, MPI_ERR_IO,
					   "**io",
					   "**io %s", strerror(errno));
    }
    else *error_code = MPI_SUCCESS;
}
Пример #2
0
/*
  retry an open after a sharing violation
*/
static void pvfs_retry_unlink(struct pvfs_odb_retry *r,
			      struct ntvfs_module_context *ntvfs,
			      struct ntvfs_request *req,
			      void *_io,
			      void *private_data,
			      enum pvfs_wait_notice reason)
{
	union smb_unlink *io = talloc_get_type(_io, union smb_unlink);
	NTSTATUS status = NT_STATUS_INTERNAL_ERROR;

	talloc_free(r);

	switch (reason) {
	case PVFS_WAIT_CANCEL:
/*TODO*/
		status = NT_STATUS_CANCELLED;
		break;
	case PVFS_WAIT_TIMEOUT:
		/* if it timed out, then give the failure
		   immediately */
/*TODO*/
		status = NT_STATUS_SHARING_VIOLATION;
		break;
	case PVFS_WAIT_EVENT:

		/* try the open again, which could trigger another retry setup
		   if it wants to, so we have to unmark the async flag so we
		   will know if it does a second async reply */
		req->async_states->state &= ~NTVFS_ASYNC_STATE_ASYNC;

		status = pvfs_unlink(ntvfs, req, io);
		if (req->async_states->state & NTVFS_ASYNC_STATE_ASYNC) {
			/* the 2nd try also replied async, so we don't send
			   the reply yet */
			return;
		}

		/* re-mark it async, just in case someone up the chain does
		   paranoid checking */
		req->async_states->state |= NTVFS_ASYNC_STATE_ASYNC;
		break;
	}

	/* send the reply up the chain */
	req->async_states->status = status;
	req->async_states->send_fn(req);
}
Пример #3
0
 void remove_file_work(std::string const& file_name, int& result)
 {
     result = pvfs_unlink(file_name.c_str());
 }