mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergey Temerkhanov <temerkhanov@cifronik.ru>
To: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/2] AIO: Change pr_debug statements to dprintk in fs/aio.c
Date: Tue, 16 Mar 2010 14:29:15 +0300	[thread overview]
Message-ID: <201003161429.15926.temerkhanov@cifronik.ru> (raw)
In-Reply-To: <201003161418.16959.temerkhanov@cifronik.ru>

[-- Attachment #1: Type: Text/Plain, Size: 150 bytes --]

Some functions in fs/aio.c use pr_debug and another use dprintk statements. 
This patch makes it uniform.


Regards, Sergey Temerkhanov, Cifronic ZAO

[-- Attachment #2: aio-debug.patch --]
[-- Type: text/x-patch, Size: 3934 bytes --]

diff -r 5bbe95a762e1 fs/aio.c
--- a/fs/aio.c	Tue Mar 16 14:11:37 2010 +0300
+++ b/fs/aio.c	Tue Mar 16 14:11:44 2010 +0300
@@ -76,7 +76,7 @@
 
 	aio_wq = create_workqueue("aio");
 
-	pr_debug("aio_setup: sizeof(struct page) = %d\n", (int)sizeof(struct page));
+	dprintk("aio_setup: sizeof(struct page) = %d\n", (int)sizeof(struct page));
 
 	return 0;
 }
@@ -221,7 +221,7 @@
 	aio_free_ring(ctx);
 	mmdrop(ctx->mm);
 	ctx->mm = NULL;
-	pr_debug("__put_ioctx: freeing %p\n", ctx);
+	dprintk("__put_ioctx: freeing %p\n", ctx);
 	call_rcu(&ctx->rcu_head, ctx_rcu_free);
 }
 
@@ -247,7 +247,7 @@
 	/* Prevent overflows */
 	if ((nr_events > (0x10000000U / sizeof(struct io_event))) ||
 	    (nr_events > (0x10000000U / sizeof(struct kiocb)))) {
-		pr_debug("ENOMEM: nr_events too high\n");
+		dprintk("ENOMEM: nr_events too high\n");
 		return ERR_PTR(-EINVAL);
 	}
 
@@ -468,6 +468,7 @@
 		kfree(req->ki_iovec);
 	kmem_cache_free(kiocb_cachep, req);
 	ctx->reqs_active--;
+	dprintk("really_put_req: req->ki_users: %d\n", req->ki_users);
 
 	if (unlikely(!ctx->reqs_active && ctx->dead))
 		wake_up(&ctx->wait);
@@ -503,12 +504,14 @@
  */
 static int __aio_put_req(struct kioctx *ctx, struct kiocb *req)
 {
-	dprintk(KERN_DEBUG "aio_put(%p): f_count=%ld\n",
+	dprintk("aio_put(%p): f_count=%ld\n",
 		req, atomic_long_read(&req->ki_filp->f_count));
 
 	assert_spin_locked(&ctx->ctx_lock);
 
 	req->ki_users--;
+	dprintk("__aio_put_req: req: %p, req->ki_users: %d\n",
+		req, req->ki_users);
 	BUG_ON(req->ki_users < 0);
 	if (likely(req->ki_users))
 		return 0;
@@ -954,6 +957,7 @@
 	 * cancelled requests don't get events, userland was given one
 	 * when the event got cancelled.
 	 */
+	dprintk("kiocbIsCancelled(iocb): %d\n", kiocbIsCancelled(iocb));
 	if (kiocbIsCancelled(iocb))
 		goto put_rq;
 
@@ -984,7 +988,7 @@
 	put_aio_ring_event(event, KM_IRQ0);
 	kunmap_atomic(ring, KM_IRQ1);
 
-	pr_debug("added to ring %p at [%lu]\n", iocb, tail);
+	dprintk("added to ring %p at [%lu]\n", iocb, tail);
 
 	/*
 	 * Check if the user asked us to deliver the result through an
@@ -1187,6 +1191,7 @@
 	}
 
 	while (likely(i < nr)) {
+		dprintk("aio: i: %d, nr: %ld\n", i, nr);
 		add_wait_queue_exclusive(&ctx->wait, &wait);
 		do {
 			set_task_state(tsk, TASK_INTERRUPTIBLE);
@@ -1199,6 +1204,7 @@
 				ret = -EINVAL;
 				break;
 			}
+			dprintk("aio: to.timed_out: %d\n", to.timed_out);
 			if (to.timed_out)	/* Only check after read evt */
 				break;
 			/* Try to only show up in io wait if there are ops
@@ -1294,7 +1300,7 @@
 
 	ret = -EINVAL;
 	if (unlikely(ctx || nr_events == 0)) {
-		pr_debug("EINVAL: io_setup: ctx %lu nr_events %u\n",
+		dprintk("EINVAL: io_setup: ctx %lu nr_events %u\n",
 		         ctx, nr_events);
 		goto out;
 	}
@@ -1327,7 +1333,7 @@
 		io_destroy(ioctx);
 		return 0;
 	}
-	pr_debug("EINVAL: io_destroy: invalid context id\n");
+	dprintk("EINVAL: io_destroy: invalid context id\n");
 	return -EINVAL;
 }
 
@@ -1586,7 +1592,7 @@
 
 	/* enforce forwards compatibility on users */
 	if (unlikely(iocb->aio_reserved1 || iocb->aio_reserved2)) {
-		pr_debug("EINVAL: io_submit: reserve field set\n");
+		dprintk("EINVAL: io_submit: reserve field set\n");
 		return -EINVAL;
 	}
 
@@ -1596,7 +1602,7 @@
 	    (iocb->aio_nbytes != (size_t)iocb->aio_nbytes) ||
 	    ((ssize_t)iocb->aio_nbytes < 0)
 	   )) {
-		pr_debug("EINVAL: io_submit: overflow check\n");
+		dprintk("EINVAL: io_submit: overflow check\n");
 		return -EINVAL;
 	}
 
@@ -1690,7 +1696,7 @@
 
 	ctx = lookup_ioctx(ctx_id);
 	if (unlikely(!ctx)) {
-		pr_debug("EINVAL: io_submit: invalid context id\n");
+		dprintk("EINVAL: io_submit: invalid context id\n");
 		return -EINVAL;
 	}
 
@@ -1780,7 +1786,7 @@
 
 	if (NULL != cancel) {
 		struct io_event tmp;
-		pr_debug("calling cancel\n");
+		dprintk("calling cancel\n");
 		memset(&tmp, 0, sizeof(tmp));
 		tmp.obj = (u64)(unsigned long)kiocb->ki_obj.user;
 		tmp.data = kiocb->ki_user_data;

  reply	other threads:[~2010-03-16 11:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-16 11:18 [PATCH 1/2] AIO: Fix reference counting in io_cancel and aio_cancel_all Sergey Temerkhanov
2010-03-16 11:29 ` Sergey Temerkhanov [this message]
2010-03-16 14:49   ` [PATCH 2/2] AIO: Change pr_debug statements to dprintk in fs/aio.c Jeff Moyer
2010-03-16 14:46 ` [PATCH 1/2] AIO: Fix reference counting in io_cancel and aio_cancel_all Jeff Moyer
2010-03-16 16:26   ` [PATCH resubmit 2/3] " Сергей Темерханов
2010-03-16 16:30   ` [PATCH resubmit 3/3] AIO: Change dprintk statements to pr_debug Сергей Темерханов
2010-03-16 16:30   ` [PATCH resubmit 1/3] AIO: Move aio_cancel_all() Сергей Темерханов

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201003161429.15926.temerkhanov@cifronik.ru \
    --to=temerkhanov@cifronik.ru \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®