NFSv4: Eliminate nfs4_path_walk()
[safe/jmp/linux-2.6] / fs / jffs2 / xattr.h
index 06ab7b8..6e3b5dd 100644 (file)
@@ -1,13 +1,14 @@
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
- * Copyright (C) 2006  NEC Corporation
+ * Copyright © 2006  NEC Corporation
  *
  * Created by KaiGai Kohei <kaigai@ak.jp.nec.com>
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
  */
+
 #ifndef _JFFS2_FS_XATTR_H_
 #define _JFFS2_FS_XATTR_H_
 
@@ -16,6 +17,7 @@
 
 #define JFFS2_XFLAGS_HOT       (0x01)  /* This datum is HOT */
 #define JFFS2_XFLAGS_BIND      (0x02)  /* This datum is not reclaimed */
+#define JFFS2_XFLAGS_DEAD      (0x40)  /* This datum is already dead */
 #define JFFS2_XFLAGS_INVALID   (0x80)  /* This datum contains crc error */
 
 struct jffs2_xattr_datum
@@ -27,7 +29,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;
 
@@ -60,34 +62,12 @@ struct jffs2_xattr_ref
        struct jffs2_xattr_ref *next;           /* chained from ic->xref_list */
 };
 
-#define XDATUM_DELETE_MARKER   (0xffffffff)
 #define XREF_DELETE_MARKER     (0x00000001)
-static inline int is_xattr_datum_dead(struct jffs2_xattr_datum *xd)
-{
-       return (xd->version == XDATUM_DELETE_MARKER);
-}
-
-static inline void set_xattr_datum_dead(struct jffs2_xattr_datum *xd)
-{
-       xd->version = XDATUM_DELETE_MARKER;
-}
-
 static inline int is_xattr_ref_dead(struct jffs2_xattr_ref *ref)
 {
        return ((ref->xseqno & XREF_DELETE_MARKER) != 0);
 }
 
-static inline void set_xattr_ref_dead(struct jffs2_xattr_ref *ref)
-{
-       ref->xseqno |= XREF_DELETE_MARKER;
-}
-
-static inline void clr_xattr_ref_dead(struct jffs2_xattr_ref *ref)
-{
-       ref->xseqno &= ~XREF_DELETE_MARKER;
-}
-
-
 #ifdef CONFIG_JFFS2_FS_XATTR
 
 extern void jffs2_init_xattr_subsystem(struct jffs2_sb_info *c);
@@ -95,7 +75,7 @@ extern void jffs2_build_xattr_subsystem(struct jffs2_sb_info *c);
 extern void jffs2_clear_xattr_subsystem(struct jffs2_sb_info *c);
 
 extern struct jffs2_xattr_datum *jffs2_setup_xattr_datum(struct jffs2_sb_info *c,
-                                                  uint32_t xid, uint32_t version);
+                                                        uint32_t xid, uint32_t version);
 
 extern void jffs2_xattr_delete_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic);
 extern void jffs2_xattr_free_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic);