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/erase.c | |
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/erase.c')
-rw-r--r-- | fs/jffs2/erase.c | 15 |
1 files changed, 5 insertions, 10 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); |