From: Thiago Rafael Becker <trbecker@gmail.com>
To: linux-nfs@vger.kernel.org
Cc: tbecker@redhat.com, steved@redhat.com, chuck.lever@oracle.com,
Thiago Rafael Becker <trbecker@gmail.com>
Subject: [RFC PATCH 6/7] readahead: add mountpoint and fstype options
Date: Wed, 9 Mar 2022 15:26:52 -0300 [thread overview]
Message-ID: <20220309182653.1885252-7-trbecker@gmail.com> (raw)
In-Reply-To: <20220309182653.1885252-1-trbecker@gmail.com>
Add ways to configure the system by mountpoint or fstype.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1946283
Signed-off-by: Thiago Rafael Becker <trbecker@gmail.com>
---
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 <sval> STRING
%token <ival> INT
%token EQ
%token ENDL
%token DEFAULT
+%token MOUNTPOINT
+%token FSTYPE
%token READAHEAD
+%token <sval> 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
next prev parent reply other threads:[~2022-03-09 18:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-09 18:26 [RFC PATCH 0/7] Introduce nfs-readahead-udev Thiago Rafael Becker
2022-03-09 18:26 ` [RFC PATCH 1/7] Create nfs-readahead-udev Thiago Rafael Becker
2022-03-09 18:26 ` [RFC PATCH 2/7] readahead: configure udev Thiago Rafael Becker
2022-03-09 18:26 ` [RFC PATCH 3/7] readahead: create logging facility Thiago Rafael Becker
2022-03-09 18:26 ` [RFC PATCH 4/7] readahead: only set readahead for nfs devices Thiago Rafael Becker
2022-03-09 18:26 ` [RFC PATCH 5/7] readahead: create the configuration file Thiago Rafael Becker
2022-03-09 18:26 ` Thiago Rafael Becker [this message]
2022-03-09 18:26 ` [RFC PATCH 7/7] readahead: documentation Thiago Rafael Becker
2022-03-09 19:33 ` [RFC PATCH 0/7] Introduce nfs-readahead-udev Chuck Lever III
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220309182653.1885252-7-trbecker@gmail.com \
--to=trbecker@gmail.com \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=steved@redhat.com \
--cc=tbecker@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox