summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Dickson <steved@redhat.com>2022-04-19 10:47:54 -0400
committerSteve Dickson <steved@redhat.com>2022-04-19 15:50:29 -0400
commit6011418c3e4e37dd433a6d7560f220d442943f84 (patch)
tree0e46963414cd6ff37b7e46971d4f4363deb51aa9
parentf86c4c9065786bd9f08c923ff6a55621b9803f9c (diff)
downloadnfs-utils-6011418c3e4e37dd433a6d7560f220d442943f84.tar.gz
nfsrahead: configure udev
Set the udev rule to call the readahead utility. Signed-off-by: Thiago Becker <tbecker@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--.gitignore1
-rw-r--r--tools/nfsrahead/99-nfs.rules1
-rw-r--r--tools/nfsrahead/99-nfs.rules.in1
-rw-r--r--tools/nfsrahead/Makefile.am8
4 files changed, 11 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 38ab1d3..df791a8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -62,6 +62,7 @@ tools/locktest/testlk
tools/getiversion/getiversion
tools/nfsconf/nfsconf
tools/nfsrahead/nfsrahead
+tools/nfsrahead/99-nfs_bdi.rules
support/export/mount.h
support/export/mount_clnt.c
support/export/mount_xdr.c
diff --git a/tools/nfsrahead/99-nfs.rules b/tools/nfsrahead/99-nfs.rules
new file mode 100644
index 0000000..f5a7660
--- /dev/null
+++ b/tools/nfsrahead/99-nfs.rules
@@ -0,0 +1 @@
+SUBSYSTEM=="bdi", ACTION=="add", PROGRAM="/usr/libexec/nfsrahead", ATTR{read_ahead_kb}="%c"
diff --git a/tools/nfsrahead/99-nfs.rules.in b/tools/nfsrahead/99-nfs.rules.in
new file mode 100644
index 0000000..7d55b40
--- /dev/null
+++ b/tools/nfsrahead/99-nfs.rules.in
@@ -0,0 +1 @@
+SUBSYSTEM=="bdi", ACTION=="add", PROGRAM="_libexecdir_/nfsrahead", ATTR{read_ahead_kb}="%c"
diff --git a/tools/nfsrahead/Makefile.am b/tools/nfsrahead/Makefile.am
index edff792..58a2ea2 100644
--- a/tools/nfsrahead/Makefile.am
+++ b/tools/nfsrahead/Makefile.am
@@ -1,3 +1,11 @@
libexec_PROGRAMS = nfsrahead
nfsrahead_SOURCES = main.c
+udev_rulesdir = /usr/lib/udev/rules.d/
+udev_rules_DATA = 99-nfs.rules
+
+99-nfs.rules: 99-nfs.rules.in $(builddefs)
+ $(SED) "s|_libexecdir_|@libexecdir@|g" 99-nfs.rules.in > $@
+
+clean-local:
+ $(RM) 99-nfs.rules