From patchwork Thu Sep 20 15:12:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10607945 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 AFBCC112B for ; Thu, 20 Sep 2018 15:12:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A04162DC4A for ; Thu, 20 Sep 2018 15:12:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E6412DC6E; Thu, 20 Sep 2018 15:12:44 +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 3FA962DC57 for ; Thu, 20 Sep 2018 15:12:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733254AbeITU4W (ORCPT ); Thu, 20 Sep 2018 16:56:22 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:35427 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731135AbeITU4W (ORCPT ); Thu, 20 Sep 2018 16:56:22 -0400 Received: by mail-wr1-f68.google.com with SMTP id j26-v6so9797283wre.2 for ; Thu, 20 Sep 2018 08:12:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=T/YPwrXVykLx5hkpqsiA0MJqO4coa4bJc+RtjykLZQc=; b=oJClxKKiAPzT9naeGCshhWrEtyMyFkXjOHtP5ZGZAcLlS8pXAm+P+AfQUsI7+ZCXFC yT6lefDMFo77YSKnULrKo0UEqJVlDv4mZxSyh1fxSRoeu/Pl4h4bcDe6I3JoNmjLgIn8 hZ95goDnBVP8XzEjvkQ5ipJrF+v0ubdxKVh0IgVnWC/pAJ87vn9IEQc5kX+etE6iScLb ZGdk0FF9+m9SFYJU+LH3kvZ2hOzlmlC8hJNU+8wo7JfED0u1IboDT4C2L72ATuI7kNts iWNEpxD1gXGW+3gTRsAx0nTaDd/T2vtpkcma8pIC0YLbO7C/sYPFUB/QWZ7qH7+vlgWP X3Ig== X-Gm-Message-State: APzg51C4nyOlsMAkFn/jBHkBHv7Ku1HptDSo463IRoBIbeUGuEJoBn1C 2DHxaaQ7hMV7oE+sNINMoJcy6w== X-Google-Smtp-Source: ANB0VdaQVigOZt82X6lLMv0ssWlVBmVNEpsMS63HE3GQMp2f5FCgwmIyZe3q2hR9fbCsf4D1oVEpWg== X-Received: by 2002:a5d:5450:: with SMTP id w16-v6mr35387051wrv.4.1537456345235; Thu, 20 Sep 2018 08:12:25 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id p89-v6sm55286201wrc.97.2018.09.20.08.12.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Sep 2018 08:12:24 -0700 (PDT) From: Miklos Szeredi To: David Howells Cc: Al Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/6] fsconfig: parse "subtype" param for old internal API Date: Thu, 20 Sep 2018 17:12:12 +0200 Message-Id: <20180920151214.15484-5-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180920151214.15484-1-mszeredi@redhat.com> References: <20180920151214.15484-1-mszeredi@redhat.com> 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 This subtype thing is specific to "fuse" and "fuseblk" filesystems. When these are switched over to the new context API, the handling of this parameter can be moved from legacy_parse_param() into fuse. Signed-off-by: Miklos Szeredi --- fs/fs_context.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fs/fs_context.c b/fs/fs_context.c index c0ecbb1ecdfe..0192456712d2 100644 --- a/fs/fs_context.c +++ b/fs/fs_context.c @@ -574,6 +574,16 @@ static int legacy_parse_param(struct fs_context *fc, struct fs_parameter *param) param->string = NULL; return 0; } + if ((fc->fs_type->fs_flags & FS_HAS_SUBTYPE) && + strcmp(param->key, "subtype") == 0) { + if (param->type != fs_value_is_string) + return invalf(fc, "VFS: Legacy: Non-string subtype"); + if (fc->subtype) + return invalf(fc, "VFS: Legacy: Multiple subtype"); + fc->subtype = param->string; + param->string= NULL; + return 0; + } if (ctx->param_type != LEGACY_FS_UNSET_PARAMS && ctx->param_type != LEGACY_FS_INDIVIDUAL_PARAMS)