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.
|
|
|
|
*/
|
|
|
|
|
2011-02-23 20:48:06 +00:00
|
|
|
#ifndef MARS_SERVER_H
|
|
|
|
#define MARS_SERVER_H
|
|
|
|
|
|
|
|
#include <linux/wait.h>
|
|
|
|
|
|
|
|
#include "mars_net.h"
|
2012-08-07 12:07:12 +00:00
|
|
|
#include "lib_limiter.h"
|
|
|
|
|
2013-04-12 07:59:44 +00:00
|
|
|
extern int server_show_statist;
|
|
|
|
|
2012-08-07 12:07:12 +00:00
|
|
|
extern struct mars_limiter server_limiter;
|
2017-09-07 08:56:44 +00:00
|
|
|
extern int dent_limit;
|
2017-09-11 13:29:09 +00:00
|
|
|
extern int dent_retry;
|
2017-09-07 09:03:13 +00:00
|
|
|
extern int handler_limit;
|
2011-02-23 20:48:06 +00:00
|
|
|
|
2023-01-11 18:34:26 +00:00
|
|
|
extern atomic_t server_callback_count;
|
2013-01-09 18:20:10 +00:00
|
|
|
extern atomic_t server_handler_count;
|
|
|
|
|
2011-02-23 20:48:06 +00:00
|
|
|
struct server_mref_aspect {
|
|
|
|
GENERIC_ASPECT(mref);
|
|
|
|
struct server_brick *brick;
|
2011-05-26 14:32:32 +00:00
|
|
|
struct list_head cb_head;
|
2022-05-31 19:51:21 +00:00
|
|
|
void *first_data;
|
|
|
|
int first_len;
|
2014-03-21 06:31:55 +00:00
|
|
|
bool do_put;
|
2011-02-23 20:48:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct server_output {
|
|
|
|
MARS_OUTPUT(server);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct server_brick {
|
|
|
|
MARS_BRICK(server);
|
2023-02-17 12:11:22 +00:00
|
|
|
struct list_head server_head;
|
2011-02-23 20:48:06 +00:00
|
|
|
struct semaphore socket_sem;
|
2012-01-11 11:35:09 +00:00
|
|
|
struct mars_socket handler_socket;
|
2018-05-10 07:56:54 +00:00
|
|
|
struct mars_tcp_params *handler_params;
|
2014-11-28 12:25:29 +00:00
|
|
|
struct mars_brick *conn_brick;
|
2011-02-23 20:48:06 +00:00
|
|
|
struct task_struct *handler_thread;
|
2011-05-26 14:32:32 +00:00
|
|
|
struct task_struct *cb_thread;
|
2023-03-15 14:09:44 +00:00
|
|
|
void *delegated_brick;
|
2023-05-05 13:40:06 +00:00
|
|
|
unsigned long shutdown_jiffies;
|
2011-02-23 20:48:06 +00:00
|
|
|
wait_queue_head_t startup_event;
|
2011-05-26 14:32:32 +00:00
|
|
|
wait_queue_head_t cb_event;
|
2020-06-12 07:37:53 +00:00
|
|
|
struct mutex cb_mutex;
|
2011-05-26 14:32:32 +00:00
|
|
|
struct list_head cb_read_list;
|
|
|
|
struct list_head cb_write_list;
|
2023-01-16 12:34:23 +00:00
|
|
|
atomic_t in_flight_reads;
|
|
|
|
atomic_t in_flight_writes;
|
2011-05-26 14:32:32 +00:00
|
|
|
bool cb_running;
|
2013-01-22 11:13:09 +00:00
|
|
|
bool handler_running;
|
2011-02-23 20:48:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct server_input {
|
|
|
|
MARS_INPUT(server);
|
|
|
|
};
|
|
|
|
|
|
|
|
MARS_TYPES(server);
|
|
|
|
|
|
|
|
#endif
|