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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <ddabc96c798df194791134d8e070d728e2a7b59f.1482203698.git.geliangtang@gmail.com>
Date:   Tue, 20 Dec 2016 22:02:10 +0800
From:   Geliang Tang <geliangtang@...il.com>
To:     Alasdair Kergon <agk@...hat.com>,
        Mike Snitzer <snitzer@...hat.com>, Shaohua Li <shli@...nel.org>
Cc:     Geliang Tang <geliangtang@...il.com>, dm-devel@...hat.com,
        linux-raid@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] dm bufio: use rb_entry()

To make the code clearer, use rb_entry() instead of container_of() to
deal with rbtree.

Signed-off-by: Geliang Tang <geliangtang@...il.com>
---
 drivers/md/dm-bufio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index 84d2f0e..ae3c396 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -266,7 +266,7 @@ static struct dm_buffer *__find(struct dm_bufio_client *c, sector_t block)
 	struct dm_buffer *b;
 
 	while (n) {
-		b = container_of(n, struct dm_buffer, node);
+		b = rb_entry(n, struct dm_buffer, node);
 
 		if (b->block == block)
 			return b;
@@ -283,7 +283,7 @@ static void __insert(struct dm_bufio_client *c, struct dm_buffer *b)
 	struct dm_buffer *found;
 
 	while (*new) {
-		found = container_of(*new, struct dm_buffer, node);
+		found = rb_entry(*new, struct dm_buffer, node);
 
 		if (found->block == b->block) {
 			BUG_ON(found != b);
-- 
2.9.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ