From patchwork Mon Mar 16 21:12:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Zwisler X-Patchwork-Id: 6025591 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EDB929F399 for ; Mon, 16 Mar 2015 21:14:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0425F20452 for ; Mon, 16 Mar 2015 21:14:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0F977203E9 for ; Mon, 16 Mar 2015 21:14:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965237AbbCPVNR (ORCPT ); Mon, 16 Mar 2015 17:13:17 -0400 Received: from mga11.intel.com ([192.55.52.93]:8970 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934945AbbCPVNM (ORCPT ); Mon, 16 Mar 2015 17:13:12 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 16 Mar 2015 14:13:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,411,1422950400"; d="scan'208";a="541751273" Received: from theros.lm.intel.com ([10.232.112.52]) by orsmga003.jf.intel.com with ESMTP; 16 Mar 2015 14:12:10 -0700 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , linux-nvdimm@lists.01.org, linux-fsdevel@vger.kernel.org, axboe@kernel.dk, hch@infradead.org, riel@redhat.com Subject: [PATCH 3/6] pmem: Add support for rw_page() Date: Mon, 16 Mar 2015 15:12:57 -0600 Message-Id: <1426540380-24503-4-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1426540380-24503-1-git-send-email-ross.zwisler@linux.intel.com> References: <1426540380-24503-1-git-send-email-ross.zwisler@linux.intel.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Based on commit a72132c31d58 ("brd: add support for rw_page()") Signed-off-by: Ross Zwisler Cc: linux-nvdimm@lists.01.org Cc: linux-fsdevel@vger.kernel.org Cc: axboe@kernel.dk Cc: hch@infradead.org Cc: riel@redhat.com --- drivers/block/pmem.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/block/pmem.c b/drivers/block/pmem.c index 60bbe0d..0be3669 100644 --- a/drivers/block/pmem.c +++ b/drivers/block/pmem.c @@ -183,8 +183,19 @@ out: bio_endio(bio, err); } +static int pmem_rw_page(struct block_device *bdev, sector_t sector, + struct page *page, int rw) +{ + struct pmem_device *pmem = bdev->bd_disk->private_data; + + pmem_do_bvec(pmem, page, PAGE_CACHE_SIZE, 0, rw, sector); + page_endio(page, rw & WRITE, 0); + return 0; +} + static const struct block_device_operations pmem_fops = { .owner = THIS_MODULE, + .rw_page = pmem_rw_page, .getgeo = pmem_getgeo, };