lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <469F7B4C.5050502@openvz.org>
Date:	Thu, 19 Jul 2007 18:55:08 +0400
From:	Pavel Emelyanov <xemul@...nvz.org>
To:	Jens Axboe <jens.axboe@...cle.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
CC:	devel@...nvz.org
Subject: [PATCH] Cleanup elevator_ops->trim function

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@...nvz.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)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ