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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170115235431.GF14446@mtj.duckdns.org>
Date:   Sun, 15 Jan 2017 18:54:31 -0500
From:   Tejun Heo <tj@...nel.org>
To:     Geliang Tang <geliangtang@...il.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Michal Hocko <mhocko@...e.com>, Jens Axboe <axboe@...com>,
        Johannes Weiner <hannes@...xchg.org>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] writeback: use rb_entry()

On Fri, Jan 13, 2017 at 11:17:12PM +0800, Geliang Tang wrote:
> To make the code clearer, use rb_entry() instead of container_of() to
> deal with rbtree.
> 
> Signed-off-by: Geliang Tang <geliangtang@...il.com>
> ---
>  mm/backing-dev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/backing-dev.c b/mm/backing-dev.c
> index 3bfed5ab..ffb77a1 100644
> --- a/mm/backing-dev.c
> +++ b/mm/backing-dev.c
> @@ -410,8 +410,8 @@ wb_congested_get_create(struct backing_dev_info *bdi, int blkcg_id, gfp_t gfp)
>  
>  	while (*node != NULL) {
>  		parent = *node;
> -		congested = container_of(parent, struct bdi_writeback_congested,
> -					 rb_node);
> +		congested = rb_entry(parent, struct bdi_writeback_congested,
> +				     rb_node);

I don't get the rb_entry() macro.  It's just another name for
container_of().  I have no objection to the patch but this macro is a
bit silly.

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ