projects
/
linux-2.6-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4575109
)
seq_file: Simplify __seq_puts()
author
Christophe JAILLET
<christophe.jaillet@wanadoo.fr>
Mon, 22 Apr 2024 10:24:07 +0000
(12:24 +0200)
committer
Christian Brauner
<brauner@kernel.org>
Thu, 2 May 2024 14:28:20 +0000
(16:28 +0200)
Change the implementation of the out-of-line __seq_puts() to simply be
a seq_write() call instead of duplicating the overflow/memcpy logic.
Suggested-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link:
https://lore.kernel.org/r/7cebc1412d8d1338a7e52cc9291d00f5368c14e4.1713781332.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/seq_file.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/seq_file.c
b/fs/seq_file.c
index 8ef0a07033ca37d81a1004e81a1b9ff6361c1822..e676c8b0cf5d8af861724222c006c67d908c2849 100644
(file)
--- a/
fs/seq_file.c
+++ b/
fs/seq_file.c
@@
-671,14
+671,7
@@
EXPORT_SYMBOL(seq_putc);
void __seq_puts(struct seq_file *m, const char *s)
{
- int len = strlen(s);
-
- if (m->count + len >= m->size) {
- seq_set_overflow(m);
- return;
- }
- memcpy(m->buf + m->count, s, len);
- m->count += len;
+ seq_write(m, s, strlen(s));
}
EXPORT_SYMBOL(__seq_puts);