From nobody Wed Jan 24 05:12:20 2024 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 4TKXBr5MyKz57TFF; Wed, 24 Jan 2024 05:12:20 +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 4TKXBr3f0Wz4ZKB; Wed, 24 Jan 2024 05:12:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706073140; 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=BLpTv+/0CoQ5ikqXX9HaKDaq0D3g3WKF00ECklfOGRc=; b=A/QSoH4d+C7dcCKtaPrAHQX6po4mrWWoMOjgGWv4YLOTyhnDF2GYQJqy65t/rnLXfTEVZv 62xlKjoaZJijhJkj1DrnvETG8yZhctcjmylsmRLXqLKa5R69mVIZp4KQEO9uKScJXYrQRU 6Rt8vzEdQKYJHNwyiPeuiFtJY4vQkKLwzQR0zUb1z7m+IfaseENCOSjAd/QTn+Q7WVJdf4 5snaWQiL41UcfBAhxms7T5feXvSd/C//IFetr4Ej1yMRc68dJTFkOGCZ7ktqLSO9znOLjx hgKMMYwwJ6hbQVbfGP7JmZtjsgRldc01RKx0USQXAZ3wZtefVAS9X2Qsz8vCHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706073140; 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=BLpTv+/0CoQ5ikqXX9HaKDaq0D3g3WKF00ECklfOGRc=; b=k9eieFASx62pT+DjEQIIMnCnNk5uSYrqNd5r5HpEz2j2DwOEprOndSj50BPt/93Y9RkVTz ljnph2ZpcemTNUxGN5CAkstvUA245WL4Ttxpm76NT+D+YPTd1p+3PB2Q43PHbPHyFoNw/K ffuHa3za0nJe5ccFFQUtN6pGgyDfOsGpT43BLWJBfdiMIWyZCC8sBYcHT147GP+YmFbatv yCUBBL/ViFzAzizl4mraP/pHYtj1UKdrRXvcOL67c+iLHqZNOIhKT+/hzWtB+AgkcSnU9k 00Ywlms70xxtdvXNw+bLfIdgwBANkunD5U1is8fWcj+Znl+QkLAXulKcliZhnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706073140; a=rsa-sha256; cv=none; b=BTUtUVtDKqr+2bnnB/+AP1jnmS9dj9eVH2/7nKG/TQajOV5AI/VkvWbt37IpcwhKXarpTf oaHUCXrzZZq6Wz5FxnJHfupb3SWCGc/YjlO+9VyprK819JbGIEsW+0Z9arZJ2C2aN7LF71 odYaN5JBPc8o6Dl0SDC/MVAg4qFkcGkFZiVubgvrH4VIYS1QTtGNNBToTugoq+wgNpseHv somv9ftMnHHthB6O89NgespGsz8mEcD1q7PKkrqAhBvXbxiEPPAssqAd9ibeQfZfGJSUEG /FcPGbTmR9qQoDjCJrrkSRuirFbun415eopr77wgf6ziKjmLGYq12Gd8FPF3JQ== 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 4TKXBr2lQCz11wX; Wed, 24 Jan 2024 05:12:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40O5CKrB040190; Wed, 24 Jan 2024 05:12:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40O5CKKr040187; Wed, 24 Jan 2024 05:12:20 GMT (envelope-from git) Date: Wed, 24 Jan 2024 05:12:20 GMT Message-Id: <202401240512.40O5CKKr040187@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: f04220c1b064 - main - kcmp(2): implement for vnode files 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f04220c1b0641fa68d01dc85d9fef706b02f4079 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f04220c1b0641fa68d01dc85d9fef706b02f4079 commit f04220c1b0641fa68d01dc85d9fef706b02f4079 Author: Konstantin Belousov AuthorDate: 2024-01-19 21:24:31 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-24 05:11:26 +0000 kcmp(2): implement for vnode files Reviewed by: brooks, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43518 --- sys/kern/kern_descrip.c | 1 + sys/kern/vfs_vnops.c | 9 +++++++++ sys/sys/vnode.h | 1 + 3 files changed, 11 insertions(+) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index e8e08f57196b..65b1f74d310b 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -5285,6 +5285,7 @@ struct fileops path_fileops = { .fo_chown = badfo_chown, .fo_sendfile = badfo_sendfile, .fo_fill_kinfo = vn_fill_kinfo, + .fo_cmp = vn_cmp, .fo_flags = DFLAG_PASSABLE, }; diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 40596263d551..dc2efee038bb 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -123,6 +123,7 @@ struct fileops vnops = { .fo_mmap = vn_mmap, .fo_fallocate = vn_fallocate, .fo_fspacectl = vn_fspacectl, + .fo_cmp = vn_cmp, .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE }; @@ -4228,3 +4229,11 @@ vn_lktype_write(struct mount *mp, struct vnode *vp) return (LK_SHARED); return (LK_EXCLUSIVE); } + +int +vn_cmp(struct file *fp1, struct file *fp2, struct thread *td) +{ + if (fp2->f_type != DTYPE_VNODE) + return (3); + return (kcmp_cmp((uintptr_t)fp1->f_vnode, (uintptr_t)fp2->f_vnode)); +} diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index c244eb13294d..987cf995f606 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -818,6 +818,7 @@ int vn_vget_ino_gen(struct vnode *vp, vn_get_ino_t alloc, void *alloc_arg, int lkflags, struct vnode **rvp); int vn_utimes_perm(struct vnode *vp, struct vattr *vap, struct ucred *cred, struct thread *td); +int vn_cmp(struct file *, struct file *, struct thread *td); int vn_io_fault_uiomove(char *data, int xfersize, struct uio *uio); int vn_io_fault_pgmove(vm_page_t ma[], vm_offset_t offset, int xfersize,