diff options
author | KaiGai Kohei <kaigai@ak.jp.nec.com> | 2006-05-13 02:16:13 -0400 |
---|---|---|
committer | KaiGai Kohei <kaigai@ak.jp.nec.com> | 2006-05-13 02:16:13 -0400 |
commit | 084702e00111eb9ffb6d8a5c1938b8e5423e40a8 (patch) | |
tree | 42f5842eb6f5373b04c4f4d254fde0bdcea2a4d5 /fs/jffs2/gc.c | |
parent | 8f2b6f49c656dd4597904f8c20661d6b73cdbbeb (diff) |
[JFFS2][XATTR] Remove jffs2_garbage_collect_xattr(c, ic)
Remove jffs2_garbage_collect_xattr(c, ic).
jffs2_garbage_collect_xattr_datum/ref() are called from gc.c directly.
In original implementation, jffs2_garbage_collect_xattr(c, ic) returns
with holding a spinlock if 'ic' is inode_cache. But it returns after
releasing a spinlock if 'ic' is xattr_datum/ref.
It looks so confusable behavior. Thus, this patch makes caller manage
locking/unlocking.
[5/10] jffs2-xattr-v5.1-05-update_xattr_gc.patch
Signed-off-by: KaiGai Kohei <kaigai@ak.jp.nec.com>
Diffstat (limited to 'fs/jffs2/gc.c')
-rw-r--r-- | fs/jffs2/gc.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c index 4ea1b7f0ae78..a5ef9814f165 100644 --- a/fs/jffs2/gc.c +++ b/fs/jffs2/gc.c | |||
@@ -266,15 +266,22 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c) | |||
266 | 266 | ||
267 | ic = jffs2_raw_ref_to_ic(raw); | 267 | ic = jffs2_raw_ref_to_ic(raw); |
268 | 268 | ||
269 | #ifdef CONFIG_JFFS2_FS_XATTR | ||
269 | /* When 'ic' refers xattr_datum/xattr_ref, this node is GCed as xattr. | 270 | /* When 'ic' refers xattr_datum/xattr_ref, this node is GCed as xattr. |
270 | We can decide whether this node is inode or xattr by ic->class. | 271 | * We can decide whether this node is inode or xattr by ic->class. */ |
271 | ret = 0 : ic is xattr_datum/xattr_ref, and GC was SUCCESSED. | 272 | if (ic->class == RAWNODE_CLASS_XATTR_DATUM |
272 | ret < 0 : ic is xattr_datum/xattr_ref, but GC was FAILED. | 273 | || ic->class == RAWNODE_CLASS_XATTR_REF) { |
273 | ret > 0 : ic is NOT xattr_datum/xattr_ref. | 274 | BUG_ON(raw->next_in_ino != (void *)ic); |
274 | */ | 275 | spin_unlock(&c->erase_completion_lock); |
275 | ret = jffs2_garbage_collect_xattr(c, ic); | 276 | |
276 | if (ret <= 0) | 277 | if (ic->class == RAWNODE_CLASS_XATTR_DATUM) { |
278 | ret = jffs2_garbage_collect_xattr_datum(c, (struct jffs2_xattr_datum *)ic); | ||
279 | } else { | ||
280 | ret = jffs2_garbage_collect_xattr_ref(c, (struct jffs2_xattr_ref *)ic); | ||
281 | } | ||
277 | goto release_sem; | 282 | goto release_sem; |
283 | } | ||
284 | #endif | ||
278 | 285 | ||
279 | /* We need to hold the inocache. Either the erase_completion_lock or | 286 | /* We need to hold the inocache. Either the erase_completion_lock or |
280 | the inocache_lock are sufficient; we trade down since the inocache_lock | 287 | the inocache_lock are sufficient; we trade down since the inocache_lock |