Pull hotplug into release branch
[powerpc.git] / fs / xfs / xfs_inode.h
index 6f88ac3..e5aff92 100644 (file)
@@ -106,7 +106,6 @@ typedef struct xfs_ifork {
 
 #ifdef __KERNEL__
 struct bhv_desc;
-struct bhv_vnode;
 struct cred;
 struct ktrace;
 struct xfs_buf;
@@ -257,7 +256,7 @@ typedef struct xfs_inode {
        struct xfs_inode        *i_mprev;       /* ptr to prev inode */
        struct xfs_mount        *i_mount;       /* fs mount struct ptr */
        struct list_head        i_reclaim;      /* reclaim list */
-       struct bhv_vnode        *i_vnode;       /* vnode backpointer */
+       bhv_vnode_t             *i_vnode;       /* vnode backpointer */
        struct xfs_dquot        *i_udquot;      /* user dquot */
        struct xfs_dquot        *i_gdquot;      /* group dquot */
 
@@ -299,7 +298,11 @@ typedef struct xfs_inode {
        struct hlist_node       i_cnode;        /* cluster link node */
 
        xfs_fsize_t             i_size;         /* in-memory size */
+       atomic_t                i_iocount;      /* outstanding I/O count */
        /* Trace buffers per inode. */
+#ifdef XFS_VNODE_TRACE
+       struct ktrace           *i_trace;       /* general inode trace */
+#endif
 #ifdef XFS_BMAP_TRACE
        struct ktrace           *i_xtrace;      /* inode extent list trace */
 #endif
@@ -360,6 +363,19 @@ xfs_iflags_test(xfs_inode_t *ip, unsigned short flags)
        spin_unlock(&ip->i_flags_lock);
        return ret;
 }
+
+static inline int
+xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned short flags)
+{
+       int ret;
+
+       spin_lock(&ip->i_flags_lock);
+       ret = ip->i_flags & flags;
+       if (ret)
+               ip->i_flags &= ~flags;
+       spin_unlock(&ip->i_flags_lock);
+       return ret;
+}
 #endif /* __KERNEL__ */
 
 
@@ -391,6 +407,9 @@ xfs_iflags_test(xfs_inode_t *ip, unsigned short flags)
 #define XFS_IRECLAIMABLE 0x0020 /* inode can be reclaimed */
 #define XFS_INEW       0x0040
 #define XFS_IFILESTREAM        0x0080  /* inode is in a filestream directory */
+#define XFS_IMODIFIED  0x0100  /* XFS inode state possibly differs */
+                               /* to the Linux inode state. */
+#define XFS_ITRUNCATED 0x0200  /* truncated down so flush-on-close */
 
 /*
  * Flags for inode locking.
@@ -473,8 +492,9 @@ xfs_iflags_test(xfs_inode_t *ip, unsigned short flags)
  * directory, group of new file is set to that of the parent, and
  * new subdirectory gets S_ISGID bit from parent.
  */
-#define XFS_INHERIT_GID(pip, vfsp)     \
-       (((vfsp)->vfs_flag & VFS_GRPID) || ((pip)->i_d.di_mode & S_ISGID))
+#define XFS_INHERIT_GID(pip)   \
+       (((pip)->i_mount->m_flags & XFS_MOUNT_GRPID) || \
+        ((pip)->i_d.di_mode & S_ISGID))
 
 /*
  * Flags for xfs_iget()
@@ -489,7 +509,7 @@ void                xfs_ihash_init(struct xfs_mount *);
 void           xfs_ihash_free(struct xfs_mount *);
 xfs_inode_t    *xfs_inode_incore(struct xfs_mount *, xfs_ino_t,
                                  struct xfs_trans *);
-void            xfs_inode_lock_init(xfs_inode_t *, struct bhv_vnode *);
+void            xfs_inode_lock_init(xfs_inode_t *, bhv_vnode_t *);
 int            xfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
                         uint, uint, xfs_inode_t **, xfs_daddr_t);
 void           xfs_iput(xfs_inode_t *, uint);