[XFS] Combine the XFS and Linux inodes
[linux-block.git] / fs / xfs / xfs_inode.h
index 6fd20fc179a46f7c6fa6065e31d34b74c4cbbf73..345b43a90eb5db861868798208a6c62e2a549627 100644 (file)
@@ -236,7 +236,6 @@ typedef struct xfs_inode {
        /* Inode linking and identification information. */
        struct xfs_mount        *i_mount;       /* fs mount struct ptr */
        struct list_head        i_reclaim;      /* reclaim list */
-       struct inode            *i_vnode;       /* vnode backpointer */
        struct xfs_dquot        *i_udquot;      /* user dquot */
        struct xfs_dquot        *i_gdquot;      /* group dquot */
 
@@ -271,6 +270,10 @@ typedef struct xfs_inode {
        xfs_fsize_t             i_size;         /* in-memory size */
        xfs_fsize_t             i_new_size;     /* size when write completes */
        atomic_t                i_iocount;      /* outstanding I/O count */
+
+       /* VFS inode */
+       struct inode            i_vnode;        /* embedded VFS inode */
+
        /* Trace buffers per inode. */
 #ifdef XFS_INODE_TRACE
        struct ktrace           *i_trace;       /* general inode trace */
@@ -298,13 +301,13 @@ typedef struct xfs_inode {
 /* Convert from vfs inode to xfs inode */
 static inline struct xfs_inode *XFS_I(struct inode *inode)
 {
-       return (struct xfs_inode *)inode->i_private;
+       return container_of(inode, struct xfs_inode, i_vnode);
 }
 
 /* convert from xfs inode to vfs inode */
 static inline struct inode *VFS_I(struct xfs_inode *ip)
 {
-       return (struct inode *)ip->i_vnode;
+       return &ip->i_vnode;
 }
 
 /*