From nobody Fri Jun 16 13:59:14 2023 X-Original-To: dev-commits-src-branches@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 4QjLPG5gW3z4dxYW; Fri, 16 Jun 2023 13:59:14 +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 4QjLPG3fnYz3tpy; Fri, 16 Jun 2023 13:59:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686923954; 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=E8iGncyFsLs1aQfJIaVRGGZR0biOnx8RGEZAO1ATmyM=; b=pFcAhgulO3Nralosro7X0DKoO3zvB6NZPRMsq94Bb21qmWL2H5l9yBKP9PTq9z61Vx6fKJ Li7u+kS39L9EQa7+UW44nlPHMKGFld04x1/w4Jp+w3tuj8dI+zxwUkjab8rfwuESpUYgCL FS1hUBYsL9B6fWYoGn+u5N/TFjIGXan1LGLgjLMfA8KEc/h5FqHLIqfa0qsesrtREfJmnf mYmRsuEogs1pc6UChInBeyns8OnqZQ35V15C8bdAmNsm85Kmesg5sMJS2jzTPoffJTHjoc StpLb0SfcGOZYtNEfbeMFwZnyE/VmVxB+tYDlU+qsbt+9dJkiaiPOsJJ35XI1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686923954; 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=E8iGncyFsLs1aQfJIaVRGGZR0biOnx8RGEZAO1ATmyM=; b=FbVRdEz2o3mZUYi5KtGP6FXZ8rH/w9SlVaT+FXqhV+zu8dsHLuU1jyULT4Os8QAZhKyT0v zlU8P4+MXKJyJ320Lt7NdILu3YxrCthErzAJPy/VtT278OVpghkOiEgU2w67Sx9b/rkdjy LOS/WX80Y9ubim4wdIduVFvQpquEpX1+52YSxwuCPysP2uOESGGionpuiSs2W99/qy2P/o ZINjXPjmNVkMiQthCs1UgRZ77M+O3CN0vjAKdFlOhmuyuKyAhE8CFb+AQHeGxy3wJaExBa JFvT5nEfBUw9D7DxS+mpZgFUnViJ8U7pSdfo7IdzBRqqdom2viZi7WOgQwaGCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686923954; a=rsa-sha256; cv=none; b=BtDTtKqiFe4JDvWywK5O3XOS23ckUzCTOolT+nSCy3W6TSZjx4CYhEkPFqULHPE7+einY5 2bBSq/WPoTpJPKGe9zFCbPfYzpTN6gRpx62udvSLxqMrmP1p1WnwM8Z4YcAmPpqEgnqUVf olFGrBXggasnWjliwzrETUtJVfHwr/Akjd8bKVzvPLVq5hbCENkaNsc4qzSwSsXZJJ6ksj x0Ovr24gF/yoHueZ4q3EecrDLy5fLCi2GZGlMYTuObDGzD3MNsJxkplK4Zlg/g1G8S26Qo S6FzJchb7V68L6WYmX8T41uEg3LE6gudR1K0DgWQFjEe76LbG2cCvilU2AavKw== 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 4QjLPG2l19zWM3; Fri, 16 Jun 2023 13:59:14 +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 35GDxEn0092700; Fri, 16 Jun 2023 13:59:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35GDxEbI092699; Fri, 16 Jun 2023 13:59:14 GMT (envelope-from git) Date: Fri, 16 Jun 2023 13:59:14 GMT Message-Id: <202306161359.35GDxEbI092699@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ded54059fddd - stable/13 - kevent: Make references to filter definitions const List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: ded54059fddd6cbe0a2dea7c3f8d35cff5661505 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ded54059fddd6cbe0a2dea7c3f8d35cff5661505 commit ded54059fddd6cbe0a2dea7c3f8d35cff5661505 Author: Mark Johnston AuthorDate: 2023-06-02 17:14:13 +0000 Commit: Mark Johnston 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);