]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | Patch-mainline: submitted 04aug2009 |
2 | References: bnc#498708 | |
3 | From: NeilBrown <neilb@suse.de> | |
4 | Date: Tue, 4 Aug 2009 15:06:38 +1000 | |
5 | Subject: [PATCH 05/12] sunrpc/cache: use list_del_init for the list_head entries in cache_deferred_req | |
6 | ||
7 | Using list_del_init is generally safer than list_del, and it will | |
8 | allow us, in the next patch, to see if an entry has already been | |
9 | processed or not. | |
10 | ||
11 | Signed-off-by: NeilBrown <neilb@suse.de> | |
12 | ||
13 | --- | |
14 | net/sunrpc/cache.c | 8 ++++---- | |
15 | 1 file changed, 4 insertions(+), 4 deletions(-) | |
16 | ||
17 | --- linux-2.6.27-SLE11_BRANCH.orig/net/sunrpc/cache.c | |
18 | +++ linux-2.6.27-SLE11_BRANCH/net/sunrpc/cache.c | |
19 | @@ -591,8 +591,8 @@ static int cache_defer_req(struct cache_ | |
20 | if (++cache_defer_cnt > DFR_MAX) { | |
21 | dreq = list_entry(cache_defer_list.prev, | |
22 | struct cache_deferred_req, recent); | |
23 | - list_del(&dreq->recent); | |
24 | - list_del(&dreq->hash); | |
25 | + list_del_init(&dreq->recent); | |
26 | + list_del_init(&dreq->hash); | |
27 | cache_defer_cnt--; | |
28 | } | |
29 | spin_unlock(&cache_defer_lock); | |
30 | @@ -626,7 +626,7 @@ static void cache_revisit_request(struct | |
31 | dreq = list_entry(lp, struct cache_deferred_req, hash); | |
32 | lp = lp->next; | |
33 | if (dreq->item == item) { | |
34 | - list_del(&dreq->hash); | |
35 | + list_del_init(&dreq->hash); | |
36 | list_move(&dreq->recent, &pending); | |
37 | cache_defer_cnt--; | |
38 | } | |
39 | @@ -652,7 +652,7 @@ void cache_clean_deferred(void *owner) | |
40 | ||
41 | list_for_each_entry_safe(dreq, tmp, &cache_defer_list, recent) { | |
42 | if (dreq->owner == owner) { | |
43 | - list_del(&dreq->hash); | |
44 | + list_del_init(&dreq->hash); | |
45 | list_move(&dreq->recent, &pending); | |
46 | cache_defer_cnt--; | |
47 | } |