Skip to content

Commit beeba1e

Browse files
tobluxakpm00
authored andcommitted
ocfs2: use str_yes_no() and str_no_yes() helper functions
Remove hard-coded strings by using the str_yes_no() and str_no_yes() helper functions. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Thorsten Blum <[email protected]> Reviewed-by: Joseph Qi <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: Joel Becker <[email protected]> Cc: Junxiao Bi <[email protected]> Cc: Changwei Ge <[email protected]> Cc: Jun Piao <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent f0ef073 commit beeba1e

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

fs/ocfs2/dlm/dlmdebug.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/spinlock.h>
1515
#include <linux/debugfs.h>
1616
#include <linux/export.h>
17+
#include <linux/string_choices.h>
1718

1819
#include "../cluster/heartbeat.h"
1920
#include "../cluster/nodemanager.h"
@@ -90,12 +91,12 @@ void __dlm_print_one_lock_resource(struct dlm_lock_resource *res)
9091
buf, res->owner, res->state);
9192
printk(" last used: %lu, refcnt: %u, on purge list: %s\n",
9293
res->last_used, kref_read(&res->refs),
93-
list_empty(&res->purge) ? "no" : "yes");
94+
str_no_yes(list_empty(&res->purge)));
9495
printk(" on dirty list: %s, on reco list: %s, "
9596
"migrating pending: %s\n",
96-
list_empty(&res->dirty) ? "no" : "yes",
97-
list_empty(&res->recovering) ? "no" : "yes",
98-
res->migration_pending ? "yes" : "no");
97+
str_no_yes(list_empty(&res->dirty)),
98+
str_no_yes(list_empty(&res->recovering)),
99+
str_yes_no(res->migration_pending));
99100
printk(" inflight locks: %d, asts reserved: %d\n",
100101
res->inflight_locks, atomic_read(&res->asts_reserved));
101102
dlm_print_lockres_refmap(res);

fs/ocfs2/dlm/dlmmaster.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <linux/inet.h>
2222
#include <linux/spinlock.h>
2323
#include <linux/delay.h>
24-
24+
#include <linux/string_choices.h>
2525

2626
#include "../cluster/heartbeat.h"
2727
#include "../cluster/nodemanager.h"
@@ -2859,7 +2859,7 @@ static int dlm_mark_lockres_migrating(struct dlm_ctxt *dlm,
28592859
dlm_lockres_release_ast(dlm, res);
28602860

28612861
mlog(0, "about to wait on migration_wq, dirty=%s\n",
2862-
res->state & DLM_LOCK_RES_DIRTY ? "yes" : "no");
2862+
str_yes_no(res->state & DLM_LOCK_RES_DIRTY));
28632863
/* if the extra ref we just put was the final one, this
28642864
* will pass thru immediately. otherwise, we need to wait
28652865
* for the last ast to finish. */
@@ -2869,12 +2869,12 @@ static int dlm_mark_lockres_migrating(struct dlm_ctxt *dlm,
28692869
msecs_to_jiffies(1000));
28702870
if (ret < 0) {
28712871
mlog(0, "woken again: migrating? %s, dead? %s\n",
2872-
res->state & DLM_LOCK_RES_MIGRATING ? "yes":"no",
2873-
test_bit(target, dlm->domain_map) ? "no":"yes");
2872+
str_yes_no(res->state & DLM_LOCK_RES_MIGRATING),
2873+
str_no_yes(test_bit(target, dlm->domain_map)));
28742874
} else {
28752875
mlog(0, "all is well: migrating? %s, dead? %s\n",
2876-
res->state & DLM_LOCK_RES_MIGRATING ? "yes":"no",
2877-
test_bit(target, dlm->domain_map) ? "no":"yes");
2876+
str_yes_no(res->state & DLM_LOCK_RES_MIGRATING),
2877+
str_no_yes(test_bit(target, dlm->domain_map)));
28782878
}
28792879
if (!dlm_migration_can_proceed(dlm, res, target)) {
28802880
mlog(0, "trying again...\n");

fs/ocfs2/dlm/dlmrecovery.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <linux/timer.h>
2323
#include <linux/kthread.h>
2424
#include <linux/delay.h>
25-
25+
#include <linux/string_choices.h>
2626

2727
#include "../cluster/heartbeat.h"
2828
#include "../cluster/nodemanager.h"
@@ -581,8 +581,7 @@ static int dlm_remaster_locks(struct dlm_ctxt *dlm, u8 dead_node)
581581
msecs_to_jiffies(1000));
582582
mlog(0, "waited 1 sec for %u, "
583583
"dead? %s\n", ndata->node_num,
584-
dlm_is_node_dead(dlm, ndata->node_num) ?
585-
"yes" : "no");
584+
str_yes_no(dlm_is_node_dead(dlm, ndata->node_num)));
586585
} else {
587586
/* -ENOMEM on the other node */
588587
mlog(0, "%s: node %u returned "
@@ -677,7 +676,7 @@ static int dlm_remaster_locks(struct dlm_ctxt *dlm, u8 dead_node)
677676
spin_unlock(&dlm_reco_state_lock);
678677

679678
mlog(0, "pass #%d, all_nodes_done?: %s\n", ++pass,
680-
all_nodes_done?"yes":"no");
679+
str_yes_no(all_nodes_done));
681680
if (all_nodes_done) {
682681
int ret;
683682

fs/ocfs2/dlmglue.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/delay.h>
2020
#include <linux/quotaops.h>
2121
#include <linux/sched/signal.h>
22+
#include <linux/string_choices.h>
2223

2324
#define MLOG_MASK_PREFIX ML_DLM_GLUE
2425
#include <cluster/masklog.h>
@@ -4337,7 +4338,7 @@ static void ocfs2_process_blocked_lock(struct ocfs2_super *osb,
43374338
ocfs2_schedule_blocked_lock(osb, lockres);
43384339

43394340
mlog(ML_BASTS, "lockres %s, requeue = %s.\n", lockres->l_name,
4340-
ctl.requeue ? "yes" : "no");
4341+
str_yes_no(ctl.requeue));
43414342
spin_unlock_irqrestore(&lockres->l_lock, flags);
43424343

43434344
if (ctl.unblock_action != UNBLOCK_CONTINUE

0 commit comments

Comments
 (0)