]> git.proxmox.com Git - mirror_spl.git/commitdiff
Linux 3.9 compat: Switch to hlist_for_each{,_rcu}
authorRichard Yao <ryao@cs.stonybrook.edu>
Mon, 4 Mar 2013 20:17:03 +0000 (15:17 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 14 Mar 2013 17:43:34 +0000 (10:43 -0700)
torvalds/linux@b67bfe0d42cac56c512dd5da4b1b347a23f4b70a changed
hlist_for_each_entry{,_rcu} to take 3 arguments instead of 4. We handle
this by switching to hlist_for_each{,_rcu}, which works across all
supported kernels.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
module/spl/spl-kmem.c
module/spl/spl-tsd.c

index e3538b5ff48ca5e9652014cd01b099d858c96ffe..f9c11149181120726cf03d693569e46bfeab6c9e 100644 (file)
@@ -404,7 +404,8 @@ kmem_del_init(spinlock_t *lock, struct hlist_head *table, int bits, const void *
        spin_lock_irqsave(lock, flags);
 
        head = &table[hash_ptr(addr, bits)];
-       hlist_for_each_entry_rcu(p, node, head, kd_hlist) {
+       hlist_for_each_rcu(node, head) {
+               p = list_entry_rcu(node, struct kmem_debug, kd_hlist);
                if (p->kd_addr == addr) {
                        hlist_del_init(&p->kd_hlist);
                        list_del_init(&p->kd_list);
index d7749cf7b8788bd3740b9ab82247fca407618883..6e5605b9d7a875b86d00c532ed436cc8e6acf293 100644 (file)
@@ -113,7 +113,8 @@ tsd_hash_search(tsd_hash_table_t *table, uint_t key, pid_t pid)
        hash = hash_long((ulong_t)key * (ulong_t)pid, table->ht_bits);
        bin = &table->ht_bins[hash];
        spin_lock(&bin->hb_lock);
-       hlist_for_each_entry(entry, node, &bin->hb_head, he_list) {
+       hlist_for_each(node, &bin->hb_head) {
+               entry = list_entry(node, tsd_hash_entry_t, he_list);
                if ((entry->he_key == key) && (entry->he_pid == pid)) {
                        spin_unlock(&bin->hb_lock);
                        SRETURN(entry);