aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorSunil Mushran <sunil.mushran@oracle.com>2010-12-14 17:14:31 -0500
committerJoel Becker <joel.becker@oracle.com>2010-12-16 03:48:26 -0500
commitcfc069d3fa24d7c6357e3b731e97f94db495bf0c (patch)
tree903479176f30fd7b9d49cb1e3b77ec7085305813 /fs/ocfs2
parentcb0586bd4c77c531fe0be4ae860ec642450eeda5 (diff)
ocfs2/cluster: Pin the local node when o2hb thread starts
The patch pins the node item of the local node when the o2hb thread starts and unpins on stop. An earlier patch pinned the node item of the remote node on o2net connect and unpinned on disconnect. Signed-off-by Sunil Mushran <sunil.mushran@oracle.com> Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/cluster/heartbeat.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index 3722e3850a1..8b50c1ad7a6 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -1083,6 +1083,9 @@ static int o2hb_thread(void *data)
1083 1083
1084 set_user_nice(current, -20); 1084 set_user_nice(current, -20);
1085 1085
1086 /* Pin node */
1087 o2nm_depend_this_node();
1088
1086 while (!kthread_should_stop() && !reg->hr_unclean_stop) { 1089 while (!kthread_should_stop() && !reg->hr_unclean_stop) {
1087 /* We track the time spent inside 1090 /* We track the time spent inside
1088 * o2hb_do_disk_heartbeat so that we avoid more than 1091 * o2hb_do_disk_heartbeat so that we avoid more than
@@ -1132,6 +1135,9 @@ static int o2hb_thread(void *data)
1132 mlog_errno(ret); 1135 mlog_errno(ret);
1133 } 1136 }
1134 1137
1138 /* Unpin node */
1139 o2nm_undepend_this_node();
1140
1135 mlog(ML_HEARTBEAT|ML_KTHREAD, "hb thread exiting\n"); 1141 mlog(ML_HEARTBEAT|ML_KTHREAD, "hb thread exiting\n");
1136 1142
1137 return 0; 1143 return 0;