Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4348816ybz; Tue, 28 Apr 2020 09:46:55 -0700 (PDT) X-Google-Smtp-Source: APiQypJo1HKMlGSWeZNL5zC3v1zE2/O0mUUuFU4wJgVRK/2/YzQ32+P4n3oyCj0dtWyLDCcZXGHw X-Received: by 2002:a17:906:4bc9:: with SMTP id x9mr24906561ejv.27.1588092415477; Tue, 28 Apr 2020 09:46:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588092415; cv=none; d=google.com; s=arc-20160816; b=J2cNGaIxCwCqXrZV/u2GKSuW8Fba91xAxqjIg5BFSpvGhKCmxbQ1+ZJO37cfqd5nEX U4GdIWhJ7Yfrh0rNBfJJjIvLACoYATAcE/VajKRGJyH7h2suHoklTMRO1rVVRbipZFo6 cOnkjHAp9KqJ5uyNnKqmvGa37Ixxpx5IrS3gekZgvXJpxPpOnbb1DmlA3lazPvBeF2G2 BbkZ0qj/0ZU+gdslr1FLKKOKHpYooKbhyJEPJN+EFlYdfwK50gjHZ8k+TuNs1SwuBOz1 BHp0WIR+IZ1lZ4QMXihBXnWUydDQv+/95kEOWZZZxjxsI3eXKsM197uc7yTj9wGktLj4 22Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=88ox8GtihqbFNHEozsDa3e755E8gglid/Xusjz7RSlg=; b=xZHSsdoNcNTH0nHGNEjVPHRh7Vs/s6zTAbMgwmp1ANe8Td2fzkgtAcvGPOcdaSvTIU gpw2wIRaLiLKPNCXyVawW58vvxpYUYVn7mlTJnBigAG//W9Xn0gyKf0Aeju3MMunmr+h 8Isjj+oVsWjAmdCWv5H48MmqWxOfmzd/khdP34ROtDxhD/uV8j6oMqBVPhVeZ0YF5ho6 OXx2fSx1RTxk7E9ba3Hcd0WySy4oHoyGyA0xXJl0evtshjPV5/4D23k6SEh0jdiFEB0H NR1HfMreUVc0jFqh1sU9zGdniek8BmGit8sgR0OraKIaUTqMizsnhvNwV51/5AqP+Ivm fing== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OdBklY2x; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l61si1892747ede.343.2020.04.28.09.46.31; Tue, 28 Apr 2020 09:46:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OdBklY2x; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728491AbgD1QqL (ORCPT + 99 others); Tue, 28 Apr 2020 12:46:11 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:49926 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728084AbgD1QqL (ORCPT ); Tue, 28 Apr 2020 12:46:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588092371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=88ox8GtihqbFNHEozsDa3e755E8gglid/Xusjz7RSlg=; b=OdBklY2xCSmMP/PUsCBdJoXHkgD7L4PBB/66v0F2u90d/c9q/d9IAPIDtyi8bZI28WhLIn runpp9oZSeAAYkDbGUY59geVu0ecgJv4Ts5nA3VyhoFqhAremI2zJrD5E+5gbT9ytcjONa PzK6xOrvvF2n8ScHwvAAuzag88axCpc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-95-teqohvL2PJWMUKX771bmRQ-1; Tue, 28 Apr 2020 12:46:09 -0400 X-MC-Unique: teqohvL2PJWMUKX771bmRQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 307641895A2F; Tue, 28 Apr 2020 16:46:08 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF3B71002388; Tue, 28 Apr 2020 16:46:05 +0000 (UTC) From: Lukas Czerner To: linux-ext4@vger.kernel.org Cc: dhowells@redhat.com, viro@zeniv.linux.org.uk Subject: [PATCH v2 15/17] ext4: change token2str() to use ext4_param_specs Date: Tue, 28 Apr 2020 18:45:34 +0200 Message-Id: <20200428164536.462-16-lczerner@redhat.com> In-Reply-To: <20200428164536.462-1-lczerner@redhat.com> References: <20200428164536.462-1-lczerner@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Content-Transfer-Encoding: quoted-printable Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Chage token2str() to use ext4_param_specs instead of tokens so that we can get rid of tokens entirely. Signed-off-by: Lukas Czerner --- fs/ext4/super.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index df7d1a724f1b..41075fdd076a 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -2691,12 +2691,12 @@ static inline void ext4_show_quota_options(struct= seq_file *seq, =20 static const char *token2str(int token) { - const struct match_token *t; + const struct fs_parameter_spec *spec; =20 - for (t =3D tokens; t->token !=3D Opt_err; t++) - if (t->token =3D=3D token && !strchr(t->pattern, '=3D')) + for (spec =3D ext4_param_specs; spec->name !=3D NULL; spec++) + if (spec->opt =3D=3D token && !spec->type) break; - return t->pattern; + return spec->name; } =20 /* --=20 2.21.1