Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3993303imu; Mon, 10 Dec 2018 11:11:03 -0800 (PST) X-Google-Smtp-Source: AFSGD/UTIZNI0NVIGZ7cBfSQTKYKpOZc+h+lvQ++llSIvzzrHebE0zDTOp6jTmv9rakIgfEv/wmR X-Received: by 2002:a62:1e45:: with SMTP id e66mr13328014pfe.152.1544469063541; Mon, 10 Dec 2018 11:11:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544469063; cv=none; d=google.com; s=arc-20160816; b=Bi6qamGP7Eep3qu0Ots+HF5AhjSLLGGL5qFguiNnqmb0lwbqeWwiha2i+oRkQBJK3I NPUZTCpACbauc6FMDkJsVKyORr9qB/Uffbd9uQwFEt26MScOYmhvz4kQTf4bwqtKQUsv kH/jmy185M9WtX3JRwajH4/e3s72odPaAVDBT0lpYOp+BXLwTgIXhXAuUIiVvG3bCr/7 4MuIdaDwsqUhDOfok8YYIn0gkWY0dIWZA7cU01cZAx29p2kQnyxOKEp4SLSpewGgXQ40 cI3XaJ23WH1M+CXvtCevp+6mfaz2TUs4d6U947BLJe35qN/r9r562lJzoCWEKBraz9fH xDXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=7iIP2g7XGrE/Jhwst2RG8G0gjPF3/IRApE1CzYFK+qI=; b=x8PFDjXDeUSK2yX1+Nry1IUqe5lZ3aXwcahp3fMJkPrnAJ6CG9JffQkLYeby28zffd b4O2xhx/20OuPd53B7a7+Lt80aWRFXeV0y0umaKqLIqslSRhKHEqdxnEURgs8JRQvR4F bRCc38i2zGu6Hgwmy2+tiT9u/sU2lHCIl2m6FfIWIC6mKZtlLUasvttWzWOawDHSXU63 8Idt2gAHqB8FFgNsCqym+VigMpqovpOqo2ITKnXSs7uU+DKYdg1TxmoI+uai6fUqWjf6 5pgPbEo1XYlDOgUHzEvzQj0ghdZpfckJAltJoTPBXRti/7ggIZkqiGLISVYDyz8TLtSq t3UA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10si10483153pls.170.2018.12.10.11.10.48; Mon, 10 Dec 2018 11:11:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729084AbeLJRSh (ORCPT + 99 others); Mon, 10 Dec 2018 12:18:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38422 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728372AbeLJRNf (ORCPT ); Mon, 10 Dec 2018 12:13:35 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 92710C049593; Mon, 10 Dec 2018 17:13:34 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.234]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D07E6012B; Mon, 10 Dec 2018 17:13:34 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id 4F1EB224247; Mon, 10 Dec 2018 12:13:30 -0500 (EST) From: Vivek Goyal To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: vgoyal@redhat.com, miklos@szeredi.hu, stefanha@redhat.com, dgilbert@redhat.com, sweil@redhat.com, swhiteho@redhat.com Subject: [PATCH 19/52] virito-fs: Make dax optional Date: Mon, 10 Dec 2018 12:12:45 -0500 Message-Id: <20181210171318.16998-20-vgoyal@redhat.com> In-Reply-To: <20181210171318.16998-1-vgoyal@redhat.com> References: <20181210171318.16998-1-vgoyal@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 10 Dec 2018 17:13:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Dr. David Alan Gilbert" Add a 'dax' option and only enable dax when it's on. Also show "dax" in mount options if filesystem was mounted with dax enabled. Signed-off-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal --- fs/fuse/fuse_i.h | 1 + fs/fuse/inode.c | 8 ++++++++ fs/fuse/virtio_fs.c | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index b5a6a12e67d6..345abe9b022f 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -70,6 +70,7 @@ struct fuse_mount_data { unsigned group_id_present:1; unsigned default_permissions:1; unsigned allow_other:1; + unsigned dax:1; unsigned max_read; unsigned blksize; }; diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 10e4a39318c4..d2afce377fd4 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -439,6 +439,7 @@ enum { OPT_ALLOW_OTHER, OPT_MAX_READ, OPT_BLKSIZE, + OPT_DAX, OPT_ERR }; @@ -452,6 +453,7 @@ static const match_table_t tokens = { {OPT_ALLOW_OTHER, "allow_other"}, {OPT_MAX_READ, "max_read=%u"}, {OPT_BLKSIZE, "blksize=%u"}, + {OPT_DAX, "dax"}, {OPT_ERR, NULL} }; @@ -543,6 +545,10 @@ int parse_fuse_opt(char *opt, struct fuse_mount_data *d, int is_bdev, d->blksize = value; break; + case OPT_DAX: + d->dax = 1; + break; + default: return 0; } @@ -571,6 +577,8 @@ static int fuse_show_options(struct seq_file *m, struct dentry *root) seq_printf(m, ",max_read=%u", fc->max_read); if (sb->s_bdev && sb->s_blocksize != FUSE_DEFAULT_BLKSIZE) seq_printf(m, ",blksize=%lu", sb->s_blocksize); + if (fc->dax_dev) + seq_printf(m, ",dax"); return 0; } diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index 55bac1465536..e4d5e0cd41ba 100644 --- a/fs/fuse/virtio_fs.c +++ b/fs/fuse/virtio_fs.c @@ -1050,7 +1050,7 @@ static int virtio_fs_fill_super(struct super_block *sb, void *data, /* TODO this sends FUSE_INIT and could cause hiprio or notifications * virtqueue races since they haven't been set up yet! */ - err = fuse_fill_super_common(sb, &d, fs->dax_dev, + err = fuse_fill_super_common(sb, &d, d.dax ? fs->dax_dev : NULL, &virtio_fs_fiq_ops, fs, (void **)&fs->vqs[2].fud); if (err < 0) -- 2.13.6