<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Ken Chen &lt;kenneth.w.chen@intel.com&gt;

Clean up code that was previously used for debug purpose.  Remove aio_run,
aio_wakeups, iocb-&gt;ki_queued and iocb-&gt;ki_kicked.  Also clean up unused
variable count in __aio_run_iocbs() and debug code in read_events().

Signed-off-by: Ken Chen &lt;kenneth.w.chen@intel.com&gt;
Cc: Benjamin LaHaise &lt;bcrl@kvack.org&gt;
Cc: Suparna Bhattacharya &lt;suparna@in.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 fs/aio.c |   33 +++++----------------------------
 1 files changed, 5 insertions(+), 28 deletions(-)

diff -puN fs/aio.c~aio-remove-debug fs/aio.c
--- 25/fs/aio.c~aio-remove-debug	2005-04-26 20:12:24.585526784 -0700
+++ 25-akpm/fs/aio.c	2005-04-26 20:12:24.592525720 -0700
@@ -40,9 +40,6 @@
 #define dprintk(x...)	do { ; } while (0)
 #endif
 
-static long aio_run = 0; /* for testing only */
-static long aio_wakeups = 0; /* for testing only */
-
 /*------ sysctl variables----*/
 atomic_t aio_nr = ATOMIC_INIT(0);	/* current system wide number of aio requests */
 unsigned aio_max_nr = 0x10000;	/* system wide maximum number of aio requests */
@@ -617,7 +614,6 @@ static inline int __queue_kicked_iocb(st
 	if (list_empty(&amp;iocb-&gt;ki_run_list)) {
 		list_add_tail(&amp;iocb-&gt;ki_run_list,
 			&amp;ctx-&gt;run_list);
-		iocb-&gt;ki_queued++;
 		return 1;
 	}
 	return 0;
@@ -658,10 +654,8 @@ static ssize_t aio_run_iocb(struct kiocb
 	}
 
 	if (!(iocb-&gt;ki_retried &amp; 0xff)) {
-		pr_debug("%ld retry: %d of %d (kick %ld, Q %ld run %ld, wake %ld)\n",
-			iocb-&gt;ki_retried,
-			iocb-&gt;ki_nbytes - iocb-&gt;ki_left, iocb-&gt;ki_nbytes,
-			iocb-&gt;ki_kicked, iocb-&gt;ki_queued, aio_run, aio_wakeups);
+		pr_debug("%ld retry: %d of %d\n", iocb-&gt;ki_retried,
+			iocb-&gt;ki_nbytes - iocb-&gt;ki_left, iocb-&gt;ki_nbytes);
 	}
 
 	if (!(retry = iocb-&gt;ki_retry)) {
@@ -768,7 +762,6 @@ out:
 static int __aio_run_iocbs(struct kioctx *ctx)
 {
 	struct kiocb *iocb;
-	int count = 0;
 	LIST_HEAD(run_list);
 
 	list_splice_init(&amp;ctx-&gt;run_list, &amp;run_list);
@@ -783,9 +776,7 @@ static int __aio_run_iocbs(struct kioctx
 		aio_run_iocb(iocb);
 		if (__aio_put_req(ctx, iocb))  /* drop extra ref */
 			put_ioctx(ctx);
-		count++;
  	}
-	aio_run++;
 	if (!list_empty(&amp;ctx-&gt;run_list))
 		return 1;
 	return 0;
@@ -884,10 +875,8 @@ static void queue_kicked_iocb(struct kio
 	spin_lock_irqsave(&amp;ctx-&gt;ctx_lock, flags);
 	run = __queue_kicked_iocb(iocb);
 	spin_unlock_irqrestore(&amp;ctx-&gt;ctx_lock, flags);
-	if (run) {
+	if (run)
 		aio_queue_work(ctx);
-		aio_wakeups++;
-	}
 }
 
 /*
@@ -907,7 +896,6 @@ void fastcall kick_iocb(struct kiocb *io
 		return;
 	}
 
-	iocb-&gt;ki_kicked++;
 	/* If its already kicked we shouldn't queue it again */
 	if (!kiocbTryKick(iocb)) {
 		queue_kicked_iocb(iocb);
@@ -1003,10 +991,8 @@ int fastcall aio_complete(struct kiocb *
 
 	pr_debug("added to ring %p at [%lu]\n", iocb, tail);
 
-	pr_debug("%ld retries: %d of %d (kicked %ld, Q %ld run %ld wake %ld)\n",
-		iocb-&gt;ki_retried,
-		iocb-&gt;ki_nbytes - iocb-&gt;ki_left, iocb-&gt;ki_nbytes,
-		iocb-&gt;ki_kicked, iocb-&gt;ki_queued, aio_run, aio_wakeups);
+	pr_debug("%ld retries: %d of %d\n", iocb-&gt;ki_retried,
+		iocb-&gt;ki_nbytes - iocb-&gt;ki_left, iocb-&gt;ki_nbytes);
 put_rq:
 	/* everything turned out well, dispose of the aiocb. */
 	ret = __aio_put_req(ctx, iocb);
@@ -1114,7 +1100,6 @@ static int read_events(struct kioctx *ct
 	int			i = 0;
 	struct io_event		ent;
 	struct aio_timeout	to;
-	int 			event_loop = 0; /* testing only */
 	int			retry = 0;
 
 	/* needed to zero any padding within an entry (there shouldn't be 
@@ -1181,7 +1166,6 @@ retry:
 			if (to.timed_out)	/* Only check after read evt */
 				break;
 			schedule();
-			event_loop++;
 			if (signal_pending(tsk)) {
 				ret = -EINTR;
 				break;
@@ -1209,9 +1193,6 @@ retry:
 	if (timeout)
 		clear_timeout(&amp;to);
 out:
-	pr_debug("event loop executed %d times\n", event_loop);
-	pr_debug("aio_run %ld\n", aio_run);
-	pr_debug("aio_wakeups %ld\n", aio_wakeups);
 	return i ? i : ret;
 }
 
@@ -1526,10 +1507,6 @@ int fastcall io_submit_one(struct kioctx
 	init_waitqueue_func_entry(&amp;req-&gt;ki_wait, aio_wake_function);
 	INIT_LIST_HEAD(&amp;req-&gt;ki_wait.task_list);
 	req-&gt;ki_retried = 0;
-	req-&gt;ki_kicked = 0;
-	req-&gt;ki_queued = 0;
-	aio_run = 0;
-	aio_wakeups = 0;
 
 	ret = aio_setup_iocb(req);
 
_
</pre></body></html>