[XFS] Fix merge failures
[pandora-kernel.git] / fs / xfs / xfs_inode.h
index 0a9ad1c..1f175fa 100644 (file)
@@ -82,6 +82,16 @@ typedef struct xfs_ifork {
        } if_u2;
 } xfs_ifork_t;
 
+/*
+ * Inode location information.  Stored in the inode and passed to
+ * xfs_imap_to_bp() to get a buffer and dinode for a given inode.
+ */
+struct xfs_imap {
+       xfs_daddr_t     im_blkno;       /* starting BB of inode chunk */
+       ushort          im_len;         /* length in BBs of inode chunk */
+       ushort          im_boffset;     /* inode offset in block in bytes */
+};
+
 /*
  * This is the xfs in-core inode structure.
  * Most of the on-disk inode is embedded in the i_d field.
@@ -156,11 +166,6 @@ typedef struct xfs_icdinode {
 #define        XFS_IFBROOT     0x04    /* i_broot points to the bmap b-tree root */
 #define        XFS_IFEXTIREC   0x08    /* Indirection array of extent blocks */
 
-/*
- * Flags for xfs_inotobp and xfs_imap().
- */
-#define XFS_IMAP_BULKSTAT      0x1
-
 /*
  * Fork handling.
  */
@@ -218,7 +223,6 @@ struct xfs_dquot;
 
 #if defined(XFS_ILOCK_TRACE)
 #define XFS_ILOCK_KTRACE_SIZE  32
-extern ktrace_t *xfs_ilock_trace_buf;
 extern void xfs_ilock_trace(struct xfs_inode *, int, unsigned int, inst_t *);
 #else
 #define        xfs_ilock_trace(i,n,f,ra)
@@ -238,9 +242,7 @@ typedef struct xfs_inode {
 
        /* Inode location stuff */
        xfs_ino_t               i_ino;          /* inode number (agno/agino)*/
-       xfs_daddr_t             i_blkno;        /* blkno of inode buffer */
-       ushort                  i_len;          /* len of inode buffer */
-       ushort                  i_boffset;      /* off of inode in buffer */
+       struct xfs_imap         i_imap;         /* location for xfs_imap() */
 
        /* Extent information. */
        xfs_ifork_t             *i_afp;         /* attribute fork pointer */
@@ -400,17 +402,12 @@ static inline void xfs_ifunlock(xfs_inode_t *ip)
 /*
  * In-core inode flags.
  */
-#define XFS_IGRIO      0x0001  /* inode used for guaranteed rate i/o */
-#define XFS_IUIOSZ     0x0002  /* inode i/o sizes have been explicitly set */
-#define XFS_IQUIESCE    0x0004  /* we have started quiescing for this inode */
-#define XFS_IRECLAIM    0x0008  /* we have started reclaiming this inode    */
-#define XFS_ISTALE     0x0010  /* inode has been staled */
-#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 */
+#define XFS_IRECLAIM    0x0001  /* we have started reclaiming this inode    */
+#define XFS_ISTALE     0x0002  /* inode has been staled */
+#define XFS_IRECLAIMABLE 0x0004 /* inode can be reclaimed */
+#define XFS_INEW       0x0008  /* inode has just been allocated */
+#define XFS_IFILESTREAM        0x0010  /* inode is in a filestream directory */
+#define XFS_ITRUNCATED 0x0020  /* truncated down so flush-on-close */
 
 /*
  * Flags for inode locking.
@@ -484,17 +481,9 @@ static inline void xfs_ifunlock(xfs_inode_t *ip)
        (((pip)->i_mount->m_flags & XFS_MOUNT_GRPID) || \
         ((pip)->i_d.di_mode & S_ISGID))
 
-/*
- * Flags for xfs_iget()
- */
-#define XFS_IGET_CREATE                0x1
-#define XFS_IGET_BULKSTAT      0x2
-
 /*
  * xfs_iget.c prototypes.
  */
-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 *);
 int            xfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
@@ -513,10 +502,8 @@ void               xfs_ireclaim(xfs_inode_t *);
 /*
  * xfs_inode.c prototypes.
  */
-int            xfs_iread(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
-                         xfs_inode_t **, xfs_daddr_t, uint);
 int            xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t,
-                          xfs_nlink_t, xfs_dev_t, struct cred *, xfs_prid_t,
+                          xfs_nlink_t, xfs_dev_t, cred_t *, xfs_prid_t,
                           int, struct xfs_buf **, boolean_t *, xfs_inode_t **);
 
 uint           xfs_ip2xflags(struct xfs_inode *);
@@ -528,8 +515,6 @@ int         xfs_itruncate_finish(struct xfs_trans **, xfs_inode_t *,
                                     xfs_fsize_t, int, int);
 int            xfs_iunlink(struct xfs_trans *, xfs_inode_t *);
 
-void           xfs_idestroy(xfs_inode_t *);
-void           xfs_iextract(xfs_inode_t *);
 void           xfs_iext_realloc(xfs_inode_t *, int, int);
 void           xfs_ipin(xfs_inode_t *);
 void           xfs_iunpin(xfs_inode_t *);
@@ -542,14 +527,67 @@ void              xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint);
 void           xfs_synchronize_atime(xfs_inode_t *);
 void           xfs_mark_inode_dirty_sync(xfs_inode_t *);
 
+#if defined(XFS_INODE_TRACE)
+
+#define        INODE_TRACE_SIZE        16              /* number of trace entries */
+#define        INODE_KTRACE_ENTRY      1
+#define        INODE_KTRACE_EXIT       2
+#define        INODE_KTRACE_HOLD       3
+#define        INODE_KTRACE_REF        4
+#define        INODE_KTRACE_RELE       5
+
+extern void _xfs_itrace_entry(struct xfs_inode *, const char *, inst_t *);
+extern void _xfs_itrace_exit(struct xfs_inode *, const char *, inst_t *);
+extern void xfs_itrace_hold(struct xfs_inode *, char *, int, inst_t *);
+extern void _xfs_itrace_ref(struct xfs_inode *, char *, int, inst_t *);
+extern void xfs_itrace_rele(struct xfs_inode *, char *, int, inst_t *);
+#define xfs_itrace_entry(ip)   \
+       _xfs_itrace_entry(ip, __func__, (inst_t *)__return_address)
+#define xfs_itrace_exit(ip)    \
+       _xfs_itrace_exit(ip, __func__, (inst_t *)__return_address)
+#define xfs_itrace_exit_tag(ip, tag)   \
+       _xfs_itrace_exit(ip, tag, (inst_t *)__return_address)
+#define xfs_itrace_ref(ip)     \
+       _xfs_itrace_ref(ip, __FILE__, __LINE__, (inst_t *)__return_address)
+
+#else
+#define        xfs_itrace_entry(a)
+#define        xfs_itrace_exit(a)
+#define        xfs_itrace_exit_tag(a, b)
+#define        xfs_itrace_hold(a, b, c, d)
+#define        xfs_itrace_ref(a)
+#define        xfs_itrace_rele(a, b, c, d)
+#endif
+
+#define IHOLD(ip) \
+do { \
+       ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) ; \
+       atomic_inc(&(VFS_I(ip)->i_count)); \
+       xfs_itrace_hold((ip), __FILE__, __LINE__, (inst_t *)__return_address); \
+} while (0)
+
+#define IRELE(ip) \
+do { \
+       xfs_itrace_rele((ip), __FILE__, __LINE__, (inst_t *)__return_address); \
+       iput(VFS_I(ip)); \
+} while (0)
+
 #endif /* __KERNEL__ */
 
+/*
+ * Flags for xfs_iget()
+ */
+#define XFS_IGET_CREATE                0x1
+#define XFS_IGET_BULKSTAT      0x2
+
 int            xfs_inotobp(struct xfs_mount *, struct xfs_trans *,
                            xfs_ino_t, struct xfs_dinode **,
                            struct xfs_buf **, int *, uint);
 int            xfs_itobp(struct xfs_mount *, struct xfs_trans *,
                          struct xfs_inode *, struct xfs_dinode **,
                          struct xfs_buf **, uint);
+int            xfs_iread(struct xfs_mount *, struct xfs_trans *,
+                         struct xfs_inode *, xfs_daddr_t, uint);
 void           xfs_dinode_from_disk(struct xfs_icdinode *,
                                     struct xfs_dinode *);
 void           xfs_dinode_to_disk(struct xfs_dinode *,