xfs
[Top] [All Lists]

[PATCH 3/7] xfs: make xfs_find_bdev_for_inode available outside of xfs_a

To: xfs@xxxxxxxxxxx
Subject: [PATCH 3/7] xfs: make xfs_find_bdev_for_inode available outside of xfs_aops.c
From: Christoph Hellwig <hch@xxxxxx>
Date: Mon, 14 Mar 2016 22:02:46 +0100
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1457989370-6904-1-git-send-email-hch@xxxxxx>
References: <1457989370-6904-1-git-send-email-hch@xxxxxx>
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
 fs/xfs/xfs_aops.c  | 17 ++---------------
 fs/xfs/xfs_inode.h |  9 +++++++++
 2 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 75a39a8..72ee3f2 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -70,19 +70,6 @@ xfs_count_page_state(
        } while ((bh = bh->b_this_page) != head);
 }
 
-STATIC struct block_device *
-xfs_find_bdev_for_inode(
-       struct inode            *inode)
-{
-       struct xfs_inode        *ip = XFS_I(inode);
-       struct xfs_mount        *mp = ip->i_mount;
-
-       if (XFS_IS_REALTIME_INODE(ip))
-               return mp->m_rtdev_targp->bt_bdev;
-       else
-               return mp->m_ddev_targp->bt_bdev;
-}
-
 /*
  * We're now finished for good with this ioend structure.
  * Update the page state via the associated buffer_heads,
@@ -1256,7 +1243,7 @@ __xfs_get_blocks(
         * If this is a realtime file, data may be on a different device.
         * to that pointed to from the buffer_head b_bdev currently.
         */
-       bh_result->b_bdev = xfs_find_bdev_for_inode(inode);
+       bh_result->b_bdev = xfs_find_bdev_for_inode(ip);
 
        /*
         * If we previously allocated a block out beyond eof and we are now
@@ -1420,7 +1407,7 @@ xfs_vm_direct_IO(
                                 xfs_get_blocks_direct, endio, 0);
        }
 
-       bdev = xfs_find_bdev_for_inode(inode);
+       bdev = xfs_find_bdev_for_inode(XFS_I(inode));
        return  __blockdev_direct_IO(iocb, inode, bdev, iter, offset,
                        xfs_get_blocks_direct, endio, NULL, flags);
 }
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 43e1d51..70bedf0 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -474,6 +474,15 @@ do { \
        iput(VFS_I(ip)); \
 } while (0)
 
+static inline struct block_device *xfs_find_bdev_for_inode(struct xfs_inode 
*ip)
+{
+       if (XFS_IS_REALTIME_INODE(ip))
+               return ip->i_mount->m_rtdev_targp->bt_bdev;
+       else
+               return ip->i_mount->m_ddev_targp->bt_bdev;
+}
+
+
 extern struct kmem_zone        *xfs_inode_zone;
 
 /*
-- 
2.1.4

<Prev in Thread] Current Thread [Next in Thread>