All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Emelyanov <xemul@openvz.org>
To: Jens Axboe <jens.axboe@oracle.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: devel@openvz.org
Subject: [PATCH] Cleanup elevator_ops->trim function
Date: Thu, 19 Jul 2007 18:55:08 +0400	[thread overview]
Message-ID: <469F7B4C.5050502@openvz.org> (raw)

The elevator_ops's member "trim" is declared and called not like
all the other ones. Was this deliberate?

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

 block/as-iosched.c       |    2 +-
 block/cfq-iosched.c      |    2 +-
 block/elevator.c         |    4 ++--
 include/linux/elevator.h |    3 ++-
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/block/as-iosched.c b/block/as-iosched.c
index 3e316dd..add524c 100644
--- a/block/as-iosched.c
+++ b/block/as-iosched.c
@@ -1451,7 +1451,7 @@ static struct elevator_type iosched_as =
 		.elevator_may_queue_fn =	as_may_queue,
 		.elevator_init_fn =		as_init_queue,
 		.elevator_exit_fn =		as_exit_queue,
-		.trim =				as_trim,
+		.elevator_trim_fn =		as_trim,
 	},
 
 	.elevator_attrs = as_attrs,
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 9755a3c..5ee8c39 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -2237,7 +2237,7 @@ static struct elevator_type iosched_cfq 
 		.elevator_may_queue_fn =	cfq_may_queue,
 		.elevator_init_fn =		cfq_init_queue,
 		.elevator_exit_fn =		cfq_exit_queue,
-		.trim =				cfq_free_io_context,
+		.elevator_trim_fn =		cfq_free_io_context,
 	},
 	.elevator_attrs =	cfq_attrs,
 	.elevator_name =	"cfq",
diff --git a/block/elevator.c b/block/elevator.c
index d265963..ae7601f 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -983,12 +983,12 @@ void elv_unregister(struct elevator_type
 	/*
 	 * Iterate every thread in the process to remove the io contexts.
 	 */
-	if (e->ops.trim) {
+	if (e->ops.elevator_trim_fn) {
 		read_lock(&tasklist_lock);
 		do_each_thread(g, p) {
 			task_lock(p);
 			if (p->io_context)
-				e->ops.trim(p->io_context);
+				e->ops.elevator_trim_fn(p->io_context);
 			task_unlock(p);
 		} while_each_thread(g, p);
 		read_unlock(&tasklist_lock);
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index e88fcbc..896831a 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -29,6 +29,7 @@ typedef void (elevator_deactivate_req_fn
 
 typedef void *(elevator_init_fn) (request_queue_t *);
 typedef void (elevator_exit_fn) (elevator_t *);
+typedef void (elevator_trim_fn) (struct io_context *);
 
 struct elevator_ops
 {
@@ -55,7 +56,7 @@ struct elevator_ops
 
 	elevator_init_fn *elevator_init_fn;
 	elevator_exit_fn *elevator_exit_fn;
-	void (*trim)(struct io_context *);
+	elevator_trim_fn *elevator_trim_fn;
 };
 
 #define ELV_NAME_MAX	(16)

             reply	other threads:[~2007-07-19 14:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-19 14:55 Pavel Emelyanov [this message]
2007-07-19 17:29 ` [PATCH] Cleanup elevator_ops->trim function Jens Axboe

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=469F7B4C.5050502@openvz.org \
    --to=xemul@openvz.org \
    --cc=devel@openvz.org \
    --cc=jens.axboe@oracle.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.