From patchwork Thu May 4 00:17:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sunqiuyang X-Patchwork-Id: 9710613 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 B549B60387 for ; Thu, 4 May 2017 00:15:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A576928678 for ; Thu, 4 May 2017 00:15:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98DCA2867E; Thu, 4 May 2017 00:15:18 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5730828678 for ; Thu, 4 May 2017 00:15:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752538AbdEDAPG (ORCPT ); Wed, 3 May 2017 20:15:06 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:5822 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752516AbdEDAPE (ORCPT ); Wed, 3 May 2017 20:15:04 -0400 Received: from 172.30.72.55 (EHLO dggeml406-hub.china.huawei.com) ([172.30.72.55]) by dggrg01-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id ANW09791; Thu, 04 May 2017 08:14:47 +0800 (CST) Received: from huawei.com (10.175.124.28) by dggeml406-hub.china.huawei.com (10.3.17.50) with Microsoft SMTP Server id 14.3.301.0; Thu, 4 May 2017 08:14:40 +0800 From: sunqiuyang To: , , CC: , , , , , , , , , , , Subject: [PATCH 2/3] f2fs:dax: Export interfaces: dax_map/unmap_atomic() Date: Thu, 4 May 2017 08:17:25 +0800 Message-ID: <1493857045-40693-1-git-send-email-sunqiuyang@huawei.com> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090203.590A7278.0010, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: d410410ad427bcaee623286037e63e50 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Export interfaces of dax_map/unmap_atomic() for usage in moving data pages of DAX files in garbage collection of F2FS. Signed-off-by: Qiuyang Sun --- fs/dax.c | 6 ++++-- include/linux/dax.h | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 85abd74..615a4c1 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -55,7 +55,7 @@ static int __init init_dax_wait_table(void) } fs_initcall(init_dax_wait_table); -static long dax_map_atomic(struct block_device *bdev, struct blk_dax_ctl *dax) +long dax_map_atomic(struct block_device *bdev, struct blk_dax_ctl *dax) { struct request_queue *q = bdev->bd_queue; long rc = -EIO; @@ -72,14 +72,16 @@ static long dax_map_atomic(struct block_device *bdev, struct blk_dax_ctl *dax) } return rc; } +EXPORT_SYMBOL_GPL(dax_map_atomic); -static void dax_unmap_atomic(struct block_device *bdev, +void dax_unmap_atomic(struct block_device *bdev, const struct blk_dax_ctl *dax) { if (IS_ERR(dax->addr)) return; blk_queue_exit(bdev->bd_queue); } +EXPORT_SYMBOL_GPL(dax_unmap_atomic); static int dax_is_pmd_entry(void *entry) { diff --git a/include/linux/dax.h b/include/linux/dax.h index d8a3dc0..b6451b2 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -7,6 +7,7 @@ #include struct iomap_ops; +struct blk_dax_ctl; /* * We use lowest available bit in exceptional entry for locking, one bit for @@ -36,6 +37,8 @@ static inline void *dax_radix_locked_entry(sector_t sector, unsigned long flags) RADIX_DAX_ENTRY_LOCK); } +long dax_map_atomic(struct block_device *bdev, struct blk_dax_ctl *dax); +void dax_unmap_atomic(struct block_device *bdev, const struct blk_dax_ctl *dax); ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter, const struct iomap_ops *ops); int dax_iomap_fault(struct vm_fault *vmf, enum page_entry_size pe_size,