Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1354521pxb; Tue, 26 Oct 2021 07:34:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWtUv7q5yuxyc4yjxnSScez4U31yTblOBXLeYnVjdWSgfCAtJx9zxa4e8up0bCUDBBnl1F X-Received: by 2002:a17:906:2346:: with SMTP id m6mr30416448eja.512.1635258856828; Tue, 26 Oct 2021 07:34:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635258856; cv=none; d=google.com; s=arc-20160816; b=PnGT8sEo44D6TtGB4bqltyY/KVHxUaSVp0RBoOiGrbABtkoqQQOMvgIgXgCXeRcvRW 5bBAInc9cJhWz6JM2p1u1u6p85CrKB9rWGooa1+Ioo9aSMkR1v2akwTKqEqEUhdHzXW/ 7dynKj8gOQnys86c877z3ybdsF1zfNXheTDXsOe9XokBI0AHxZp6HV0DNxUJxx0qoW19 YVWsUZTc9i1yGFgUS+ZWEzHOcKQ2Snvqee+RIKg4b9DR2tnEpRC7TCAKxfFKHlJNr9/q j1MjCnAG8nkAHwFO8uF4h2pWSWmK4Lwc6vFmep1HKjkMFRxLPkztgYvoLcyGKc1HDxaC HGPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=VFu990jGZuZSQ6puNWxAX6hSr0vpbWIv4s14VxM/J+U=; b=AlTElrJ5ibIPYHLCJ5pXSKxxB5FTgS8bt7H73vA/TTgKEJdsHrV8/mMmFXqh31TRKl j78qWXY0oPEJ9hnw4an4xQ02HTY7b9h68EBNTbXabeheFJV9VzOURXlB2COIcVvMCkAI ssGItDHHH6sA26A9f/pn4S5htOW0FjCSOipqG3nB3oTipIiVWbbmp6xbGL+9smI2SRZT ribmewdMYrwZ3hu6y5ecAqVJ4OlWT9UAVX7H3W6TLSSkiwKPo9/4SLiUmnmvDTy3hORM UyLLCTXW2Xn1qLh3+mM4mQ4yBR5MzTuosSWRPr2AevFQppNBUZJpdKCDOhdmQlpASak+ 1uMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="e4R/K58/"; 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 z3si2923816edp.30.2021.10.26.07.33.53; Tue, 26 Oct 2021 07:34:16 -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="e4R/K58/"; 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 S235153AbhJZMM1 (ORCPT + 99 others); Tue, 26 Oct 2021 08:12:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:47473 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235152AbhJZMM0 (ORCPT ); Tue, 26 Oct 2021 08:12:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635250202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VFu990jGZuZSQ6puNWxAX6hSr0vpbWIv4s14VxM/J+U=; b=e4R/K58/3e7GBErkSECyOj45PbkbXI3Rp0+MwBiZpILpDWmRBcL7A6rYQv1cS3Zqpt2IR6 f7mWf34Biv26xiAifZVocC65ON2gJtJKuft0u7ph96HtdBFHppoKXSCo/VuobbZQy6S9kO jgyfmicLJvdhTpl35Pt4jIC0TKNkXd8= 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-53-8VX1YcmkO1WPMoyKKk9vlA-1; Tue, 26 Oct 2021 08:09:59 -0400 X-MC-Unique: 8VX1YcmkO1WPMoyKKk9vlA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 63D1E806690; Tue, 26 Oct 2021 12:09:58 +0000 (UTC) Received: from work (unknown [10.40.194.100]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 740B3641AA; Tue, 26 Oct 2021 12:09:57 +0000 (UTC) Date: Tue, 26 Oct 2021 14:09:53 +0200 From: Lukas Czerner To: linux-ext4@vger.kernel.org, tytso@mit.edu, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v3 11/13] ext4: change token2str() to use ext4_param_specs Message-ID: <20211026120953.mropvelvr4id7mej@work> References: <20211021114508.21407-1-lczerner@redhat.com> <20211021114508.21407-12-lczerner@redhat.com> <20211026114043.q5kwobv7vlnv2uej@andromeda.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211026114043.q5kwobv7vlnv2uej@andromeda.lan> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Oct 26, 2021 at 01:40:43PM +0200, Carlos Maiolino wrote: > On Thu, Oct 21, 2021 at 01:45:06PM +0200, Lukas Czerner wrote: > > Chage token2str() to use ext4_param_specs instead of tokens so that we > > ^ Change. > > > can get rid of tokens entirely. > > If you're removing tokens entirely, maybe the name token2str() doesn't make > sense anymore? True, I guess it's no longer called "token" so maybe option2str() ? -Lukas > > > > > 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 bdcaa158eab8..0ccd47f3fa91 100644 > > --- a/fs/ext4/super.c > > +++ b/fs/ext4/super.c > > @@ -3037,12 +3037,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 > > > > -- > Carlos >