From nobody Fri Jun 02 17:43:38 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QXr2g2CS1z4YDv9; Fri, 2 Jun 2023 17:43:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QXr2g1nRpz3lcr; Fri, 2 Jun 2023 17:43:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685727819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ec7wDVTKDpB/CGOJK9wB/IsrF3I994f5ekT3HrDHgSI=; b=LiB98u1lIksTpEuHEVWMtSIDgyMyJSUrL32yjFGIJKGmlovhzNj6Mn1tVycV3bdXwdPYcp kVnKwqSMN5/H4qxMQgug94VKqVxplCwpiT15JOE4TNHSKKZFTYAYB61tMzMrfD18wccfS5 cn5loPofpAqJIus8Xiv5XWHvQEHOxdYkRROZEURbZ96mHwPOsYwGg3I6VnY2bxj6p2HTcj fkr4pFWL+Uc6lNShZGWX3qS7Qa4GcCm8VTZcYakAIzbEgaPh4y1yyQjH7AR+XnCP0hAImW wtUwsRthFhDekvUDOR9UWNgV4/JF262e4lB6AaGlNs+cGLYF71U+0VroMbguZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685727819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ec7wDVTKDpB/CGOJK9wB/IsrF3I994f5ekT3HrDHgSI=; b=vm+Kyl6V0spn1ENxVTkP9LOAv4fy1M508d8DR9V8qNWg7PwnvPaLyTgcgxCl/4C5ucLy0w TEZ7042DjXwoTiDJvsgXAOh/fcAGfBN4tXkN0z51F5Xyw10PY4kxy6Vmli5yi+EUeqAEEW lTIQ+FKt6/OF/zllnr+ZU+P4hCC5li5WJI7Tpv4h5NXmRb0QSqWPBlvOMVrTXkgPj0Nwc+ GOF7xA3bn4rlw11g/4Mjfx8NO+/Gvy+Tb3q+ytY+xGkuH5m7ufXJgfQi4Oyr2kCBVeI0IK mWBYRPr+E33d8F65NUt2cIuN/9VSKjjrQJpYLvxSmpfwqidj9SYSGYkoIDJsNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685727819; a=rsa-sha256; cv=none; b=nsC2kleETLFojpTEghhkHopohUid2/r76oJo7PSwfSQbg9Ge0pU8uJy92zhL5cgyca0g63 vRH+ERHmPKib0VPOSS6pygQ4jG9GQClDx6H+zzGPN8XNrY/I1YfEDFuXj9vBpKc4HelVKV sfu+t/Taw8nhvUEpIWFmFn/bZKsGi0rVjsprba7zKYcwQXnwJeBAvNdUyxLygGdGQhrNrw wkbNWuhDwIUsZ19blhUIZ9/76bGa75615P3i8LHyroeEvbADyOfeMX/fkzsTODnIE2ZIkk SXfLwp8pJYt7lpAXDPbfpd+DafzT3XrK6P/s3i2R7VScwugCNluyOm4RhoqhKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QXr2g0Xf5z17dn; Fri, 2 Jun 2023 17:43:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 352Hhclb008016; Fri, 2 Jun 2023 17:43:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 352HhcU3008015; Fri, 2 Jun 2023 17:43:38 GMT (envelope-from git) Date: Fri, 2 Jun 2023 17:43:38 GMT Message-Id: <202306021743.352HhcU3008015@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 67f938c5ff1a - main - kevent: Make references to filter definitions const List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 67f938c5ff1a4c90fcb9372132c8458ed67aba57 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=67f938c5ff1a4c90fcb9372132c8458ed67aba57 commit 67f938c5ff1a4c90fcb9372132c8458ed67aba57 Author: Mark Johnston AuthorDate: 2023-06-02 17:14:13 +0000 Commit: Mark Johnston CommitDate: 2023-06-02 17:43:15 +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 --- 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 add480ac5dff..199df2d6d661 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -107,7 +107,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, @@ -115,7 +115,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, @@ -341,10 +341,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] = { @@ -1400,7 +1399,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; @@ -1448,7 +1447,7 @@ kqueue_del_filteropts(int filt) return error; } -static struct filterops * +static const struct filterops * kqueue_fo_find(int filt) { @@ -1491,7 +1490,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; @@ -1820,7 +1819,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 b5b63c228a8f..7deef9fcebb2 100644 --- a/sys/sys/event.h +++ b/sys/sys/event.h @@ -308,7 +308,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 @@ -350,7 +350,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);