Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp881951pxb; Wed, 27 Oct 2021 14:23:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1b3XcAPE8X4mWDxbFGHIAiQdYdrqsH7kTZWq8RYJvT/8GMGVB+bmgvQV7IiDItEL0ulsA X-Received: by 2002:a50:f68d:: with SMTP id d13mr429218edn.149.1635369829588; Wed, 27 Oct 2021 14:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635369829; cv=none; d=google.com; s=arc-20160816; b=BV5vqhnn+YRLmqsNt5lol8DgcHVFruIDV9wEbdtg4agcI6mrBT5aJd1Rt2zL3ZfFRW D+EKRWdwdt4eQjQtq2KraSBuWPyF1KZOGdBODnLkpg+f6RRRlJpi+ccvKyj03AL9CXN8 Cr2Nk48n+4qzCFfbnRrOkAQYGbtPBQzumsN+iPo13PfNoTEqxPivJfNWqOL62ENZnrAX 6vGEQvrWNVtzr23YNud3kTENCFe82BwU3gUnxV9AlINm3Bolu32JHT3CgpXOU/a1Ry3z NuKjBoWv6zzac078QWULlOBpkIiVyqfloNNI2ZHmLnpAAjR7tIU+QOs26mmastWWji4T uZVA== 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=7cn8cimWbBWXEPvwtBHTbmJpS9FVs5pGnENY25bd5UU=; b=XcOFi+hvcE3sn17+8Pjq9kZPEtjXsfCsSbQyrvaJ8eIFv5hKxFgb325aMF1oJl1RP/ EHe5uuQ1gxpZl9NUKdqGJCJgBLRxTXOWp5VHTSTmQpyrnZcRN8V1CXogBLaigeKzDvAl 5X9ep1n1pk1baia+n5vH0d3RiYXz/imGdH1k00mkk+CZ5RfSCIrnRSr4KMiNsztq82KL XG4ibQVxGTORxQInwRFiQapL2cX9scW9AcwSwjvZO46UQKPmr6CmfX4PvJwHG0DvE8Ja 8WCJVPZEBkP+kF2nQMCrmiZ97i7qBD8i32MpKO1MB3YBddkuiFJohY+fF0Pfp7/+4K67 T73Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=deGQy21b; 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 bx26si1284313edb.181.2021.10.27.14.23.25; Wed, 27 Oct 2021 14:23:49 -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=deGQy21b; 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 S240073AbhJ0LzZ (ORCPT + 99 others); Wed, 27 Oct 2021 07:55:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:46232 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240055AbhJ0LzY (ORCPT ); Wed, 27 Oct 2021 07:55:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635335578; 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=7cn8cimWbBWXEPvwtBHTbmJpS9FVs5pGnENY25bd5UU=; b=deGQy21bdBI0+4bkCRSVE/hJIJR3Y688xbUIX010OhIU2sEE1TqsK1418nDA/zC171aSMT FzOXQJ6Y5tNjfVLLWa9WWfTXcGNS2HNPbCIkvMj7OEcax4W7nvS3Rljb4jdFYOHFmJuHXi hqqUxj+Y44u1H58IN86SDP2bgRuP/Qk= 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-274-QxUfaWElNQ-0d0ON8Tmilg-1; Wed, 27 Oct 2021 07:52:56 -0400 X-MC-Unique: QxUfaWElNQ-0d0ON8Tmilg-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 C5C0515875AF; Wed, 27 Oct 2021 11:52:51 +0000 (UTC) Received: from work (unknown [10.40.194.65]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8AAF51ACBB; Wed, 27 Oct 2021 11:52:50 +0000 (UTC) Date: Wed, 27 Oct 2021 13:52:46 +0200 From: Lukas Czerner To: linux-ext4@vger.kernel.org, tytso@mit.edu, linux-fsdevel@vger.kernel.org, cmaiolino@redhat.com Subject: Re: [PATCH v3 11/13] ext4: change token2str() to use ext4_param_specs Message-ID: <20211027115246.bewgpt35szs7ppda@work> References: <20211021114508.21407-1-lczerner@redhat.com> <20211021114508.21407-12-lczerner@redhat.com> <20211026114043.q5kwobv7vlnv2uej@andromeda.lan> <20211026120953.mropvelvr4id7mej@work> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211026120953.mropvelvr4id7mej@work> 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 02:09:53PM +0200, Lukas Czerner wrote: > 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() ? Actually it's still called token in the struct mount_opts which is what we're passing down to the token2str() anyway. Since this really is inconsequential stuff I'll leave it as it is. -Lukas > > -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 > > >