[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 4 Apr 2018 15:18:06 -0400
From: jglisse@...hat.com
To: linux-mm@...ck.org, linux-fsdevel@...r.kernel.org,
linux-block@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Jérôme Glisse <jglisse@...hat.com>,
Jens Axboe <axboe@...nel.dk>,
Andrew Morton <akpm@...ux-foundation.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Tejun Heo <tj@...nel.org>, Jan Kara <jack@...e.cz>,
Josef Bacik <jbacik@...com>,
Mel Gorman <mgorman@...hsingularity.net>
Subject: [RFC PATCH 32/79] fs/block: do not rely on page->mapping get it from the context
From: Jérôme Glisse <jglisse@...hat.com>
This patch remove most dereference of page->mapping and get the mapping
from the call context (either already available in the function or by
adding it to function arguments).
Signed-off-by: Jérôme Glisse <jglisse@...hat.com>
Cc: Jens Axboe <axboe@...nel.dk>
CC: Andrew Morton <akpm@...ux-foundation.org>
Cc: Alexander Viro <viro@...iv.linux.org.uk>
Cc: linux-fsdevel@...r.kernel.org
Cc: Tejun Heo <tj@...nel.org>
Cc: Jan Kara <jack@...e.cz>
Cc: Josef Bacik <jbacik@...com>
Cc: Mel Gorman <mgorman@...hsingularity.net>
---
fs/block_dev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 502b6643bc74..dd9da97615e3 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -564,14 +564,14 @@ EXPORT_SYMBOL(thaw_bdev);
static int blkdev_writepage(struct address_space *mapping, struct page *page,
struct writeback_control *wbc)
{
- return block_write_full_page(page->mapping->host, page,
+ return block_write_full_page(mapping->host, page,
blkdev_get_block, wbc);
}
static int blkdev_readpage(struct file * file, struct address_space *mapping,
struct page * page)
{
- return block_read_full_page(page->mapping->host,page,blkdev_get_block);
+ return block_read_full_page(mapping->host,page,blkdev_get_block);
}
static int blkdev_readpages(struct file *file, struct address_space *mapping,
@@ -1941,7 +1941,7 @@ EXPORT_SYMBOL_GPL(blkdev_read_iter);
static int blkdev_releasepage(struct address_space *mapping,
struct page *page, gfp_t wait)
{
- struct super_block *super = BDEV_I(page->mapping->host)->bdev.bd_super;
+ struct super_block *super = BDEV_I(mapping->host)->bdev.bd_super;
if (super && super->s_op->bdev_try_to_free_page)
return super->s_op->bdev_try_to_free_page(super, page, wait);
--
2.14.3
Powered by blists - more mailing lists