Date: Fri, 16 Jun 2023 13:59:14 GMT From: Mark Johnston <markj@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: ded54059fddd - stable/13 - kevent: Make references to filter definitions const Message-ID: <202306161359.35GDxEbI092699@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ded54059fddd6cbe0a2dea7c3f8d35cff5661505 commit ded54059fddd6cbe0a2dea7c3f8d35cff5661505 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2023-06-02 17:14:13 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2023-06-16 13:59:00 +0000 kevent: Make references to filter definitions const Follow-up revisions can make individual filter definitions const. No functional change intended. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D35842 (cherry picked from commit 67f938c5ff1a4c90fcb9372132c8458ed67aba57) --- sys/kern/kern_event.c | 17 ++++++++--------- sys/sys/event.h | 4 ++-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index f580ed10eb8d..a8aabd276d54 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -108,7 +108,7 @@ static int kqueue_acquire(struct file *fp, struct kqueue **kqp); static void kqueue_release(struct kqueue *kq, int locked); static void kqueue_destroy(struct kqueue *kq); static void kqueue_drain(struct kqueue *kq, struct thread *td); -static int kqueue_expand(struct kqueue *kq, struct filterops *fops, +static int kqueue_expand(struct kqueue *kq, const struct filterops *fops, uintptr_t ident, int mflag); static void kqueue_task(void *arg, int pending); static int kqueue_scan(struct kqueue *kq, int maxevents, @@ -116,7 +116,7 @@ static int kqueue_scan(struct kqueue *kq, int maxevents, const struct timespec *timeout, struct kevent *keva, struct thread *td); static void kqueue_wakeup(struct kqueue *kq); -static struct filterops *kqueue_fo_find(int filt); +static const struct filterops *kqueue_fo_find(int filt); static void kqueue_fo_release(int filt); struct g_kevent_args; static int kern_kevent_generic(struct thread *td, @@ -342,10 +342,9 @@ extern struct filterops fs_filtops; * Table for all system-defined filters. */ static struct mtx filterops_lock; -MTX_SYSINIT(kqueue_filterops, &filterops_lock, "protect sysfilt_ops", - MTX_DEF); +MTX_SYSINIT(kqueue_filterops, &filterops_lock, "protect sysfilt_ops", MTX_DEF); static struct { - struct filterops *for_fop; + const struct filterops *for_fop; int for_nolock; int for_refcnt; } sysfilt_ops[EVFILT_SYSCOUNT] = { @@ -1401,7 +1400,7 @@ kern_kevent_anonymous(struct thread *td, int nevents, } int -kqueue_add_filteropts(int filt, struct filterops *filtops) +kqueue_add_filteropts(int filt, const struct filterops *filtops) { int error; @@ -1449,7 +1448,7 @@ kqueue_del_filteropts(int filt) return error; } -static struct filterops * +static const struct filterops * kqueue_fo_find(int filt) { @@ -1492,7 +1491,7 @@ static int kqueue_register(struct kqueue *kq, struct kevent *kev, struct thread *td, int mflag) { - struct filterops *fops; + const struct filterops *fops; struct file *fp; struct knote *kn, *tkn; struct knlist *knl; @@ -1818,7 +1817,7 @@ kqueue_schedtask(struct kqueue *kq) * Return 0 on success (or no work necessary), return errno on failure. */ static int -kqueue_expand(struct kqueue *kq, struct filterops *fops, uintptr_t ident, +kqueue_expand(struct kqueue *kq, const struct filterops *fops, uintptr_t ident, int mflag) { struct klist *list, *tmp_knhash, *to_free; diff --git a/sys/sys/event.h b/sys/sys/event.h index 1141a22b8109..d413428a528a 100644 --- a/sys/sys/event.h +++ b/sys/sys/event.h @@ -306,7 +306,7 @@ struct knote { struct aioliojob *p_lio; /* LIO job pointer */ void *p_v; /* generic other pointer */ } kn_ptr; - struct filterops *kn_fop; + const struct filterops *kn_fop; #define kn_id kn_kevent.ident #define kn_filter kn_kevent.filter @@ -349,7 +349,7 @@ void knlist_cleardel(struct knlist *knl, struct thread *td, void knote_fdclose(struct thread *p, int fd); int kqfd_register(int fd, struct kevent *kev, struct thread *p, int mflag); -int kqueue_add_filteropts(int filt, struct filterops *filtops); +int kqueue_add_filteropts(int filt, const struct filterops *filtops); int kqueue_del_filteropts(int filt); void kqueue_drain_schedtask(void);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202306161359.35GDxEbI092699>