[PATCH] XATTR issues on JFFS2

Kaigai Kohei kaigai at ak.jp.nec.com
Wed Sep 28 04:44:08 EDT 2005


Hi,

I revised the previous xattr patch in jffs2 based on some suggestions.

[1] scanning xattr related node for cleaned-up scan.c.
     (jffs2_xattr_scan.c-cleanup.patch)
[2] enables xattr support in jffs2.
     (jffs2_xattr_take-3.patch)
(*) We can apply jffs2_xattr_take-3.patch for current CVS independently.

The following points are updated.

- jffs2_scan_xattr_node() and jffs2_scan_xref_node() are implemented
   with considering the cleaned-up scan.c. (jffs2_xattr_scan.c-cleanup.patch)
   Since I can't build the cleaned-up source, this patch has not been verified yet.
   But same code is included in jffs2_xattr_take-3.patch, and it works correctly.

- A deadlock problem was detected in take-2 patch.
   Thus, the order of acquiring semaphore was changed.
   There was down_write(&c->xattr_sem) under down(&c->alloc_sem) in take-2 patch.
   Now, I avoid such an implementation. In do_jffs2_setxattr(), xattr_sem is
   acquired after alloc_sem is done.

- "include/linux/jffs2_fs_x.h" was moved to "fs/jffs2/xattr.h".

- 'void *owner' in struct jffs2_raw_node_ref was removed.
- 'int state' in struct jffs2_inode_cache was removed, and
   'u8 class' and 'u8 flags', 'uint16_t state' were added on instead.

   GC uses raw->next_in_ino for reverse-reference to xattr_datum/xattr_ref
   from jffs_raw_node_ref.

- the declaration of jffs2_xattr_ref was changed. The strange cast was removed,
   and the variables not-used concurrently are defined as union type.
   ('uint32_t xid' and 'struct jffs2_xattr_datum *xd' are not used concurrently.
    'uint32_t ino' and 'struct jffs2_inode_cache *ic' are not used concurrently.)

- A xattr prefixes like 'security.' are represented by 8bit code, and omit it
   from name-strings.

- jffs2_xattr_datum->xlist was removed, and 'uint32_t refcnt' was added.
   Scanning inodes which share the same xattr_datum is not used.
   Thus, this list is not necessary and enough in reference counter.

- some functions/variables/structures are renamed.
   struct jffs2_xattr_cache -> struct jffs2_xattr_datum

   kmem_cache_t *xattr_cache_slab -> xattr_datum_cache
   kmem_cache_t *xattr_ref_slab -> xattr_ref_cache

   jffs2_init_xattr_caches()  -> jffs2_init_xattr_subsystem()
   jffs2_build_xattr_caches() -> jffs2_build_xattr_subsystem()
   jffs2_clear_xattr_caches() -> jffs2_clear_xattr_subsystem()
         ,,,and so on.

The remaining work is as follows:
   - Additional revising besed on any comments.
   - Test & Stabilization.
   - The implementation for POSIX ACL support.
   - The implementation for XATTR support in mkfs.jffs2.

Signed-off-by: KaiGai Kohei <kaigai at ak.jp.nec.com>

Thanks,
-- 
Linux Promotion Center, NEC
KaiGai Kohei <kaigai at ak.jp.nec.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jffs2_xattr_take-3.patch
Type: text/x-patch
Size: 55162 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-mtd/attachments/20050928/b8daadda/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jffs2_xattr_scan.c-cleanup.patch
Type: text/x-patch
Size: 4851 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-mtd/attachments/20050928/b8daadda/attachment-0001.bin 


More information about the linux-mtd mailing list