lkml.org 
[lkml]   [2018]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] fs/dcache: Make negative dentries easier to be reclaimed
On Tue, Aug 28, 2018 at 01:19:40PM -0400, Waiman Long wrote:
> @@ -134,7 +135,7 @@ bool list_lru_add(struct list_lru *lru, struct list_head *item)
> spin_lock(&nlru->lock);
> if (list_empty(item)) {
> l = list_lru_from_kmem(nlru, item, &memcg);
> - list_add_tail(item, &l->list);
> + (add_tail ? list_add_tail : list_add)(item, &l->list);
> /* Set shrinker bit if the first element was added */
> if (!l->nr_items++)
> memcg_set_shrinker_bit(memcg, nid,

That's not OK. Write it out properly, ie:

if (add_tail)
list_add_tail(item, &l->list);
else
list_add(item, &l->list);

\
 
 \ /
  Last update: 2018-08-29 00:14    [W:0.244 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site