From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 C7EEA212532F0 for ; Thu, 23 May 2019 06:44:51 -0700 (PDT) Date: Thu, 23 May 2019 15:44:49 +0200 From: Jan Kara Subject: Re: [PATCH 12/18] btrfs: allow MAP_SYNC mmap Message-ID: <20190523134449.GC2949@quack2.suse.cz> References: <20190429172649.8288-1-rgoldwyn@suse.de> <20190429172649.8288-13-rgoldwyn@suse.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190429172649.8288-13-rgoldwyn@suse.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Goldwyn Rodrigues 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, Goldwyn Rodrigues , linux-fsdevel@vger.kernel.org, hch@lst.de, linux-btrfs@vger.kernel.org List-ID: On Mon 29-04-19 12:26:43, Goldwyn Rodrigues wrote: > From: Adam Borowski > > Used by userspace to detect DAX. > [rgoldwyn@suse.com: Added CONFIG_FS_DAX around mmap_supported_flags] Why the CONFIG_FS_DAX bit? Your mmap(2) implementation understands implications of MAP_SYNC flag and that's all that's needed to set .mmap_supported_flags. Honza > Signed-off-by: Adam Borowski > Signed-off-by: Goldwyn Rodrigues > --- > fs/btrfs/file.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c > index 9d5a3c99a6b9..362a9cf9dcb2 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" > @@ -3319,6 +3320,9 @@ const struct file_operations btrfs_file_operations = { > .splice_read = generic_file_splice_read, > .write_iter = btrfs_file_write_iter, > .mmap = btrfs_file_mmap, > +#ifdef CONFIG_FS_DAX > + .mmap_supported_flags = MAP_SYNC, > +#endif > .open = btrfs_file_open, > .release = btrfs_release_file, > .fsync = btrfs_sync_file, > -- > 2.16.4 > -- Jan Kara SUSE Labs, CR _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm