From nobody Thu Feb 16 11:56:05 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 4PHYLb65VHz3q5fp; Thu, 16 Feb 2023 11:56: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 4PHYLY6b6Nz49Zk; Thu, 16 Feb 2023 11:56:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676548565; 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=gQUf90HRLy/C+W0VGhG7xxY5srIZ+KhwIXFpq5uLPvY=; b=xHImx84BE0lcHE8o2UPGwy/XML5wNdXVe6OKUzYjNdMpLJ5QRhfM1ZELzUP6LvfK2Vf3xf Lw8398uHCOiEdBlcczvLgcbX6PpBdR90f2RClCdCvJo38yY9zCeGX9bSlWpJMfk/cWl05I BIEpXqORCzrSAJzayBq/q+y1mDmo8BBaX6INvSqllrWEmNzDAWMdlzJD82N2fDBAwhFnfN jWHjk8jfImwYYJdol6rqdsDi6xnuGMvSmnmDVPeHACPipoPo5KG+bk6G11GwdPQnuHPuu8 ZpZ7MPs4i50zgEhJwVN/0iyuxFPlprI2PDMg6XGzvIB4bB6/Pzs74+KsVI2nDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676548565; 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=gQUf90HRLy/C+W0VGhG7xxY5srIZ+KhwIXFpq5uLPvY=; b=yPxy0rVODvcnJSy1oIFSSt3N97YRMKkJPOt23dmA1KytTGSXZpPRsYRvlyrB+KPgMQqRfj I2pHzKoMRl3qBsApKcosMfvXZ4aqKVb7lFvkZ7F8AR8iQ5qUnLYyFx4Ferqj0OHEkvK5sy xhHW6lBv/YXHhJIoTU8cemMkzWw3BdoiC90ijrTZNKhyJn7hvXLD/uYks0EcB8Vc/NMo0O Z+5sgLZaCe+u1j8gYGGQsRlOjgcRClV65zU7FuuUsMFFKTdS4XslYURxgBAZqG8gR0Q6vc 803R1RlPYCrUEtr99Xe/zeOXBfsaY5QhY9F/1Y7EDzqOKxfUTMQ8QVCrrdF/mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676548565; a=rsa-sha256; cv=none; b=uXlL+Pfd3Kk/c8Bm+4Xn+LxB14oLRGQaPKSsU2ACDkxGkBPLeqvD11xqUaPI7H0uXoxhLk ZvDxg5ObMXLUrABsJuE0D8RLbbHPrkCRZXNBJHYkDMSPC7YtKZBWnRi8wLtEV1xE86ojki NiMu3mGOoeyQ9VaSmNXNnYYBXbwyaKO+9hNTVQGLif3BNjLXGDtyCYI30/BiIh521lUzJB BGHvt2KOIzT67LNBfj79Q2EtAxM9OrZnqCfApKesujtD2VsXhUSP0inNPFDEhOscI6qERj NIyHpQQwL+/cHB32DO7qpQ7i5vF5sHObnm9WG4ZnmOi01HZ9Be8tyMcVwChZkQ== 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 4PHYLY5Hftz12j0; Thu, 16 Feb 2023 11:56:05 +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 31GBu5Cu055590; Thu, 16 Feb 2023 11:56:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GBu51C055589; Thu, 16 Feb 2023 11:56:05 GMT (envelope-from git) Date: Thu, 16 Feb 2023 11:56:05 GMT Message-Id: <202302161156.31GBu51C055589@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: f583b92a8c9d - stable/13 - lindebugfs: Add `debugfs_create_file_size()` 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: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f583b92a8c9df26f1a1661675563e4eed5ec8d40 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f583b92a8c9df26f1a1661675563e4eed5ec8d40 commit f583b92a8c9df26f1a1661675563e4eed5ec8d40 Author: Jean-Sébastien Pédron AuthorDate: 2022-12-30 09:57:49 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-02-16 11:55:16 +0000 lindebugfs: Add `debugfs_create_file_size()` This is the same as `debugfs_create_file()` but takes the initial size of the file. In FreeBSD, the given size is ignored and `debugfs_create_file()` is called. Reviewed by: emaste, manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D37914 (cherry picked from commit a04aa80e773a4bfdc4e72bab85d6e16f0083745e) --- sys/compat/lindebugfs/lindebugfs.c | 11 +++++++++++ sys/compat/linuxkpi/common/include/linux/debugfs.h | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/compat/lindebugfs/lindebugfs.c b/sys/compat/lindebugfs/lindebugfs.c index 8e878b1cd446..168d591625f2 100644 --- a/sys/compat/lindebugfs/lindebugfs.c +++ b/sys/compat/lindebugfs/lindebugfs.c @@ -213,6 +213,16 @@ debugfs_create_file(const char *name, umode_t mode, return (dnode); } +struct dentry * +debugfs_create_file_size(const char *name, umode_t mode, + struct dentry *parent, void *data, + const struct file_operations *fops, + loff_t file_size __unused) +{ + + return debugfs_create_file(name, mode, parent, data, fops); +} + /* * NOTE: Files created with the _unsafe moniker will not be protected from * debugfs core file removals. It is the responsibility of @fops to protect @@ -228,6 +238,7 @@ debugfs_create_file_unsafe(const char *name, umode_t mode, struct dentry *parent, void *data, const struct file_operations *fops) { + return (debugfs_create_file(name, mode, parent, data, fops)); } diff --git a/sys/compat/linuxkpi/common/include/linux/debugfs.h b/sys/compat/linuxkpi/common/include/linux/debugfs.h index 074f709114eb..abda2d149582 100644 --- a/sys/compat/linuxkpi/common/include/linux/debugfs.h +++ b/sys/compat/linuxkpi/common/include/linux/debugfs.h @@ -56,8 +56,14 @@ struct dentry *debugfs_create_file(const char *name, umode_t mode, struct dentry *parent, void *data, const struct file_operations *fops); -struct dentry *debugfs_create_file_unsafe(const char *name, umode_t mode, +/* TODO: We currently ignore the `file_size` argument. */ +struct dentry *debugfs_create_file_size(const char *name, umode_t mode, struct dentry *parent, void *data, + const struct file_operations *fops, + loff_t file_size); + +struct dentry *debugfs_create_file_unsafe(const char *name, umode_t mode, +struct dentry *parent, void *data, const struct file_operations *fops); struct dentry *debugfs_create_mode_unsafe(const char *name, umode_t mode,