summaryrefslogtreecommitdiff
path: root/sys/tmpfs
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2019-12-31 13:48:33 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2019-12-31 13:48:33 +0000
commite1d46407d705bb612ebbeebddbe85779b52a42a5 (patch)
treeb128da7e2130d5eeae1d5918b1cc8692523d852b /sys/tmpfs
parenta2985aa5fb51f9899868daaf2cde0dfa5a0f449f (diff)
Use C99 designated initializers with struct filterops. In addition,
make the structs const so that the data are put in .rodata. OK mpi@, deraadt@, anton@, bluhm@
Diffstat (limited to 'sys/tmpfs')
-rw-r--r--sys/tmpfs/tmpfs_vnops.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/sys/tmpfs/tmpfs_vnops.c b/sys/tmpfs/tmpfs_vnops.c
index 857fcb47771..ba3963a14ea 100644
--- a/sys/tmpfs/tmpfs_vnops.c
+++ b/sys/tmpfs/tmpfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmpfs_vnops.c,v 1.36 2019/08/05 08:35:59 anton Exp $ */
+/* $OpenBSD: tmpfs_vnops.c,v 1.37 2019/12/31 13:48:32 visa Exp $ */
/* $NetBSD: tmpfs_vnops.c,v 1.100 2012/11/05 17:27:39 dholland Exp $ */
/*
@@ -2587,12 +2587,26 @@ int filt_tmpfsread(struct knote *kn, long hint);
int filt_tmpfswrite(struct knote *kn, long hint);
int filt_tmpfsvnode(struct knote *kn, long hint);
-struct filterops tmpfsread_filtops =
- { 1, NULL, filt_tmpfsdetach, filt_tmpfsread };
-struct filterops tmpfswrite_filtops =
- { 1, NULL, filt_tmpfsdetach, filt_tmpfswrite };
-struct filterops tmpfsvnode_filtops =
- { 1, NULL, filt_tmpfsdetach, filt_tmpfsvnode };
+const struct filterops tmpfsread_filtops = {
+ .f_isfd = 1,
+ .f_attach = NULL,
+ .f_detach = filt_tmpfsdetach,
+ .f_event = filt_tmpfsread,
+};
+
+const struct filterops tmpfswrite_filtops = {
+ .f_isfd = 1,
+ .f_attach = NULL,
+ .f_detach = filt_tmpfsdetach,
+ .f_event = filt_tmpfswrite,
+};
+
+const struct filterops tmpfsvnode_filtops = {
+ .f_isfd = 1,
+ .f_attach = NULL,
+ .f_detach = filt_tmpfsdetach,
+ .f_event = filt_tmpfsvnode,
+};
int
tmpfs_kqfilter(void *v)