]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Userspace cache suffers the same reverse-list-insert issue that the kernel did.
authorNathan Scott <nathans@sgi.com>
Wed, 5 Jul 2006 03:54:20 +0000 (03:54 +0000)
committerNathan Scott <nathans@sgi.com>
Wed, 5 Jul 2006 03:54:20 +0000 (03:54 +0000)
Merge of master-melb:xfs-cmds:26418a by kenmcd.

include/list.h
libxfs/cache.c

index ad6ddfd31b5b49de5c18bd65bd8ecd02b193f88d..3ba491d323237008c8dbd1ae1f14983d65c9c8a9 100644 (file)
@@ -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;
index 81e1cb27694a017be3e7a696ad6153dbd020eeb8..ae1d9bc5ea8a248d72dfca0600f8ea02d065558d 100644 (file)
@@ -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)