2014-11-21 10:51:34 +00:00
|
|
|
/*
|
|
|
|
* MARS Long Distance Replication Software
|
|
|
|
*
|
|
|
|
* This file is part of MARS project: http://schoebel.github.io/mars/
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010-2014 Thomas Schoebel-Theuer
|
|
|
|
* Copyright (C) 2011-2014 1&1 Internet AG
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2010-08-03 16:03:32 +00:00
|
|
|
#ifndef MARS_CHECK_H
|
|
|
|
#define MARS_CHECK_H
|
|
|
|
|
2022-09-07 09:49:29 +00:00
|
|
|
#ifdef CONFIG_MARS_DEBUG_DEVEL_VIA_SAY
|
|
|
|
/* Historic: additional checks for mref integrity.
|
|
|
|
* Maybe converted to a modern method.
|
|
|
|
*/
|
2010-08-09 16:57:56 +00:00
|
|
|
#define CHECK_LOCK
|
2022-09-07 09:49:29 +00:00
|
|
|
#endif
|
2010-08-08 09:03:42 +00:00
|
|
|
|
2010-12-15 12:13:18 +00:00
|
|
|
struct check_mref_aspect {
|
|
|
|
GENERIC_ASPECT(mref);
|
2010-08-08 09:03:42 +00:00
|
|
|
#ifdef CHECK_LOCK
|
2010-08-05 15:54:48 +00:00
|
|
|
struct list_head mref_head;
|
2010-08-08 09:03:42 +00:00
|
|
|
#endif
|
2010-08-08 14:02:54 +00:00
|
|
|
struct generic_callback cb;
|
|
|
|
struct check_output *output;
|
2010-08-03 16:03:32 +00:00
|
|
|
unsigned long last_jiffies;
|
2010-08-09 16:57:56 +00:00
|
|
|
atomic_t call_count;
|
|
|
|
atomic_t callback_count;
|
2010-08-10 17:39:30 +00:00
|
|
|
bool installed;
|
2010-08-03 16:03:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct check_brick {
|
|
|
|
MARS_BRICK(check);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct check_input {
|
|
|
|
MARS_INPUT(check);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct check_output {
|
|
|
|
MARS_OUTPUT(check);
|
|
|
|
int instance_nr;
|
2010-08-08 09:03:42 +00:00
|
|
|
#ifdef CHECK_LOCK
|
2010-08-09 16:57:56 +00:00
|
|
|
struct task_struct *watchdog;
|
2010-08-08 09:03:42 +00:00
|
|
|
spinlock_t check_lock;
|
2010-08-05 15:54:48 +00:00
|
|
|
struct list_head mref_anchor;
|
2010-08-08 09:03:42 +00:00
|
|
|
#endif
|
2010-08-03 16:03:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
MARS_TYPES(check);
|
|
|
|
|
|
|
|
#endif
|