コード例 #1
0
ファイル: aio.c プロジェクト: rti7743/samba
static void smbd_aio_signal_handler(struct tevent_context *ev_ctx,
				    struct tevent_signal *se,
				    int signum, int count,
				    void *_info, void *private_data)
{
	siginfo_t *info = (siginfo_t *)_info;
	struct aio_extra *aio_ex = (struct aio_extra *)
				info->si_value.sival_ptr;

	smbd_aio_complete_aio_ex(aio_ex);
}
コード例 #2
0
static void aio_pthread_handle_immediate(struct tevent_context *ctx,
				struct tevent_immediate *im,
				void *private_data)
{
	struct aio_extra *aio_ex = NULL;
	int *pjobid = (int *)private_data;
	struct aio_private_data *pd = find_private_data_by_jobid(*pjobid);

	if (pd == NULL) {
		DEBUG(1, ("aio_pthread_handle_immediate cannot find jobid %d\n",
			  *pjobid));
		TALLOC_FREE(pjobid);
		return;
	}

	TALLOC_FREE(pjobid);
	aio_ex = (struct aio_extra *)pd->aiocb->aio_sigevent.sigev_value.sival_ptr;
	smbd_aio_complete_aio_ex(aio_ex);
	TALLOC_FREE(aio_ex);
}
コード例 #3
0
static void aio_pthread_handle_completion(struct event_context *event_ctx,
				struct fd_event *event,
				uint16 flags,
				void *p)
{
	struct aio_extra *aio_ex = NULL;
	struct aio_private_data *pd = NULL;
	int jobid = 0;
	int ret;

	DEBUG(10, ("aio_pthread_handle_completion called with flags=%d\n",
			(int)flags));

	if ((flags & EVENT_FD_READ) == 0) {
		return;
	}

	ret = pthreadpool_finished_job(pool, &jobid);
	if (ret) {
		smb_panic("aio_pthread_handle_completion");
		return;
	}

	pd = find_private_data_by_jobid(jobid);
	if (pd == NULL) {
		DEBUG(1, ("aio_pthread_handle_completion cannot find jobid %d\n",
			  jobid));
		return;
	}

	aio_ex = (struct aio_extra *)pd->aiocb->aio_sigevent.sigev_value.sival_ptr;
	smbd_aio_complete_aio_ex(aio_ex);

	DEBUG(10,("aio_pthread_handle_completion: jobid %d completed\n",
		jobid ));
	TALLOC_FREE(aio_ex);
}