Thread (29 messages) 29 messages, 7 authors, 2018-08-31

Re: [PATCH 2/2] fs/dcache: Make negative dentries easier to be reclaimed

From: Waiman Long <longman@redhat.com>
Date: 2018-08-28 22:29:29
Also in: linux-fsdevel, linux-mm, lkml

On 08/28/2018 06:13 PM, Matthew Wilcox wrote:
On Tue, Aug 28, 2018 at 01:19:40PM -0400, Waiman Long wrote:
quoted
@@ -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);
Yes, I can rewrite it. What is the problem with the abbreviated form?

Cheers,
Longman
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help