Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp883653pxb; Wed, 27 Oct 2021 14:25:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc8q0wJVPTxZwFKpNMiRdzJR9Jlyh1/ewqlXXMeq2vfBowfzdmi6Wplt0A/7J0ZjUAxCyO X-Received: by 2002:a17:902:b40a:b0:13d:cbcd:2e64 with SMTP id x10-20020a170902b40a00b0013dcbcd2e64mr81109plr.18.1635369948467; Wed, 27 Oct 2021 14:25:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635369948; cv=none; d=google.com; s=arc-20160816; b=mZxdJpJI+j62+f8zvcQaxEKQ4+9bZXR/rDiU6jxr/UxZ+HvweqrX9ibK3W8TXE3dRl j0vh/AAvHu+fk9ZRV9LXlf3y8mEpLUprgUczoOjraa7UIV/EHVu79vN8Zrx9zupzwew0 tjtzdMSDCryODguqZi/ovjZoLCk6ny2NQC3sxAEvfkZwDUy9NmJOq0T6s6URjtm7/Ot7 Zt0hcGRjWWzgXeWl1stjuhiv6n8Y+XQyE7JVs7eqpkPyGeMx7XgMYXfgFGecOU6zQ2oI O7h5Gt5qWhJLqtRZqVT2+4NfPk01rh3iSLSfQSozAuELnMN57JK8RSjjgrwYKvtfU5gS TJQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ooYPMUcYLaO+4QN8jxKsu1JBRRa+uzG5tHODsPo08r4=; b=A22XhQc9gA+KYWXBq25lYHlGM+268rbXBGN+jgqMvM2R0Hgdu7UGVR8p7kydV+kBzD K5bCPENdJhRNGj0Z2LYdJu+0WC+25weYxY+zpnVx4Yn0cbIgWwU9u5kLay1P2nywu5YK zyhzpL1/iLPZlwsRASLMr9EZDQos4UizXQ+DmzlL9+TSqQmK2QC38pRifzyo/G/19M6s BDzHQDW3VdYB/bhXOUx1bw9SN+CWBDd+dp/1onzNBBzcf0T2BqRFXPFtVLobqbFY3rm0 lkIUA8QcN80uFwcfIncPfsauOxitsoZbpVkeWqNvRTt+IObYcIB+7VTZSdzsrS2ONBdA OGBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=atWPC+86; 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 n8si1607705plh.356.2021.10.27.14.25.35; Wed, 27 Oct 2021 14:25:48 -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=atWPC+86; 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 S237898AbhJ0OXv (ORCPT + 99 others); Wed, 27 Oct 2021 10:23:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:57168 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242525AbhJ0OXV (ORCPT ); Wed, 27 Oct 2021 10:23:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635344455; 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=ooYPMUcYLaO+4QN8jxKsu1JBRRa+uzG5tHODsPo08r4=; b=atWPC+86OPADzcyxl3OuXq0jf+z4c7EWLLjVHPGnqOldnaMm5GA33GokZtRPVB+gQunWzR GlUgqQhnORlurecS/0ZzAGJK+OILPU84xIHrnq7ko8Q1RJaYMJOKqp15W3TgPdRGmuggeC I8/px/8IWJnrwlhRLFL0mBKH5udb3+4= 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-561-CitBmqR8Mn-RyDrmWIEblw-1; Wed, 27 Oct 2021 10:20:52 -0400 X-MC-Unique: CitBmqR8Mn-RyDrmWIEblw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 411C810168C0; Wed, 27 Oct 2021 14:20:51 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C21761281; Wed, 27 Oct 2021 14:20:49 +0000 (UTC) From: Lukas Czerner To: linux-ext4@vger.kernel.org, tytso@mit.edu Cc: linux-fsdevel@vger.kernel.org, Carlos Maiolino Subject: [PATCH v4 11/13] ext4: change token2str() to use ext4_param_specs Date: Wed, 27 Oct 2021 16:18:55 +0200 Message-Id: <20211027141857.33657-12-lczerner@redhat.com> In-Reply-To: <20211027141857.33657-1-lczerner@redhat.com> References: <20211027141857.33657-1-lczerner@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Change token2str() to use ext4_param_specs instead of tokens so that we can get rid of tokens entirely. Signed-off-by: Lukas Czerner Reviewed-by: Carlos Maiolino --- 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 b66087f55009..67efe9c6b9e8 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3039,12 +3039,12 @@ static inline void ext4_show_quota_options(struct seq_file *seq, static const char *token2str(int token) { - const struct match_token *t; + const struct fs_parameter_spec *spec; - for (t = tokens; t->token != Opt_err; t++) - if (t->token == token && !strchr(t->pattern, '=')) + for (spec = ext4_param_specs; spec->name != NULL; spec++) + if (spec->opt == token && !spec->type) break; - return t->pattern; + return spec->name; } /* -- 2.31.1