From: Akinobu Mita This patch converts the combination of hlist_del(A) and hlist_add_head(A, B) to hlist_move_head(A, B). Cc: Neil Brown Cc: Prasanna S Panchamukhi Cc: "David S. Miller" Signed-off-by: Akinobu Mita Signed-off-by: Andrew Morton --- fs/nfsd/nfscache.c | 3 +-- kernel/kprobes.c | 10 +++++----- net/core/dev.c | 3 +-- net/ipv4/fib_hash.c | 4 +--- net/ipv4/fib_semantics.c | 8 ++------ net/ipv4/ip_fragment.c | 4 +--- net/ipv6/netfilter/nf_conntrack_reasm.c | 3 +-- net/ipv6/reassembly.c | 4 +--- net/sunrpc/auth.c | 9 +++------ 9 files changed, 16 insertions(+), 32 deletions(-) diff -puN fs/nfsd/nfscache.c~use-hlist_move_head fs/nfsd/nfscache.c --- devel/fs/nfsd/nfscache.c~use-hlist_move_head 2006-03-30 01:23:23.000000000 -0800 +++ devel-akpm/fs/nfsd/nfscache.c 2006-03-30 01:23:23.000000000 -0800 @@ -113,8 +113,7 @@ lru_put_end(struct svc_cacherep *rp) static void hash_refile(struct svc_cacherep *rp) { - hlist_del_init(&rp->c_hash); - hlist_add_head(&rp->c_hash, hash_list + REQHASH(rp->c_xid)); + hlist_move_head(&rp->c_hash, hash_list + REQHASH(rp->c_xid)); } /* diff -puN kernel/kprobes.c~use-hlist_move_head kernel/kprobes.c --- devel/kernel/kprobes.c~use-hlist_move_head 2006-03-30 01:23:23.000000000 -0800 +++ devel-akpm/kernel/kprobes.c 2006-03-30 01:23:23.000000000 -0800 @@ -307,11 +307,11 @@ void __kprobes recycle_rp_inst(struct kr /* remove rp inst off the rprobe_inst_table */ hlist_del(&ri->hlist); if (ri->rp) { - /* remove rp inst off the used list */ - hlist_del(&ri->uflist); - /* put rp inst back onto the free list */ - INIT_HLIST_NODE(&ri->uflist); - hlist_add_head(&ri->uflist, &ri->rp->free_instances); + /* + * remove rp inst off the used list + * and put rp inst back onto the free list + */ + hlist_move_head(&ri->uflist, &ri->rp->free_instances); } else /* Unregistering */ kfree(ri); diff -puN net/core/dev.c~use-hlist_move_head net/core/dev.c --- devel/net/core/dev.c~use-hlist_move_head 2006-03-30 01:23:23.000000000 -0800 +++ devel-akpm/net/core/dev.c 2006-03-30 01:23:23.000000000 -0800 @@ -734,8 +734,7 @@ int dev_change_name(struct net_device *d err = class_device_rename(&dev->class_dev, dev->name); if (!err) { - hlist_del(&dev->name_hlist); - hlist_add_head(&dev->name_hlist, dev_name_hash(dev->name)); + hlist_move_head(&dev->name_hlist, dev_name_hash(dev->name)); blocking_notifier_call_chain(&netdev_chain, NETDEV_CHANGENAME, dev); } diff -puN net/ipv4/fib_hash.c~use-hlist_move_head net/ipv4/fib_hash.c --- devel/net/ipv4/fib_hash.c~use-hlist_move_head 2006-03-30 01:23:23.000000000 -0800 +++ devel-akpm/net/ipv4/fib_hash.c 2006-03-30 01:23:23.000000000 -0800 @@ -124,10 +124,8 @@ static inline void fn_rebuild_zone(struc hlist_for_each_entry_safe(f, node, n, &old_ht[i], fn_hash) { struct hlist_head *new_head; - hlist_del(&f->fn_hash); - new_head = &fz->fz_hash[fn_hash(f->fn_key, fz)]; - hlist_add_head(&f->fn_hash, new_head); + hlist_move_head(&f->fn_hash, new_head); } } } diff -puN net/ipv4/fib_semantics.c~use-hlist_move_head net/ipv4/fib_semantics.c --- devel/net/ipv4/fib_semantics.c~use-hlist_move_head 2006-03-30 01:23:23.000000000 -0800 +++ devel-akpm/net/ipv4/fib_semantics.c 2006-03-30 01:23:23.000000000 -0800 @@ -613,11 +613,9 @@ static void fib_hash_move(struct hlist_h struct hlist_head *dest; unsigned int new_hash; - hlist_del(&fi->fib_hash); - new_hash = fib_info_hashfn(fi); dest = &new_info_hash[new_hash]; - hlist_add_head(&fi->fib_hash, dest); + hlist_move_head(&fi->fib_hash, dest); } } fib_info_hash = new_info_hash; @@ -631,11 +629,9 @@ static void fib_hash_move(struct hlist_h struct hlist_head *ldest; unsigned int new_hash; - hlist_del(&fi->fib_lhash); - new_hash = fib_laddr_hashfn(fi->fib_prefsrc); ldest = &new_laddrhash[new_hash]; - hlist_add_head(&fi->fib_lhash, ldest); + hlist_move_head(&fi->fib_lhash, ldest); } } fib_info_laddrhash = new_laddrhash; diff -puN net/ipv4/ip_fragment.c~use-hlist_move_head net/ipv4/ip_fragment.c --- devel/net/ipv4/ip_fragment.c~use-hlist_move_head 2006-03-30 01:23:23.000000000 -0800 +++ devel-akpm/net/ipv4/ip_fragment.c 2006-03-30 01:23:23.000000000 -0800 @@ -149,10 +149,8 @@ static void ipfrag_secret_rebuild(unsign q->daddr, q->protocol); if (hval != i) { - hlist_del(&q->list); - /* Relink to new hash chain. */ - hlist_add_head(&q->list, &ipq_hash[hval]); + hlist_move_head(&q->list, &ipq_hash[hval]); } } } diff -puN net/ipv6/netfilter/nf_conntrack_reasm.c~use-hlist_move_head net/ipv6/netfilter/nf_conntrack_reasm.c --- devel/net/ipv6/netfilter/nf_conntrack_reasm.c~use-hlist_move_head 2006-03-30 01:23:23.000000000 -0800 +++ devel-akpm/net/ipv6/netfilter/nf_conntrack_reasm.c 2006-03-30 01:23:23.000000000 -0800 @@ -162,9 +162,8 @@ static void nf_ct_frag6_secret_rebuild(u &q->saddr, &q->daddr); if (hval != i) { - hlist_del(&q->list); /* Relink to new hash chain. */ - hlist_add_head(&q->list, + hlist_move_head(&q->list, &nf_ct_frag6_hash[hval]); } } diff -puN net/ipv6/reassembly.c~use-hlist_move_head net/ipv6/reassembly.c --- devel/net/ipv6/reassembly.c~use-hlist_move_head 2006-03-30 01:23:23.000000000 -0800 +++ devel-akpm/net/ipv6/reassembly.c 2006-03-30 01:23:23.000000000 -0800 @@ -168,10 +168,8 @@ static void ip6_frag_secret_rebuild(unsi &q->daddr); if (hval != i) { - hlist_del(&q->list); - /* Relink to new hash chain. */ - hlist_add_head(&q->list, + hlist_move_head(&q->list, &ip6_frag_hash[hval]); } diff -puN net/sunrpc/auth.c~use-hlist_move_head net/sunrpc/auth.c --- devel/net/sunrpc/auth.c~use-hlist_move_head 2006-03-30 01:23:23.000000000 -0800 +++ devel-akpm/net/sunrpc/auth.c 2006-03-30 01:23:23.000000000 -0800 @@ -149,8 +149,7 @@ rpcauth_free_credcache(struct rpc_auth * for (i = 0; i < RPC_CREDCACHE_NR; i++) { hlist_for_each_safe(pos, next, &cache->hashtable[i]) { cred = hlist_entry(pos, struct rpc_cred, cr_hash); - __hlist_del(&cred->cr_hash); - hlist_add_head(&cred->cr_hash, &free); + hlist_move_head(&cred->cr_hash, &free); } } spin_unlock(&rpc_credcache_lock); @@ -164,10 +163,8 @@ rpcauth_prune_expired(struct rpc_auth *a return; if (time_after(jiffies, cred->cr_expire + auth->au_credcache->expire)) cred->cr_flags &= ~RPCAUTH_CRED_UPTODATE; - if (!(cred->cr_flags & RPCAUTH_CRED_UPTODATE)) { - __hlist_del(&cred->cr_hash); - hlist_add_head(&cred->cr_hash, free); - } + if (!(cred->cr_flags & RPCAUTH_CRED_UPTODATE)) + hlist_move_head(&cred->cr_hash, free); } /* _