From patchwork Fri Aug 11 05:17:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minchan Kim X-Patchwork-Id: 9894955 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 11C87603B4 for ; Fri, 11 Aug 2017 05:17:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00D4C28BC3 for ; Fri, 11 Aug 2017 05:17:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9B9628BD8; Fri, 11 Aug 2017 05:17:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 74E1928C2B for ; Fri, 11 Aug 2017 05:17:55 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8AE0D21D4911D; Thu, 10 Aug 2017 22:15:32 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from lgeamrelo11.lge.com (LGEAMRELO11.lge.com [156.147.23.51]) by ml01.01.org (Postfix) with ESMTP id D306221D490FB for ; Thu, 10 Aug 2017 22:15:30 -0700 (PDT) Received: from unknown (HELO lgemrelse6q.lge.com) (156.147.1.121) by 156.147.23.51 with ESMTP; 11 Aug 2017 14:17:50 +0900 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: minchan@kernel.org Received: from unknown (HELO localhost.localdomain) (10.177.220.163) by 156.147.1.121 with ESMTP; 11 Aug 2017 14:17:50 +0900 X-Original-SENDERIP: 10.177.220.163 X-Original-MAILFROM: minchan@kernel.org From: Minchan Kim To: Andrew Morton Subject: [PATCH v2 7/7] fs: remove rw_page Date: Fri, 11 Aug 2017 14:17:27 +0900 Message-Id: <1502428647-28928-8-git-send-email-minchan@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502428647-28928-1-git-send-email-minchan@kernel.org> References: <1502428647-28928-1-git-send-email-minchan@kernel.org> X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jens Axboe , jack@suse.cz, linux-nvdimm@lists.01.org, Dave Chinner , Minchan Kim , linux-kernel@vger.kernel.org, Matthew Wilcox , Christoph Hellwig , linux-mm@kvack.org, kernel-team , seungho1.park@lge.com, "karam . lee" MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP Currently, there is no user of rw_page so remove it. Signed-off-by: Minchan Kim --- fs/block_dev.c | 76 -------------------------------------------------- fs/mpage.c | 15 ---------- include/linux/blkdev.h | 4 --- mm/page_io.c | 17 ----------- 4 files changed, 112 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 9941dc8342df..6fb408041e7d 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -649,82 +649,6 @@ int blkdev_fsync(struct file *filp, loff_t start, loff_t end, int datasync) } EXPORT_SYMBOL(blkdev_fsync); -/** - * bdev_read_page() - Start reading a page from a block device - * @bdev: The device to read the page from - * @sector: The offset on the device to read the page to (need not be aligned) - * @page: The page to read - * - * On entry, the page should be locked. It will be unlocked when the page - * has been read. If the block driver implements rw_page synchronously, - * that will be true on exit from this function, but it need not be. - * - * Errors returned by this function are usually "soft", eg out of memory, or - * queue full; callers should try a different route to read this page rather - * than propagate an error back up the stack. - * - * Return: negative errno if an error occurs, 0 if submission was successful. - */ -int bdev_read_page(struct block_device *bdev, sector_t sector, - struct page *page) -{ - const struct block_device_operations *ops = bdev->bd_disk->fops; - int result = -EOPNOTSUPP; - - if (!ops->rw_page || bdev_get_integrity(bdev)) - return result; - - result = blk_queue_enter(bdev->bd_queue, false); - if (result) - return result; - result = ops->rw_page(bdev, sector + get_start_sect(bdev), page, false); - blk_queue_exit(bdev->bd_queue); - return result; -} -EXPORT_SYMBOL_GPL(bdev_read_page); - -/** - * bdev_write_page() - Start writing a page to a block device - * @bdev: The device to write the page to - * @sector: The offset on the device to write the page to (need not be aligned) - * @page: The page to write - * @wbc: The writeback_control for the write - * - * On entry, the page should be locked and not currently under writeback. - * On exit, if the write started successfully, the page will be unlocked and - * under writeback. If the write failed already (eg the driver failed to - * queue the page to the device), the page will still be locked. If the - * caller is a ->writepage implementation, it will need to unlock the page. - * - * Errors returned by this function are usually "soft", eg out of memory, or - * queue full; callers should try a different route to write this page rather - * than propagate an error back up the stack. - * - * Return: negative errno if an error occurs, 0 if submission was successful. - */ -int bdev_write_page(struct block_device *bdev, sector_t sector, - struct page *page, struct writeback_control *wbc) -{ - int result; - const struct block_device_operations *ops = bdev->bd_disk->fops; - - if (!ops->rw_page || bdev_get_integrity(bdev)) - return -EOPNOTSUPP; - result = blk_queue_enter(bdev->bd_queue, false); - if (result) - return result; - - set_page_writeback(page); - result = ops->rw_page(bdev, sector + get_start_sect(bdev), page, true); - if (result) - end_page_writeback(page); - else - unlock_page(page); - blk_queue_exit(bdev->bd_queue); - return result; -} -EXPORT_SYMBOL_GPL(bdev_write_page); - /* * pseudo-fs */ diff --git a/fs/mpage.c b/fs/mpage.c index d3b777fdfd5a..31282ea5d6db 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -280,12 +280,6 @@ do_mpage_readpage(struct bio *bio, struct page *page, unsigned nr_pages, alloc_new: if (bio == NULL) { - if (first_hole == blocks_per_page) { - if (!bdev_read_page(bdev, blocks[0] << (blkbits - 9), - page)) - goto out; - } - if (bdi_cap_synchronous_io(inode_to_bdi(inode))) { bio = &sbio; /* mpage_end_io calls bio_put unconditionally */ @@ -623,14 +617,6 @@ static int __mpage_writepage(struct page *page, struct writeback_control *wbc, alloc_new: if (bio == NULL) { - if (first_unmapped == blocks_per_page) { - if (!bdev_write_page(bdev, blocks[0] << (blkbits - 9), - page, wbc)) { - clean_buffers(page, first_unmapped); - goto out; - } - } - if (bdi_cap_synchronous_io(inode_to_bdi(inode))) { bio = &sbio; /* mpage_end_io calls bio_put unconditionally */ @@ -645,7 +631,6 @@ static int __mpage_writepage(struct page *page, struct writeback_control *wbc, if (bio == NULL) goto confused; } - wbc_init_bio(wbc, bio); bio->bi_write_hint = inode->i_write_hint; } diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 25f6a0cb27d3..21fffa849033 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1936,7 +1936,6 @@ static inline bool integrity_req_gap_front_merge(struct request *req, struct block_device_operations { int (*open) (struct block_device *, fmode_t); void (*release) (struct gendisk *, fmode_t); - int (*rw_page)(struct block_device *, sector_t, struct page *, bool); int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); unsigned int (*check_events) (struct gendisk *disk, @@ -1954,9 +1953,6 @@ struct block_device_operations { extern int __blkdev_driver_ioctl(struct block_device *, fmode_t, unsigned int, unsigned long); -extern int bdev_read_page(struct block_device *, sector_t, struct page *); -extern int bdev_write_page(struct block_device *, sector_t, struct page *, - struct writeback_control *); #else /* CONFIG_BLOCK */ struct block_device; diff --git a/mm/page_io.c b/mm/page_io.c index 64330c751548..a70874f9cb18 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -324,12 +324,6 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc) return ret; } - ret = bdev_write_page(sis->bdev, swap_page_sector(page), page, wbc); - if (!ret) { - count_swpout_vm_event(page); - return 0; - } - ret = 0; if (!(sis->flags & SWP_SYNC_IO)) { @@ -390,17 +384,6 @@ int swap_readpage(struct page *page, bool do_poll) return ret; } - ret = bdev_read_page(sis->bdev, swap_page_sector(page), page); - if (!ret) { - if (trylock_page(page)) { - swap_slot_free_notify(page); - unlock_page(page); - } - - count_vm_event(PSWPIN); - return 0; - } - ret = 0; count_vm_event(PSWPIN); if (!(sis->flags & SWP_SYNC_IO)) {