From: Christoph Hellwig <hch@lst.de>
To: xfs@oss.sgi.com
Subject: [PATCH 3/7] xfs: make xfs_find_bdev_for_inode available outside of xfs_aops.c
Date: Mon, 14 Mar 2016 22:02:46 +0100 [thread overview]
Message-ID: <1457989370-6904-4-git-send-email-hch@lst.de> (raw)
In-Reply-To: <1457989370-6904-1-git-send-email-hch@lst.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
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
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2016-03-14 21:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-14 21:02 [RFC] iomap infrastructure and multipage writes Christoph Hellwig
2016-03-14 21:02 ` [PATCH 1/7] fs: move struct iomap from exportfs.h to a separate header Christoph Hellwig
2016-03-14 21:02 ` [PATCH 2/7] fs: introduce iomap infrastructure Christoph Hellwig
2016-04-04 1:28 ` Dave Chinner
2016-04-04 1:47 ` Dave Chinner
2016-04-04 7:12 ` Christoph Hellwig
2016-04-04 7:55 ` Dave Chinner
2016-03-14 21:02 ` Christoph Hellwig [this message]
2016-03-14 21:02 ` [PATCH 4/7] xfs: make xfs_bmbt_to_iomap available outside of xfs_pnfs.c Christoph Hellwig
2016-03-14 21:02 ` [PATCH 5/7] xfs: reshuffle truncate Christoph Hellwig
2016-03-14 21:02 ` [PATCH 6/7] xfs: implement iomap based buffered write path Christoph Hellwig
2016-03-14 21:02 ` [PATCH 7/7] xfs: remove buffered write support from __xfs_get_blocks Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1457989370-6904-4-git-send-email-hch@lst.de \
--to=hch@lst.de \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox