sgi-xp: move xpc_check_remote_hb() to support both SN2 and UV

Move xpc_check_remote_hb() so it can support both SN2 and UV.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Dean Nelson
2008-07-29 22:34:17 -07:00
committed by Linus Torvalds
parent a812dcc3a2
commit 61deb86e98
3 changed files with 56 additions and 48 deletions

View File

@@ -178,7 +178,7 @@ void (*xpc_heartbeat_exit) (void);
void (*xpc_increment_heartbeat) (void);
void (*xpc_offline_heartbeat) (void);
void (*xpc_online_heartbeat) (void);
void (*xpc_check_remote_hb) (void);
enum xp_retval (*xpc_get_remote_heartbeat) (struct xpc_partition *part);
enum xp_retval (*xpc_make_first_contact) (struct xpc_partition *part);
void (*xpc_notify_senders_of_disconnect) (struct xpc_channel *ch);
@@ -269,6 +269,38 @@ xpc_stop_hb_beater(void)
xpc_heartbeat_exit();
}
/*
* At periodic intervals, scan through all active partitions and ensure
* their heartbeat is still active. If not, the partition is deactivated.
*/
static void
xpc_check_remote_hb(void)
{
struct xpc_partition *part;
short partid;
enum xp_retval ret;
for (partid = 0; partid < xp_max_npartitions; partid++) {
if (xpc_exiting)
break;
if (partid == xp_partition_id)
continue;
part = &xpc_partitions[partid];
if (part->act_state == XPC_P_INACTIVE ||
part->act_state == XPC_P_DEACTIVATING) {
continue;
}
ret = xpc_get_remote_heartbeat(part);
if (ret != xpSuccess)
XPC_DEACTIVATE_PARTITION(part, ret);
}
}
/*
* This thread is responsible for nearly all of the partition
* activation/deactivation.