From nobody Wed Jan 31 00:46:07 2024 X-Original-To: dev-commits-src-all@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 4TPjyR6jS6z580hm; Wed, 31 Jan 2024 00:46:07 +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 4TPjyR3Wrlz45Jw; Wed, 31 Jan 2024 00:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661967; 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=6jQE43YJfPgyb2w6KMUmOheOmgiQZS4sqjb/1cjiK8c=; b=dMPuCQHhwb5PTtrvLo4TWkbO3W+KqJOsONow5514zUgBO6MFG894H9evGC1jcSDcx/TMbW Bo6RUJDCHoO3mCSapp3SS54yRiYh+Oz/0ZTWgnjs0VQx9Y77kDC8t+PC8u9nJHO2SrXJjV uhys/sVhYCXHgVFufgTz29lFw53Zn/hgCLwqv2jT0guZ67qBH5ovygvxrrRvEXKrjpnS9P Lmu4H8VWTnVdYhfwpgB/FnQVslGJzkCYDAXZxaWkAX5on7usGhoeO2O6a1HtZe38QDWGO7 i6vNCWDGHpQjHoGpieXpnCmP6KBqxFwnGGZtIoCVlkDdIpF7HN8gB6dkFmK/Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706661967; 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=6jQE43YJfPgyb2w6KMUmOheOmgiQZS4sqjb/1cjiK8c=; b=As2LkKBad8PJxoSa5ETEcgITMZJa6TSzmLYmL5bHxH1pWjHL9XUXi0LQ64NV59O/lTlAcT 1BFEx5TYjccAgEyGmhxvqU0S4t+QYbUCGNgwGrUgD5SK/Ivcy90unCQC8ARrcl84V/xcgR SSzO4vmI2WPgJHNemEERKcTVMjeeC1SiHHr4FK0UgsRySRERVMzu6rafmAJvaCZb1f/boQ lHknbt496G/QLafZ12V/ZZYdrid1sPXRrUCl6Jm52f51ow2Veihh2sc2drRJuGMjdvxdDk fZ5nJQGdM5x1E84xaWKIGzvsLLvrhE/6tSh6nloDDnnDldTVTBcpLjXwEd57pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706661967; a=rsa-sha256; cv=none; b=q+nh6X53Sjul93XfKeAD5Px5NwkFQsgt7mJXFM/9rInkA2kf2hu0GNDeIe6l21ZVLFr5za 8H0HM/m9Yd6Bpt34eg9gK8TEre/0HP//oP/dhyjvbudTI8JcQtPkIcaSFrHCMnEMp3Pjg2 szgL5dY7gJ52LJcF/yC4zsMW3p28zYsPesY7vDH0ZGwO/ho+cVewQf+AzDH0jiJksdShvW Ln3vNMgoDpaC/5UCyJWtDuEDoRkI1+pQZ3NPVgFgUyPXzKxbCf/m0ySIsXqPVK87wyr73t yi0eB8V1f3c7OOc5czVUA5C9TNmUGWCd6vuLJp+zbHSa6Sqy8qdtKKJ9eHStLA== 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 4TPjyR2cyCzxxG; Wed, 31 Jan 2024 00:46:07 +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 40V0k77r063366; Wed, 31 Jan 2024 00:46:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40V0k7LH063363; Wed, 31 Jan 2024 00:46:07 GMT (envelope-from git) Date: Wed, 31 Jan 2024 00:46:07 GMT Message-Id: <202401310046.40V0k7LH063363@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d7c4a6205feb - stable/14 - file: add fo_cmp method List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: d7c4a6205feb6ba2d44159e343ec61cae3ecffb4 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d7c4a6205feb6ba2d44159e343ec61cae3ecffb4 commit d7c4a6205feb6ba2d44159e343ec61cae3ecffb4 Author: Konstantin Belousov AuthorDate: 2024-01-19 21:01:35 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-30 20:24:42 +0000 file: add fo_cmp method (cherry picked from commit 168c7580c6328342945db0e19a0791466bb07624) --- sys/sys/file.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/sys/file.h b/sys/sys/file.h index ab8aefbb32f1..540f1f525736 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -131,6 +131,7 @@ typedef int fo_fallocate_t(struct file *fp, off_t offset, off_t len, typedef int fo_fspacectl_t(struct file *fp, int cmd, off_t *offset, off_t *length, int flags, struct ucred *active_cred, struct thread *td); +typedef int fo_cmp_t(struct file *fp, struct file *fp1, struct thread *td); typedef int fo_spare_t(struct file *fp); typedef int fo_flags_t; @@ -154,7 +155,8 @@ struct fileops { fo_get_seals_t *fo_get_seals; fo_fallocate_t *fo_fallocate; fo_fspacectl_t *fo_fspacectl; - fo_spare_t *fo_spares[8]; /* Spare slots */ + fo_cmp_t *fo_cmp; + fo_spare_t *fo_spares[7]; /* Spare slots */ fo_flags_t fo_flags; /* DFLAG_* below */ }; @@ -493,6 +495,15 @@ fo_fspacectl(struct file *fp, int cmd, off_t *offset, off_t *length, active_cred, td)); } +static __inline int +fo_cmp(struct file *fp1, struct file *fp2, struct thread *td) +{ + + if (fp1->f_ops->fo_cmp == NULL) + return (ENODEV); + return ((*fp1->f_ops->fo_cmp)(fp1, fp2, td)); +} + #endif /* _KERNEL */ #endif /* !SYS_FILE_H */