From patchwork Mon Mar 21 13:22:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 8632791 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B77E2C0555 for ; Mon, 21 Mar 2016 13:22:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9221C201ED for ; Mon, 21 Mar 2016 13:22:38 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id E389120320 for ; Mon, 21 Mar 2016 13:22:36 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 52C8F1A1FD6; Mon, 21 Mar 2016 06:22:58 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 38B3F1A1FD0 for ; Mon, 21 Mar 2016 06:22:56 -0700 (PDT) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 1668CAD38; Mon, 21 Mar 2016 13:22:31 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id D151082528; Mon, 21 Mar 2016 14:22:58 +0100 (CET) From: Jan Kara To: linux-fsdevel@vger.kernel.org Subject: [PATCH 10/10] dax: Remove i_mmap_lock protection Date: Mon, 21 Mar 2016 14:22:55 +0100 Message-Id: <1458566575-28063-11-git-send-email-jack@suse.cz> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1458566575-28063-1-git-send-email-jack@suse.cz> References: <1458566575-28063-1-git-send-email-jack@suse.cz> X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Kara , linux-nvdimm@lists.01.org, NeilBrown , "Wilcox, Matthew R" MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 Currently faults are protected against truncate by filesystem specific i_mmap_sem and page lock in case of hole page. Cow faults are protected DAX radix tree entry locking. So there's no need for i_mmap_lock in DAX code. Remove it. Signed-off-by: Jan Kara Reviewed-by: Ross Zwisler --- fs/dax.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 2fcf4e8a17c5..a2a370db59b7 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -795,8 +795,6 @@ static int dax_insert_mapping(struct address_space *mapping, int error; void *ret; - i_mmap_lock_read(mapping); - if (dax_map_atomic(bdev, &dax) < 0) { error = PTR_ERR(dax.addr); goto out; @@ -821,7 +819,6 @@ static int dax_insert_mapping(struct address_space *mapping, error = vm_insert_mixed(vma, vaddr, dax.pfn); out: - i_mmap_unlock_read(mapping); put_locked_mapping_entry(mapping, vmf->pgoff, entry); return error; } @@ -1063,8 +1060,6 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsigned long address, truncate_pagecache_range(inode, lstart, lend); } - i_mmap_lock_read(mapping); - if (!write && !buffer_mapped(&bh) && buffer_uptodate(&bh)) { spinlock_t *ptl; pmd_t entry; @@ -1162,8 +1157,6 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsigned long address, } out: - i_mmap_unlock_read(mapping); - return result; fallback: