* [RESEND PATCH] ext4: Use str_plural() instead of PLURAL() macro
@ 2024-12-20 19:27 Thorsten Blum
0 siblings, 0 replies; 3+ messages in thread
From: Thorsten Blum @ 2024-12-20 19:27 UTC (permalink / raw)
To: Theodore Ts'o, Andreas Dilger; +Cc: Thorsten Blum, linux-ext4, linux-kernel
Remove the custom PLURAL() macro and use the str_plural() function
instead.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
fs/ext4/orphan.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/fs/ext4/orphan.c b/fs/ext4/orphan.c
index e5b47dda3317..1320f91c9b3b 100644
--- a/fs/ext4/orphan.c
+++ b/fs/ext4/orphan.c
@@ -4,6 +4,7 @@
#include <linux/fs.h>
#include <linux/quotaops.h>
#include <linux/buffer_head.h>
+#include <linux/string_choices.h>
#include "ext4.h"
#include "ext4_jbd2.h"
@@ -488,14 +489,12 @@ void ext4_orphan_cleanup(struct super_block *sb, struct ext4_super_block *es)
}
}
-#define PLURAL(x) (x), ((x) == 1) ? "" : "s"
-
if (nr_orphans)
ext4_msg(sb, KERN_INFO, "%d orphan inode%s deleted",
- PLURAL(nr_orphans));
+ nr_orphans, str_plural(nr_orphans));
if (nr_truncates)
ext4_msg(sb, KERN_INFO, "%d truncate%s cleaned up",
- PLURAL(nr_truncates));
+ nr_truncates, str_plural(nr_truncates));
#ifdef CONFIG_QUOTA
/* Turn off quotas if they were enabled for orphan cleanup */
if (quota_update) {
--
2.47.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [RESEND PATCH] ext4: Use str_plural() instead of PLURAL() macro
@ 2025-02-04 15:57 Thorsten Blum
2025-02-11 10:51 ` Thorsten Blum
0 siblings, 1 reply; 3+ messages in thread
From: Thorsten Blum @ 2025-02-04 15:57 UTC (permalink / raw)
To: Theodore Ts'o, Andreas Dilger; +Cc: Thorsten Blum, linux-ext4, linux-kernel
Remove the custom PLURAL() macro and use the str_plural() function
instead.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
fs/ext4/orphan.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/fs/ext4/orphan.c b/fs/ext4/orphan.c
index e5b47dda3317..1320f91c9b3b 100644
--- a/fs/ext4/orphan.c
+++ b/fs/ext4/orphan.c
@@ -4,6 +4,7 @@
#include <linux/fs.h>
#include <linux/quotaops.h>
#include <linux/buffer_head.h>
+#include <linux/string_choices.h>
#include "ext4.h"
#include "ext4_jbd2.h"
@@ -488,14 +489,12 @@ void ext4_orphan_cleanup(struct super_block *sb, struct ext4_super_block *es)
}
}
-#define PLURAL(x) (x), ((x) == 1) ? "" : "s"
-
if (nr_orphans)
ext4_msg(sb, KERN_INFO, "%d orphan inode%s deleted",
- PLURAL(nr_orphans));
+ nr_orphans, str_plural(nr_orphans));
if (nr_truncates)
ext4_msg(sb, KERN_INFO, "%d truncate%s cleaned up",
- PLURAL(nr_truncates));
+ nr_truncates, str_plural(nr_truncates));
#ifdef CONFIG_QUOTA
/* Turn off quotas if they were enabled for orphan cleanup */
if (quota_update) {
--
2.48.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RESEND PATCH] ext4: Use str_plural() instead of PLURAL() macro
2025-02-04 15:57 Thorsten Blum
@ 2025-02-11 10:51 ` Thorsten Blum
0 siblings, 0 replies; 3+ messages in thread
From: Thorsten Blum @ 2025-02-11 10:51 UTC (permalink / raw)
To: Theodore Ts'o, Andreas Dilger; +Cc: linux-ext4, linux-kernel
On 4. Feb 2025, at 16:57, Thorsten Blum wrote:
> Remove the custom PLURAL() macro and use the str_plural() function
> instead.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
Hi Theodore,
I'm wondering if you saw this and it didn't get lost? I first sent this
mid-November, and it's been a while.
Thanks,
Thorsten
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-11 10:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-20 19:27 [RESEND PATCH] ext4: Use str_plural() instead of PLURAL() macro Thorsten Blum
-- strict thread matches above, loose matches on Subject: below --
2025-02-04 15:57 Thorsten Blum
2025-02-11 10:51 ` Thorsten Blum
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).