From: Kent Overstreet <kent.overstreet@linux.dev>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org,
Kent Overstreet <kent.overstreet@gmail.com>,
x86@kernel.org
Subject: [PATCH 05/11] x86/resctrl: Convert to printbuf
Date: Mon, 15 Aug 2022 13:26:07 -0400 [thread overview]
Message-ID: <20220815172613.621627-6-kent.overstreet@linux.dev> (raw)
In-Reply-To: <20220815172613.621627-1-kent.overstreet@linux.dev>
From: Kent Overstreet <kent.overstreet@gmail.com>
This converts from seq_buf to printbuf. We're using printbuf in external
buffer mode so it's a trivial direct conversion.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Cc: x86@kernel.org
---
arch/x86/kernel/cpu/resctrl/rdtgroup.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
index f276aff521..50c12711a2 100644
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@ -19,7 +19,7 @@
#include <linux/fs_parser.h>
#include <linux/sysfs.h>
#include <linux/kernfs.h>
-#include <linux/seq_buf.h>
+#include <linux/printbuf.h>
#include <linux/seq_file.h>
#include <linux/sched/signal.h>
#include <linux/sched/task.h>
@@ -51,7 +51,7 @@ static struct kernfs_node *kn_mongrp;
/* Kernel fs node for "mon_data" directory under root */
static struct kernfs_node *kn_mondata;
-static struct seq_buf last_cmd_status;
+static struct printbuf last_cmd_status;
static char last_cmd_status_buf[512];
struct dentry *debugfs_resctrl;
@@ -59,13 +59,13 @@ struct dentry *debugfs_resctrl;
void rdt_last_cmd_clear(void)
{
lockdep_assert_held(&rdtgroup_mutex);
- seq_buf_clear(&last_cmd_status);
+ printbuf_reset(&last_cmd_status);
}
void rdt_last_cmd_puts(const char *s)
{
lockdep_assert_held(&rdtgroup_mutex);
- seq_buf_puts(&last_cmd_status, s);
+ prt_str(&last_cmd_status, s);
}
void rdt_last_cmd_printf(const char *fmt, ...)
@@ -74,7 +74,7 @@ void rdt_last_cmd_printf(const char *fmt, ...)
va_start(ap, fmt);
lockdep_assert_held(&rdtgroup_mutex);
- seq_buf_vprintf(&last_cmd_status, fmt, ap);
+ prt_vprintf(&last_cmd_status, fmt, ap);
va_end(ap);
}
@@ -833,7 +833,7 @@ static int rdt_last_cmd_status_show(struct kernfs_open_file *of,
int len;
mutex_lock(&rdtgroup_mutex);
- len = seq_buf_used(&last_cmd_status);
+ len = printbuf_written(&last_cmd_status);
if (len)
seq_printf(seq, "%.*s", len, last_cmd_status_buf);
else
@@ -3248,8 +3248,8 @@ int __init rdtgroup_init(void)
{
int ret = 0;
- seq_buf_init(&last_cmd_status, last_cmd_status_buf,
- sizeof(last_cmd_status_buf));
+ last_cmd_status = PRINTBUF_EXTERN(last_cmd_status_buf,
+ sizeof(last_cmd_status_buf));
ret = rdtgroup_setup_root();
if (ret)
--
2.36.1
next prev parent reply other threads:[~2022-08-15 17:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-15 17:26 Printbufs v6 Kent Overstreet
2022-08-15 17:26 ` [PATCH 01/11] mm/memcontrol.c: Convert to printbuf Kent Overstreet
2022-08-15 17:26 ` [PATCH 02/11] clk: tegra: bpmp: " Kent Overstreet
2022-08-15 17:26 ` [PATCH 03/11] tools/testing/nvdimm: " Kent Overstreet
2022-08-15 17:26 ` [PATCH 04/11] powerpc: " Kent Overstreet
2022-08-15 17:26 ` Kent Overstreet [this message]
2022-08-15 17:26 ` [PATCH 06/11] PCI/P2PDMA: " Kent Overstreet
2022-08-15 17:26 ` [PATCH 07/11] tracing: trace_events_synth: " Kent Overstreet
2022-08-15 17:43 ` Steven Rostedt
2022-08-15 17:58 ` Kent Overstreet
2022-08-15 18:28 ` Steven Rostedt
2022-08-15 17:26 ` [PATCH 08/11] d_path: prt_path() Kent Overstreet
2022-08-15 17:26 ` [PATCH 09/11] ACPI/APEI: Add missing include Kent Overstreet
2022-08-15 17:26 ` [PATCH 10/11] seq_buf: Move to kernel/tracing Kent Overstreet
2022-08-15 17:26 ` [PATCH 11/11] MAINTAINERS: Add entry for printbufs Kent Overstreet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220815172613.621627-6-kent.overstreet@linux.dev \
--to=kent.overstreet@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=kent.overstreet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).