Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp750759pxp; Fri, 11 Mar 2022 14:09:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBQ7OP8lkIuMfqzE76zGxFmDtaJ/RExmCtWYo3NDxPOwsodr1PB7n5FktydVI7dxfUIR/i X-Received: by 2002:a17:903:2303:b0:151:d3dc:42b3 with SMTP id d3-20020a170903230300b00151d3dc42b3mr12678008plh.85.1647036566929; Fri, 11 Mar 2022 14:09:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647036566; cv=none; d=google.com; s=arc-20160816; b=XqxviSBVa6uCrRlCOhJE+ykRWGAybao65YQ71UeOjk9Jcizw+8vCURTINbxmcWEEEh vT9tWWYMcTT3E/WRxzwYOAb3BKWS5zTD/oOdDjL2Erpc24+NTjlxWixjXzMxtjRSYGzz gA769g99QAbRmnCrafH6I15mFbCUZ6MHbefNsGe/4oUIc5o78neg3ra5dvOGNxZO6a+r ljdKc24LzLRqFoMWVO0w5/jlG9qdurFUwGh1doLr569f5E3m9ilbqOsTunwr+CBQPs3K nfwwozibjaOjsSbsGQskphprXl2ALHPI7aVDVI5ondV+QN+iNMp9Q/XR4HIG36CXP0vY 2v6Q== 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=7XeQeD4ppDNhrdjXJvghzYtboPY6efwTRGGKo6zsEAY=; b=sR2eTh9lm0+wUWbWNrQ4V6cndJFHSdMleZc/xaJDxTSiJfxSGpqv692qz15wB5jKXJ OYvhCTI1vOcvEzpOdgiLeLbSNeXJkEfgvQsQ7hA6pDvACyDHO/IJb/u1a4iS+546vv7J rErLMqxrxpntM1Yh5ik0duDFGzu3XGnjnTf26nnHRfSU4FJt+3CFd26/VPkUeymraOvB PiC05T3sLsM2jABF4BNzyrqkwdbba15Wo9Gt0ckHn3rTlzWFyw4qdblqo8F8SoBNK3Kh Yw8ZFpDP8pGuHsZ4t92g1sUF5x1GVASvVM7wjtIZoxveQPWyw7grDIFUk7VRkueHJ03N pJWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="DmM/3WEw"; spf=softfail (google.com: domain of transitioning linux-nfs-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h64-20020a638343000000b00380bfd89e0csi8028373pge.458.2022.03.11.14.09.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 14:09:26 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-nfs-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="DmM/3WEw"; spf=softfail (google.com: domain of transitioning linux-nfs-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C4C8F2A5570; Fri, 11 Mar 2022 13:22:22 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351049AbiCKTIT (ORCPT + 99 others); Fri, 11 Mar 2022 14:08:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351052AbiCKTIS (ORCPT ); Fri, 11 Mar 2022 14:08:18 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0E6D41B400C for ; Fri, 11 Mar 2022 11:07:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647025632; 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=7XeQeD4ppDNhrdjXJvghzYtboPY6efwTRGGKo6zsEAY=; b=DmM/3WEwJVf67mkspJj8C5Bjh2NqZP72Q+BchLDbqKJYDON7JBs8NknR23nwiol93GzFNP Tgi4xPgKqQhXpEa/udoCY/aVlfY8mMiV+ugCTqcdCrRusFA2X9j3l168ggh0YKWoAfX/C2 mO2OKQGz31UVIQ8fEU5H3RShgB77b5Q= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-12-m7bU32W5PzS_eyRdV0LRfQ-1; Fri, 11 Mar 2022 14:07:10 -0500 X-MC-Unique: m7bU32W5PzS_eyRdV0LRfQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A25AB1854E21; Fri, 11 Mar 2022 19:07:09 +0000 (UTC) Received: from nyarly.rlyeh.local (ovpn-116-72.gru2.redhat.com [10.97.116.72]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 94F9C60BF4; Fri, 11 Mar 2022 19:06:59 +0000 (UTC) From: Thiago Becker To: linux-nfs@vger.kernel.org Cc: steved@redhat.com, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, kolga@netapp.com, Thiago Becker Subject: [RFC v2 PATCH 6/7] readahead: add mountpoint and fstype options Date: Fri, 11 Mar 2022 16:06:16 -0300 Message-Id: <20220311190617.3294919-7-tbecker@redhat.com> In-Reply-To: <20220311190617.3294919-1-tbecker@redhat.com> References: <20220311190617.3294919-1-tbecker@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Add ways to configure the system by mountpoint or fstype. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1946283 Signed-off-by: Thiago Becker --- tools/nfs-readahead-udev/parser.y | 15 +++++++++++---- tools/nfs-readahead-udev/scanner.l | 5 +++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tools/nfs-readahead-udev/parser.y b/tools/nfs-readahead-udev/parser.y index f6db05c4..5951c99d 100644 --- a/tools/nfs-readahead-udev/parser.y +++ b/tools/nfs-readahead-udev/parser.y @@ -10,20 +10,25 @@ extern FILE *yyin; void yyerror(const char *s); // This should be visible only to this file -extern struct config_entry *config_entry_new(void); +extern struct config_entry *config_entry_new(); struct config_entry *current; %} %union { + char *sval; int ival; } +%token STRING %token INT %token EQ %token ENDL %token DEFAULT +%token MOUNTPOINT +%token FSTYPE %token READAHEAD +%token FS %token END_CONFIG 0 %% @@ -35,7 +40,7 @@ line: tokens endls { struct config_entry *new = config_entry_new(); list_add(¤t->list, &new->list); - current = new; + current = new; } @@ -49,9 +54,11 @@ default: DEFAULT pair: - READAHEAD EQ INT { current->readahead = $3; } + MOUNTPOINT EQ STRING { current->mountpoint = $3; } + | FSTYPE EQ FS { current->fstype = $3; } + | READAHEAD EQ INT { current->readahead = $3; } -endls: +endls: endls ENDL | ENDL %% diff --git a/tools/nfs-readahead-udev/scanner.l b/tools/nfs-readahead-udev/scanner.l index d1ceb90b..c6fb3f0c 100644 --- a/tools/nfs-readahead-udev/scanner.l +++ b/tools/nfs-readahead-udev/scanner.l @@ -5,10 +5,15 @@ %option noyywrap %% default { return DEFAULT; } +mountpoint { return MOUNTPOINT; } +fstype { return FSTYPE; } readahead { return READAHEAD; } +nfs4 { yylval.sval = strdup(yytext); return FS; } +nfs { yylval.sval = strdup(yytext); return FS; } [ \t] ; #[^\n]*\n { return ENDL; } \n { return ENDL; } [0-9]+ { yylval.ival = atoi(yytext); return INT; } +[a-zA-Z0-9/]+ { yylval.sval = strdup(yytext); return STRING; } = { return EQ; } %% -- 2.35.1