Re: [PATCH] dm bio prison: use rb_entry()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2017/1/20 下午10:36, 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@xxxxxxxxx>
> ---
>  drivers/md/dm-bio-prison.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/md/dm-bio-prison.c b/drivers/md/dm-bio-prison.c
> index 03af174..a2c8a9e 100644
> --- a/drivers/md/dm-bio-prison.c
> +++ b/drivers/md/dm-bio-prison.c
> @@ -115,7 +115,7 @@ static int __bio_detain(struct dm_bio_prison *prison,
>  
>  	while (*new) {
>  		struct dm_bio_prison_cell *cell =
> -			container_of(*new, struct dm_bio_prison_cell, node);
> +			rb_entry(*new, struct dm_bio_prison_cell, node);
>  
>  		r = cmp_keys(key, &cell->key);
>  
> 
Acked-by: Coly Li <colyli@xxxxxxx>


--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux