[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Apr 11 00:06:03 MDT 2012


The branch, master has been updated
       via  e02a788 Simplify the logic around doing an immediate event reschedule.
      from  0c44d46 s4:dsdb/samdb/ldb_modules/schema.c - move "get_last_structural_class()" into "util.c"

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit e02a788f6085cfa93e5b521ef4e0ced06e4353e3
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Apr 10 20:47:14 2012 -0700

    Simplify the logic around doing an immediate event reschedule.
    
    We don't need to do a talloc here, we already have a long-lived
    pointer we can pass in as the private data.
    
    Autobuild-User: Jeremy Allison <jra at samba.org>
    Autobuild-Date: Wed Apr 11 08:05:47 CEST 2012 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 source3/modules/vfs_aio_pthread.c |   30 +++++++-----------------------
 1 files changed, 7 insertions(+), 23 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_aio_pthread.c b/source3/modules/vfs_aio_pthread.c
index 1cddea3..cb441bf 100644
--- a/source3/modules/vfs_aio_pthread.c
+++ b/source3/modules/vfs_aio_pthread.c
@@ -407,17 +407,8 @@ static void aio_pthread_handle_immediate(struct tevent_context *ctx,
 				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);
+	struct aio_private_data *pd = (struct aio_private_data *)private_data;
 
-	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);
@@ -445,7 +436,7 @@ static void aio_pthread_handle_suspend_completion(struct event_context *event_ct
 	struct suspend_private *sp = (struct suspend_private *)p;
 	struct aio_private_data *pd = NULL;
 	struct tevent_immediate *im = NULL;
-	int *pjobid = NULL;
+	int jobid;
 	int i;
 
 	DEBUG(10, ("aio_pthread_handle_suspend_completion called with flags=%d\n",
@@ -455,21 +446,15 @@ static void aio_pthread_handle_suspend_completion(struct event_context *event_ct
 		return;
 	}
 
-	pjobid = talloc_array(NULL, int, 1);
-	if (pjobid == NULL) {
-		smb_panic("aio_pthread_handle_suspend_completion: no memory.");
-	}
-
-	if (pthreadpool_finished_job(pool, pjobid)) {
+	if (pthreadpool_finished_job(pool, &jobid)) {
 		smb_panic("aio_pthread_handle_suspend_completion: can't find job.");
 		return;
 	}
 
-	pd = find_private_data_by_jobid(*pjobid);
+	pd = find_private_data_by_jobid(jobid);
 	if (pd == NULL) {
 		DEBUG(1, ("aio_pthread_handle_completion cannot find jobid %d\n",
-			  *pjobid));
-		TALLOC_FREE(pjobid);
+			  jobid));
 		return;
 	}
 
@@ -477,7 +462,6 @@ static void aio_pthread_handle_suspend_completion(struct event_context *event_ct
 	for (i = 0; i < sp->num_entries; i++) {
 		if (sp->aiocb_array[i] == pd->aiocb) {
 			sp->num_finished++;
-			TALLOC_FREE(pjobid);
 			return;
 		}
 	}
@@ -492,12 +476,12 @@ static void aio_pthread_handle_suspend_completion(struct event_context *event_ct
 
 	DEBUG(10,("aio_pthread_handle_suspend_completion: "
 			"re-scheduling job id %d\n",
-			*pjobid));
+			jobid));
 
 	tevent_schedule_immediate(im,
 			server_event_context(),
 			aio_pthread_handle_immediate,
-			(void *)pjobid);
+			(void *)pd);
 }
 
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list