From patchwork Thu Mar 28 10:24:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Borowski X-Patchwork-Id: 10874759 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 ED1E7186E for ; Thu, 28 Mar 2019 10:24:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA08D28874 for ; Thu, 28 Mar 2019 10:24:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CDAA928CD6; Thu, 28 Mar 2019 10:24:42 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham 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 8179128874 for ; Thu, 28 Mar 2019 10:24:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726729AbfC1KYk (ORCPT ); Thu, 28 Mar 2019 06:24:40 -0400 Received: from tartarus.angband.pl ([54.37.238.230]:48486 "EHLO tartarus.angband.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725948AbfC1KYk (ORCPT ); Thu, 28 Mar 2019 06:24:40 -0400 Received: from [2a02:a31c:853f:a300::6] (helo=umbar.angband.pl) by tartarus.angband.pl with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1h9SD5-0005pN-Ua; Thu, 28 Mar 2019 11:24:35 +0100 Received: from kilobyte by umbar.angband.pl with local (Exim 4.92) (envelope-from ) id 1h9SD5-0001Qx-16; Thu, 28 Mar 2019 11:24:35 +0100 From: Adam Borowski To: Goldwyn Rodrigues , linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, marcin.slusarz@intel.com Cc: Adam Borowski Subject: [PATCH] btrfs: allow MAP_SYNC mmap Date: Thu, 28 Mar 2019 11:24:18 +0100 Message-Id: <20190328102418.5466-1-kilobyte@angband.pl> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190327232635.zw4edleqwowxfzej@merlin> References: <20190327232635.zw4edleqwowxfzej@merlin> MIME-Version: 1.0 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 Used by userspace to detect DAX. Signed-off-by: Adam Borowski --- fs/btrfs/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 196c8f37ff9d..8efdb040bc1d 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "ctree.h" #include "disk-io.h" #include "transaction.h" @@ -3320,6 +3321,7 @@ const struct file_operations btrfs_file_operations = { .splice_read = generic_file_splice_read, .write_iter = btrfs_file_write_iter, .mmap = btrfs_file_mmap, + .mmap_supported_flags = MAP_SYNC, .open = btrfs_file_open, .release = btrfs_release_file, .fsync = btrfs_sync_file,