public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/5] block: rename the return of two functions
@ 2011-06-05 16:26 Paul Bolle
  2011-06-06  3:03 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Bolle @ 2011-06-05 16:26 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Paul E. McKenney, Vivek Goyal, linux-kernel

If we rename the return of alloc_io_context() and get_io_context() from
"ret" to "ioc" the code get's (a bit) more readable and (a lot) more
grepable.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
 block/blk-ioc.c |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/block/blk-ioc.c b/block/blk-ioc.c
index 998fa67..79c543f 100644
--- a/block/blk-ioc.c
+++ b/block/blk-ioc.c
@@ -82,23 +82,23 @@ void exit_io_context(struct task_struct *task)
 
 struct io_context *alloc_io_context(gfp_t gfp_flags, int node)
 {
-	struct io_context *ret;
+	struct io_context *ioc;
 
-	ret = kmem_cache_alloc_node(iocontext_cachep, gfp_flags, node);
-	if (ret) {
-		atomic_long_set(&ret->refcount, 1);
-		atomic_set(&ret->nr_tasks, 1);
-		spin_lock_init(&ret->lock);
-		ret->ioprio_changed = 0;
-		ret->ioprio = 0;
-		ret->last_waited = 0; /* doesn't matter... */
-		ret->nr_batch_requests = 0; /* because this is 0 */
-		INIT_RADIX_TREE(&ret->radix_root, GFP_ATOMIC | __GFP_HIGH);
-		INIT_HLIST_HEAD(&ret->cic_hlist);
-		ret->last_cic = NULL;
+	ioc = kmem_cache_alloc_node(iocontext_cachep, gfp_flags, node);
+	if (ioc) {
+		atomic_long_set(&ioc->refcount, 1);
+		atomic_set(&ioc->nr_tasks, 1);
+		spin_lock_init(&ioc->lock);
+		ioc->ioprio_changed = 0;
+		ioc->ioprio = 0;
+		ioc->last_waited = 0; /* doesn't matter... */
+		ioc->nr_batch_requests = 0; /* because this is 0 */
+		INIT_RADIX_TREE(&ioc->radix_root, GFP_ATOMIC | __GFP_HIGH);
+		INIT_HLIST_HEAD(&ioc->cic_hlist);
+		ioc->last_cic = NULL;
 	}
 
-	return ret;
+	return ioc;
 }
 
 /*
@@ -136,19 +136,19 @@ struct io_context *current_io_context(gfp_t gfp_flags, int node)
  */
 struct io_context *get_io_context(gfp_t gfp_flags, int node)
 {
-	struct io_context *ret = NULL;
+	struct io_context *ioc = NULL;
 
 	/*
 	 * Check for unlikely race with exiting task. ioc ref count is
 	 * zero when ioc is being detached.
 	 */
 	do {
-		ret = current_io_context(gfp_flags, node);
-		if (unlikely(!ret))
+		ioc = current_io_context(gfp_flags, node);
+		if (unlikely(!ioc))
 			break;
-	} while (!atomic_long_inc_not_zero(&ret->refcount));
+	} while (!atomic_long_inc_not_zero(&ioc->refcount));
 
-	return ret;
+	return ioc;
 }
 EXPORT_SYMBOL(get_io_context);
 
-- 
1.7.5.2





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 4/5] block: rename the return of two functions
  2011-06-05 16:26 [PATCH 4/5] block: rename the return of two functions Paul Bolle
@ 2011-06-06  3:03 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2011-06-06  3:03 UTC (permalink / raw)
  To: Paul Bolle; +Cc: Paul E. McKenney, Vivek Goyal, linux-kernel

On 2011-06-05 18:26, Paul Bolle wrote:
> If we rename the return of alloc_io_context() and get_io_context() from
> "ret" to "ioc" the code get's (a bit) more readable and (a lot) more
> grepable.

Agree, it matches the style of other places. Applied.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-06  3:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-05 16:26 [PATCH 4/5] block: rename the return of two functions Paul Bolle
2011-06-06  3:03 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox