Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp537741pxb; Thu, 21 Oct 2021 04:47:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztOpXz3O72pY2AjBSzjIWBxYKK5DTJrbP1EVd/beo6QEARKaFRp+mpbdW7Qn/s2WbhAjEH X-Received: by 2002:a17:907:3e8a:: with SMTP id hs10mr2853091ejc.497.1634816820425; Thu, 21 Oct 2021 04:47:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634816820; cv=none; d=google.com; s=arc-20160816; b=1LdCU6sri+MKkfeIaZlyZa+Ldq2jKf+IJQuqIQbBkSanwod40XfAdNe0PU09bPgYmc ibnBb8zepW5I0VMPpm/Z0BZnz3Qr94rGVTs+dzMhMQGoOWJlA+G0SIh4H9NGhhyO196X S9gD1TGdTHTxu1BwRv6GWdpt1SfIMP0y0zs465cIB9Fret7sawpYl/7H1LTez65WMBBi AOKNfFlcfKlWyHhC5XKNxZS0CQe7wS4VpOomYTcc1gi/bnpSIPPhMe8h2Gj+bvDZSEEl lsAPf66Mk9HKTN79oG+udnCahvBh6CNKLZbA1jlpUXvdoGyH3XgBZZG2BnXw6yP5nNIc +twA== 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=f7EfK4fH4+K5jyI+x+ALkVgR0rPVo53olum02EqwWwc=; b=PSV/+PfWiFuOfWjL5yZYErSSbcRf2lFsdb8Y7QVwNS7RNxtbe1YiGBtZ7rXyUeH6t6 LoMfIsNEhCFnL2DIRUvmXyPNJUGRTT1At9i8E5O72H8uTCD7/1KAoTPJ2ZDhgDaYn3Ir 1VluenEcjrLfQxRo8qMxI1EUXkbpcLJBfvbE6Pl6XEBT+goZZUhBkurW21dyHWbI0Q4i FwiiF/0tupjQ8UZLm/qVngAiMR0ggZmPVMhArQRuTUWGIsf3hKAguAEQ/CkxKbNgoscV RBHv0WOrR9ZXfEQKDJpP6ku9y+TKe2bSXvWMVB5jxNI1pt6In6wJCJ+p25W6ayXz4BJE y46w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q7srr0Oz; 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 eb11si5723626edb.159.2021.10.21.04.46.36; Thu, 21 Oct 2021 04:47:00 -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=Q7srr0Oz; 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 S231461AbhJULr7 (ORCPT + 99 others); Thu, 21 Oct 2021 07:47:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:57907 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231217AbhJULrs (ORCPT ); Thu, 21 Oct 2021 07:47:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634816731; 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=f7EfK4fH4+K5jyI+x+ALkVgR0rPVo53olum02EqwWwc=; b=Q7srr0Oz+HJzd91Az40dzAoNkKJ8vzIu9U6XtKdPYAMauW7X59UGTzyvsIJ9MijIUcACaE qZyZZ6lhDAvAjmjz0oFE/pctyCe4nSOWizVz5pod5zt4kh7dFdBBlSU1R+UUhFWnSF49P9 7411T8cSY4eLap7IHGXvcrZILbSDBmg= 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-81-DzQePWEkOoihfivyDDT9hg-1; Thu, 21 Oct 2021 07:45:27 -0400 X-MC-Unique: DzQePWEkOoihfivyDDT9hg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CE5CF1808308; Thu, 21 Oct 2021 11:45:26 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id E587C652AC; Thu, 21 Oct 2021 11:45:25 +0000 (UTC) From: Lukas Czerner To: linux-ext4@vger.kernel.org, tytso@mit.edu Cc: linux-fsdevel@vger.kernel.org Subject: [PATCH v3 11/13] ext4: change token2str() to use ext4_param_specs Date: Thu, 21 Oct 2021 13:45:06 +0200 Message-Id: <20211021114508.21407-12-lczerner@redhat.com> In-Reply-To: <20211021114508.21407-1-lczerner@redhat.com> References: <20211021114508.21407-1-lczerner@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 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