From nobody Mon Nov 28 17:26:57 2022 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 4NLXTF5cfVz4jR04; Mon, 28 Nov 2022 17:26:57 +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 4NLXTF4VH8z43Wd; Mon, 28 Nov 2022 17:26:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669656417; 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=noNbYN2a6kcDXZKwF1smKMKtMRMRvhmxHatbDqU3Fx8=; b=CR+dkfMPco+tSYz9MlccU1etHWWQSNh4Q+35iEDY/Wa4poTPO0PJ3zB4VtuJ2Lnjk/JCF+ eZbHHPKZklwnFPOvwkFu478YimSwhV7YCIa2wGaWzgry+/8n0B3k8y9blQw2gOOJBo6XEa hABI/TbJu8yHP/qeX48rdwRmKSzyTlocVP48qyOzfSok9cQRCAoew+aTTDuYXInc9BUeiX L5pAXJdjM85oVuCeWpHU6Indfh9zeGgkkMlpcIjnALMe17WDyZdqSAbkcaap5KU+D72Wn2 jiG+QNZBL3/uNGYDtEPADWRBrF7P9Dgl+V4RIb8dCmcAt53S40p5fkR0bEcHVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669656417; 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=noNbYN2a6kcDXZKwF1smKMKtMRMRvhmxHatbDqU3Fx8=; b=YjcPcitEAQtlXMZCeuiHQxY2xeqcZ6f9Ks7besnksYXWSwOLUzAbIXEeddIqdW1425be+L iRKXtqVxc5Mx6L3BUcfJj9BqRUkSz6TnMWoLKY7xPAPTLsNoXIbqdnwpbylemgIQWzZNaq v1X/sCXLA3Bvu0VG/Py8R+9tEZ97Zsdl0+shaCw8lQPYzRZ8kbRSo3dLVPu/f3G4V/oNj4 /14IVOA4XLMs6VBmcPne/3L4SfKp7QuAKroKiOftswbJIgeHlfbkie+obyOTOM5tO/Knnw ifjr78AqHUJA4geExOkgevRGJ/jHiiv9/tVY7ZY6JQ0Rvwr34b3FAgo6ta+ddw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669656417; a=rsa-sha256; cv=none; b=Y1fR+j14dXluc7sotbjk0TP710CoCqpGEFNyr8qy48EpunFmRS/TNLCF1jedwbT7Frzpq3 Nx1WRUI3WnjoTV+x9UWZfkHsfyLpLThNgvlwRsWothnsyjGHyupIF8v7oFFXsgVVXyjEGl pwfjTdKka/oGqQ4U+GksvgRQMHHcK0+kNMWbCiBWO9Pb/8oaR//q1NHav+YDg1XU/gQK6M eGK3OGo8gsfOjhT3mjQGgxRKk9nY8tJNWVyNbkT9mgu1t2rAu6eayO3Fxv4+xN4fIaOboQ GbFKj/XmPO/EwWI94ToYsIyWBmrBfKGmVK1quE/lXWqvBVVFjaSB1uULWD6/zQ== 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 4NLXTF2Xj9zm5W; Mon, 28 Nov 2022 17:26:57 +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 2ASHQvM9081063; Mon, 28 Nov 2022 17:26:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2ASHQvc2081062; Mon, 28 Nov 2022 17:26:57 GMT (envelope-from git) Date: Mon, 28 Nov 2022 17:26:57 GMT Message-Id: <202211281726.2ASHQvc2081062@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: efeb199fc6de - stable/13 - LinuxKPI: seq_file add "private" versions. 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: efeb199fc6de3072e21144fd151591507e3eaac2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=efeb199fc6de3072e21144fd151591507e3eaac2 commit efeb199fc6de3072e21144fd151591507e3eaac2 Author: Bjoern A. Zeeb AuthorDate: 2022-10-22 18:07:37 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-11-28 16:30:16 +0000 LinuxKPI: seq_file add "private" versions. Add __seq_open_private() and seq_release_private() needed by iwlwifi debugfs support. Sponsored by: The FreeBSD Foundation Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D37089 (cherry picked from commit b5a81075903b3d97265151960b731210c0e80244) --- .../linuxkpi/common/include/linux/seq_file.h | 3 ++ sys/compat/linuxkpi/common/src/linux_seq_file.c | 33 ++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/seq_file.h b/sys/compat/linuxkpi/common/include/linux/seq_file.h index 9ab5ecce7768..4e7582b7acc2 100644 --- a/sys/compat/linuxkpi/common/include/linux/seq_file.h +++ b/sys/compat/linuxkpi/common/include/linux/seq_file.h @@ -71,6 +71,9 @@ struct seq_operations { ssize_t seq_read(struct linux_file *, char *, size_t, off_t *); int seq_write(struct seq_file *seq, const void *data, size_t len); +void *__seq_open_private(struct linux_file *, const struct seq_operations *, int); +int seq_release_private(struct inode *, struct linux_file *); + int seq_open(struct linux_file *f, const struct seq_operations *op); int seq_release(struct inode *inode, struct linux_file *file); diff --git a/sys/compat/linuxkpi/common/src/linux_seq_file.c b/sys/compat/linuxkpi/common/src/linux_seq_file.c index ed23bf8d010f..3ac8315a425f 100644 --- a/sys/compat/linuxkpi/common/src/linux_seq_file.c +++ b/sys/compat/linuxkpi/common/src/linux_seq_file.c @@ -113,6 +113,29 @@ seq_open(struct linux_file *f, const struct seq_operations *op) return (0); } +void * +__seq_open_private(struct linux_file *f, const struct seq_operations *op, int size) +{ + struct seq_file *seq_file; + void *private; + int error; + + private = malloc(size, M_LSEQ, M_NOWAIT|M_ZERO); + if (private == NULL) + return (NULL); + + error = seq_open(f, op); + if (error < 0) { + free(private, M_LSEQ); + return (NULL); + } + + seq_file = (struct seq_file *)f->private_data; + seq_file->private = private; + + return (private); +} + int single_open(struct linux_file *f, int (*show)(struct seq_file *, void *), void *d) { @@ -144,6 +167,16 @@ seq_release(struct inode *inode __unused, struct linux_file *file) return (0); } +int +seq_release_private(struct inode *inode __unused, struct linux_file *f) +{ + struct seq_file *seq; + + seq = (struct seq_file *)f->private_data; + free(seq->private, M_LSEQ); + return (seq_release(inode, f)); +} + int single_release(struct vnode *v, struct linux_file *f) {