diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2019-12-31 13:48:33 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2019-12-31 13:48:33 +0000 |
commit | e1d46407d705bb612ebbeebddbe85779b52a42a5 (patch) | |
tree | b128da7e2130d5eeae1d5918b1cc8692523d852b /sys/nfs/nfs_kq.c | |
parent | a2985aa5fb51f9899868daaf2cde0dfa5a0f449f (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/nfs/nfs_kq.c')
-rw-r--r-- | sys/nfs/nfs_kq.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/nfs/nfs_kq.c b/sys/nfs/nfs_kq.c index 0ccbe14ccb3..67cad81b4b5 100644 --- a/sys/nfs/nfs_kq.c +++ b/sys/nfs/nfs_kq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_kq.c,v 1.26 2019/12/05 10:41:57 mpi Exp $ */ +/* $OpenBSD: nfs_kq.c,v 1.27 2019/12/31 13:48:32 visa Exp $ */ /* $NetBSD: nfs_kq.c,v 1.7 2003/10/30 01:43:10 simonb Exp $ */ /*- @@ -249,10 +249,19 @@ filt_nfsvnode(struct knote *kn, long hint) return (kn->kn_fflags != 0); } -static const struct filterops nfsread_filtops = - { 1, NULL, filt_nfsdetach, filt_nfsread }; -static const struct filterops nfsvnode_filtops = - { 1, NULL, filt_nfsdetach, filt_nfsvnode }; +static const struct filterops nfsread_filtops = { + .f_isfd = 1, + .f_attach = NULL, + .f_detach = filt_nfsdetach, + .f_event = filt_nfsread, +}; + +static const struct filterops nfsvnode_filtops = { + .f_isfd = 1, + .f_attach = NULL, + .f_detach = filt_nfsdetach, + .f_event = filt_nfsvnode, +}; int nfs_kqfilter(void *v) |