[JFFS2][XATTR] Re-define xd->refcnt as atomic_t

In jffs2_release_xattr_datum(), it refers xd->refcnt to ensure
whether releasing xd is allowed or not.
But we can't hold xattr_sem since this function is called under
spin_lock(&c->erase_completion_lock). Thus we have to refer it
without any locking.

This patch redefine xd->refcnt as atomic_t. It enables to refer
xd->refcnt without any locking.

Signed-off-by: KaiGai Kohei <kaigai@ak.jp.nec.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
This commit is contained in:
KaiGai Kohei
2006-06-24 09:16:50 +09:00
committed by David Woodhouse
parent 355ed4e141
commit 2c887e2359
2 changed files with 12 additions and 15 deletions

View File

@@ -28,7 +28,7 @@ struct jffs2_xattr_datum
uint16_t xprefix; /* see JFFS2_XATTR_PREFIX_* */
struct list_head xindex; /* chained from c->xattrindex[n] */
uint32_t refcnt; /* # of xattr_ref refers this */
atomic_t refcnt; /* # of xattr_ref refers this */
uint32_t xid;
uint32_t version;