From nobody Wed Jan 25 22:27:35 2023 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 4P2JPM6ztPz3bcyr; Wed, 25 Jan 2023 22:27:35 +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 4P2JPM67BJz4DpK; Wed, 25 Jan 2023 22:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674685655; 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=r2qGxlmErh+nHfhMe3zJyupqT2HLMSxp53yve3uB3fk=; b=TDI1ThZYiJCy4i+nuR/Pb+mM6Jrq+c+z2gb+th8chx+7ywOlyIlgwaJ/D903IxFa/d7+Bf JiCdKp5lFbLXSEJ59gG013QDM2iIsfaefn+MpmlGLl393YitStXL6ulWuLTwj2SlhmCGTb oH2F/+SqEV2+A1mculBmLlQ1T9aNEkQWMh6+Y6sMpoLPsBYM1Eg3LToE8dHikF1/oZZDye QKufvO403baQ8KW+FRxWiRfpPS0T22CszgBbxcMg269d3HzK4PcD8pwMuqJuf+P8BV5O3W jvK4cjpundipirZU5gb5GEEPO9g5FUngSMsHzr9uPg6YYg7JcucK3MOel9csQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674685655; 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=r2qGxlmErh+nHfhMe3zJyupqT2HLMSxp53yve3uB3fk=; b=gJ6BylTNqtIBjZTjIPkf9kfi4IlzdoUN0/o12lXcrnsU5wEoEc3aLqT0aJbk/bFSNyCuQW JvEueViUWd0cRX9kWTnHDTTarlHJvDy3sk1CNN3rI8Di1+NFxL+VHy+RDEzVJDBIRXyiH8 r//K+cP6L9w/kkK2kaCgsXXnt8zEk52VPWr3X29SDjUEMzAP+v9A9RXkXWdKWBttYhqBxu qeNX+WNTFt4xAdjOXcfqfEZYHqC8+hEz/Ay2s5Cm9lqSMqImQJlOxLXgtG2OkcwQQUYfEU 5Xhf8ikJrIsBVUelR2I8hDVGm4+bYkVc2l9/3TqTZOUuLQiwsOaUxYnDEXzLhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674685655; a=rsa-sha256; cv=none; b=oAtsOelNQjlBf/CfbZbL/u2PxGa6/T9E408Ik/qgh20dA7Odui3YV7IA0Ft3U1Hc+byaht F0MtfyA83NhLkLw+fv3neAwEPV0IiBmGU3fFFmhd2lMRI6DCvj3FJseOLhkGylQEiLU6wc Tqb2ONOWOFZc+G8e7ROiIK9Cqwp8RR76879r4w3Pj0wSlEmGj/Q9VUJvJW9YNX+28A8hce igUw9faluO0aJJUSQXUFFOPdMuA7dygGT/Hl1op0yZHPNF/6cSzOmrqup0AlNSez/ynVSG QKJxkkZNXmux7y3BmfW/F9hiNXEJsidjv4KNjHq0Jt4ErxMZ4q8U3Bjl88D6+g== 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 4P2JPM53q2z15n4; Wed, 25 Jan 2023 22:27:35 +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 30PMRZkv078783; Wed, 25 Jan 2023 22:27:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30PMRZLV078782; Wed, 25 Jan 2023 22:27:35 GMT (envelope-from git) Date: Wed, 25 Jan 2023 22:27:35 GMT Message-Id: <202301252227.30PMRZLV078782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: a04aa80e773a - main - lindebugfs: Add `debugfs_create_file_size()` 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: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a04aa80e773a4bfdc4e72bab85d6e16f0083745e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a04aa80e773a4bfdc4e72bab85d6e16f0083745e commit a04aa80e773a4bfdc4e72bab85d6e16f0083745e Author: Jean-Sébastien Pédron AuthorDate: 2022-12-30 09:57:49 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-01-25 22:23: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 --- 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,