2012-05-15 01:14:28

by Yuanhan Liu

[permalink] [raw]
Subject: [PATCH] block: use I_BDEV to get _bdev_ from _inode_

Use defined I_BDEV function to get _bdev_ from _inode_.

Signed-off-by: Yuanhan Liu <[email protected]>
---
fs/block_dev.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index e08f6a20..acc1e30 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -483,7 +483,7 @@ static inline void __bd_forget(struct inode *inode)

static void bdev_evict_inode(struct inode *inode)
{
- struct block_device *bdev = &BDEV_I(inode)->bdev;
+ struct block_device *bdev = I_BDEV(inode);
struct list_head *p;
truncate_inode_pages(&inode->i_data, 0);
invalidate_inode_buffers(inode); /* is it needed here? */
@@ -548,12 +548,12 @@ static inline unsigned long hash(dev_t dev)

static int bdev_test(struct inode *inode, void *data)
{
- return BDEV_I(inode)->bdev.bd_dev == *(dev_t *)data;
+ return I_BDEV(inode)->bd_dev == *(dev_t *)data;
}

static int bdev_set(struct inode *inode, void *data)
{
- BDEV_I(inode)->bdev.bd_dev = *(dev_t *)data;
+ I_BDEV(inode)->bd_dev = *(dev_t *)data;
return 0;
}

@@ -570,7 +570,7 @@ struct block_device *bdget(dev_t dev)
if (!inode)
return NULL;

- bdev = &BDEV_I(inode)->bdev;
+ bdev = I_BDEV(inode);

if (inode->i_state & I_NEW) {
bdev->bd_contains = NULL;
@@ -1600,7 +1600,7 @@ EXPORT_SYMBOL_GPL(blkdev_aio_write);
*/
static int blkdev_releasepage(struct page *page, gfp_t wait)
{
- struct super_block *super = BDEV_I(page->mapping->host)->bdev.bd_super;
+ struct super_block *super = I_BDEV(page->mapping->host)->bd_super;

if (super && super->s_op->bdev_try_to_free_page)
return super->s_op->bdev_try_to_free_page(super, page, wait);
--
1.7.7.6