From: Nathan Scott Date: Wed, 5 Jul 2006 03:54:20 +0000 (+0000) Subject: Userspace cache suffers the same reverse-list-insert issue that the kernel did. X-Git-Tag: v2.9.0~69 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=61c589040bb7f6712ba6a570bfbca9314e55e759;p=thirdparty%2Fxfsprogs-dev.git Userspace cache suffers the same reverse-list-insert issue that the kernel did. Merge of master-melb:xfs-cmds:26418a by kenmcd. --- diff --git a/include/list.h b/include/list.h index ad6ddfd31..3ba491d32 100644 --- a/include/list.h +++ b/include/list.h @@ -74,6 +74,12 @@ static inline void list_move(struct list_head *list, struct list_head *head) list_add(list, head); } +static inline void list_move_tail(struct list_head *list, struct list_head *head) +{ + __list_del(list->prev, list->next); + list_add_tail(list, head); +} + static inline int list_empty(const struct list_head *head) { return head->next == head; diff --git a/libxfs/cache.c b/libxfs/cache.c index 81e1cb276..ae1d9bc5e 100644 --- a/libxfs/cache.c +++ b/libxfs/cache.c @@ -200,7 +200,7 @@ cache_shake_hash( pthread_mutex_lock(&node->cn_mutex); if (!(inuse = (node->cn_count > 0))) { hash->ch_count--; - list_move(&node->cn_list, &temp); + list_move_tail(&node->cn_list, &temp); } pthread_mutex_unlock(&node->cn_mutex); if (inuse && !priority)