diff options
author | Akinobu Mita <mita@miraclelinux.com> | 2006-06-26 03:24:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 12:58:18 -0400 |
commit | f116629d03655adaf7832b93b03c99391d09d4a7 (patch) | |
tree | 526f689619817df3c23ab00e3228b4776bde2190 /fs/jffs2 | |
parent | 179e09172ab663b8587ecc46bb18a56a770304a9 (diff) |
[PATCH] fs: use list_move()
This patch converts the combination of list_del(A) and list_add(A, B) to
list_move(A, B) under fs/.
Cc: Ian Kent <raven@themaw.net>
Acked-by: Joel Becker <joel.becker@oracle.com>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Cc: Hans Reiser <reiserfs-dev@namesys.com>
Cc: Urban Widmark <urban@teststation.com>
Acked-by: David Howells <dhowells@redhat.com>
Acked-by: Mark Fasheh <mark.fasheh@oracle.com>
Signed-off-by: Akinobu Mita <mita@miraclelinux.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/jffs2')
-rw-r--r-- | fs/jffs2/erase.c | 15 | ||||
-rw-r--r-- | fs/jffs2/nodemgmt.c | 3 | ||||
-rw-r--r-- | fs/jffs2/wbuf.c | 3 |
3 files changed, 7 insertions, 14 deletions
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c index 1862e8bc101d..b8886f048eaa 100644 --- a/fs/jffs2/erase.c +++ b/fs/jffs2/erase.c | |||
@@ -53,8 +53,7 @@ static void jffs2_erase_block(struct jffs2_sb_info *c, | |||
53 | if (!instr) { | 53 | if (!instr) { |
54 | printk(KERN_WARNING "kmalloc for struct erase_info in jffs2_erase_block failed. Refiling block for later\n"); | 54 | printk(KERN_WARNING "kmalloc for struct erase_info in jffs2_erase_block failed. Refiling block for later\n"); |
55 | spin_lock(&c->erase_completion_lock); | 55 | spin_lock(&c->erase_completion_lock); |
56 | list_del(&jeb->list); | 56 | list_move(&jeb->list, &c->erase_pending_list); |
57 | list_add(&jeb->list, &c->erase_pending_list); | ||
58 | c->erasing_size -= c->sector_size; | 57 | c->erasing_size -= c->sector_size; |
59 | c->dirty_size += c->sector_size; | 58 | c->dirty_size += c->sector_size; |
60 | jeb->dirty_size = c->sector_size; | 59 | jeb->dirty_size = c->sector_size; |
@@ -86,8 +85,7 @@ static void jffs2_erase_block(struct jffs2_sb_info *c, | |||
86 | /* Erase failed immediately. Refile it on the list */ | 85 | /* Erase failed immediately. Refile it on the list */ |
87 | D1(printk(KERN_DEBUG "Erase at 0x%08x failed: %d. Refiling on erase_pending_list\n", jeb->offset, ret)); | 86 | D1(printk(KERN_DEBUG "Erase at 0x%08x failed: %d. Refiling on erase_pending_list\n", jeb->offset, ret)); |
88 | spin_lock(&c->erase_completion_lock); | 87 | spin_lock(&c->erase_completion_lock); |
89 | list_del(&jeb->list); | 88 | list_move(&jeb->list, &c->erase_pending_list); |
90 | list_add(&jeb->list, &c->erase_pending_list); | ||
91 | c->erasing_size -= c->sector_size; | 89 | c->erasing_size -= c->sector_size; |
92 | c->dirty_size += c->sector_size; | 90 | c->dirty_size += c->sector_size; |
93 | jeb->dirty_size = c->sector_size; | 91 | jeb->dirty_size = c->sector_size; |
@@ -161,8 +159,7 @@ static void jffs2_erase_succeeded(struct jffs2_sb_info *c, struct jffs2_eraseblo | |||
161 | { | 159 | { |
162 | D1(printk(KERN_DEBUG "Erase completed successfully at 0x%08x\n", jeb->offset)); | 160 | D1(printk(KERN_DEBUG "Erase completed successfully at 0x%08x\n", jeb->offset)); |
163 | spin_lock(&c->erase_completion_lock); | 161 | spin_lock(&c->erase_completion_lock); |
164 | list_del(&jeb->list); | 162 | list_move_tail(&jeb->list, &c->erase_complete_list); |
165 | list_add_tail(&jeb->list, &c->erase_complete_list); | ||
166 | spin_unlock(&c->erase_completion_lock); | 163 | spin_unlock(&c->erase_completion_lock); |
167 | /* Ensure that kupdated calls us again to mark them clean */ | 164 | /* Ensure that kupdated calls us again to mark them clean */ |
168 | jffs2_erase_pending_trigger(c); | 165 | jffs2_erase_pending_trigger(c); |
@@ -178,8 +175,7 @@ static void jffs2_erase_failed(struct jffs2_sb_info *c, struct jffs2_eraseblock | |||
178 | if (!jffs2_write_nand_badblock(c, jeb, bad_offset)) { | 175 | if (!jffs2_write_nand_badblock(c, jeb, bad_offset)) { |
179 | /* We'd like to give this block another try. */ | 176 | /* We'd like to give this block another try. */ |
180 | spin_lock(&c->erase_completion_lock); | 177 | spin_lock(&c->erase_completion_lock); |
181 | list_del(&jeb->list); | 178 | list_move(&jeb->list, &c->erase_pending_list); |
182 | list_add(&jeb->list, &c->erase_pending_list); | ||
183 | c->erasing_size -= c->sector_size; | 179 | c->erasing_size -= c->sector_size; |
184 | c->dirty_size += c->sector_size; | 180 | c->dirty_size += c->sector_size; |
185 | jeb->dirty_size = c->sector_size; | 181 | jeb->dirty_size = c->sector_size; |
@@ -191,8 +187,7 @@ static void jffs2_erase_failed(struct jffs2_sb_info *c, struct jffs2_eraseblock | |||
191 | spin_lock(&c->erase_completion_lock); | 187 | spin_lock(&c->erase_completion_lock); |
192 | c->erasing_size -= c->sector_size; | 188 | c->erasing_size -= c->sector_size; |
193 | c->bad_size += c->sector_size; | 189 | c->bad_size += c->sector_size; |
194 | list_del(&jeb->list); | 190 | list_move(&jeb->list, &c->bad_list); |
195 | list_add(&jeb->list, &c->bad_list); | ||
196 | c->nr_erasing_blocks--; | 191 | c->nr_erasing_blocks--; |
197 | spin_unlock(&c->erase_completion_lock); | 192 | spin_unlock(&c->erase_completion_lock); |
198 | wake_up(&c->erase_wait); | 193 | wake_up(&c->erase_wait); |
diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2/nodemgmt.c index 8bedfd2ff689..ac0c350ed7d7 100644 --- a/fs/jffs2/nodemgmt.c +++ b/fs/jffs2/nodemgmt.c | |||
@@ -211,8 +211,7 @@ static int jffs2_find_nextblock(struct jffs2_sb_info *c) | |||
211 | struct jffs2_eraseblock *ejeb; | 211 | struct jffs2_eraseblock *ejeb; |
212 | 212 | ||
213 | ejeb = list_entry(c->erasable_list.next, struct jffs2_eraseblock, list); | 213 | ejeb = list_entry(c->erasable_list.next, struct jffs2_eraseblock, list); |
214 | list_del(&ejeb->list); | 214 | list_move_tail(&ejeb->list, &c->erase_pending_list); |
215 | list_add_tail(&ejeb->list, &c->erase_pending_list); | ||
216 | c->nr_erasing_blocks++; | 215 | c->nr_erasing_blocks++; |
217 | jffs2_erase_pending_trigger(c); | 216 | jffs2_erase_pending_trigger(c); |
218 | D1(printk(KERN_DEBUG "jffs2_find_nextblock: Triggering erase of erasable block at 0x%08x\n", | 217 | D1(printk(KERN_DEBUG "jffs2_find_nextblock: Triggering erase of erasable block at 0x%08x\n", |
diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c index a7f153f79ecb..b9b700730dfe 100644 --- a/fs/jffs2/wbuf.c +++ b/fs/jffs2/wbuf.c | |||
@@ -495,8 +495,7 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c) | |||
495 | /* Fix up the original jeb now it's on the bad_list */ | 495 | /* Fix up the original jeb now it's on the bad_list */ |
496 | if (first_raw == jeb->first_node) { | 496 | if (first_raw == jeb->first_node) { |
497 | D1(printk(KERN_DEBUG "Failing block at %08x is now empty. Moving to erase_pending_list\n", jeb->offset)); | 497 | D1(printk(KERN_DEBUG "Failing block at %08x is now empty. Moving to erase_pending_list\n", jeb->offset)); |
498 | list_del(&jeb->list); | 498 | list_move(&jeb->list, &c->erase_pending_list); |
499 | list_add(&jeb->list, &c->erase_pending_list); | ||
500 | c->nr_erasing_blocks++; | 499 | c->nr_erasing_blocks++; |
501 | jffs2_erase_pending_trigger(c); | 500 | jffs2_erase_pending_trigger(c); |
502 | } | 501 | } |