From patchwork Mon Apr 29 17:26:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Goldwyn Rodrigues X-Patchwork-Id: 10922195 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 84A381515 for ; Mon, 29 Apr 2019 17:27:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6840D28877 for ; Mon, 29 Apr 2019 17:27:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C989288CB; Mon, 29 Apr 2019 17:27:13 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 08CE728877 for ; Mon, 29 Apr 2019 17:27:12 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 74B5F21A07094; Mon, 29 Apr 2019 10:27:12 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=195.135.220.15; helo=mx1.suse.de; envelope-from=rgoldwyn@suse.de; receiver=linux-nvdimm@lists.01.org Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CDD36211F9D4A for ; Mon, 29 Apr 2019 10:27:10 -0700 (PDT) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7DA90AD0A; Mon, 29 Apr 2019 17:27:08 +0000 (UTC) From: Goldwyn Rodrigues To: linux-btrfs@vger.kernel.org Subject: [PATCH v4 00/18] btrfs dax support Date: Mon, 29 Apr 2019 12:26:31 -0500 Message-Id: <20190429172649.8288-1-rgoldwyn@suse.de> X-Mailer: git-send-email 2.16.4 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kilobyte@angband.pl, jack@suse.cz, darrick.wong@oracle.com, nborisov@suse.com, linux-nvdimm@lists.01.org, david@fromorbit.com, dsterba@suse.cz, willy@infradead.org, linux-fsdevel@vger.kernel.org, hch@lst.de MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP This patch set adds support for dax on the BTRFS filesystem. In order to support for CoW for btrfs, there were changes which had to be made to the dax handling. The important one is copying blocks into the same dax device before using them which is performed by iomap type IOMAP_DAX_COW. Snapshotting and CoW features are supported (including mmap preservation across snapshots). Git: https://github.com/goldwynr/linux/tree/btrfs-dax Changes since v3: - Fixed memcpy bug - used flags for dax_insert_entry instead of bools for dax_insert_entry() Changes since v2: - Created a new type IOMAP_DAX_COW as opposed to flag IOMAP_F_COW - CoW source address is presented in iomap.inline_data - Split the patches to more elaborate dax/iomap patches Changes since v1: - use iomap instead of redoing everything in btrfs - support for mmap writeprotecting on snapshotting fs/btrfs/Makefile | 1 fs/btrfs/ctree.h | 38 +++++ fs/btrfs/dax.c | 289 +++++++++++++++++++++++++++++++++++++++++-- fs/btrfs/disk-io.c | 4 fs/btrfs/file.c | 37 ++++- fs/btrfs/inode.c | 114 ++++++++++++---- fs/btrfs/ioctl.c | 29 +++- fs/btrfs/send.c | 4 fs/btrfs/super.c | 30 ++++ fs/dax.c | 183 ++++++++++++++++++++++++--- fs/iomap.c | 9 - fs/ocfs2/file.c | 2 fs/read_write.c | 11 - fs/xfs/xfs_reflink.c | 2 include/linux/dax.h | 15 +- include/linux/fs.h | 8 + include/linux/iomap.h | 7 + include/trace/events/btrfs.h | 56 ++++++++ 18 files changed, 752 insertions(+), 87 deletions(-)