mirror of https://github.com/schoebel/mars
infra: remove superfluous parameter is_server
This commit is contained in:
parent
dfe2dc5b1c
commit
bf7c0c9f3b
|
@ -389,7 +389,6 @@ int handler_thread(void *data)
|
||||||
prev = make_brick_all(
|
prev = make_brick_all(
|
||||||
brick->global,
|
brick->global,
|
||||||
NULL,
|
NULL,
|
||||||
true,
|
|
||||||
_set_server_bio_params,
|
_set_server_bio_params,
|
||||||
NULL,
|
NULL,
|
||||||
path,
|
path,
|
||||||
|
@ -738,7 +737,7 @@ static int _server_thread(void *data)
|
||||||
|
|
||||||
MARS_DBG("got new connection #%d\n", handler_socket.s_debug_nr);
|
MARS_DBG("got new connection #%d\n", handler_socket.s_debug_nr);
|
||||||
|
|
||||||
brick = (void*)mars_make_brick(&server_global, NULL, true, &server_brick_type, "handler", "handler");
|
brick = (void*)mars_make_brick(&server_global, NULL, &server_brick_type, "handler", "handler");
|
||||||
if (!brick) {
|
if (!brick) {
|
||||||
MARS_ERR("cannot create server instance\n");
|
MARS_ERR("cannot create server instance\n");
|
||||||
mars_shutdown_socket(&handler_socket);
|
mars_shutdown_socket(&handler_socket);
|
||||||
|
|
|
@ -1168,7 +1168,6 @@ int __make_copy(
|
||||||
aio =
|
aio =
|
||||||
make_brick_all(global,
|
make_brick_all(global,
|
||||||
NULL,
|
NULL,
|
||||||
false,
|
|
||||||
_set_bio_params,
|
_set_bio_params,
|
||||||
&clc[i],
|
&clc[i],
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -1193,7 +1192,6 @@ int __make_copy(
|
||||||
copy =
|
copy =
|
||||||
make_brick_all(global,
|
make_brick_all(global,
|
||||||
belongs,
|
belongs,
|
||||||
false,
|
|
||||||
_set_copy_params,
|
_set_copy_params,
|
||||||
&cc,
|
&cc,
|
||||||
cc.fullpath[1],
|
cc.fullpath[1],
|
||||||
|
@ -2220,7 +2218,6 @@ int make_log_init(void *buf, struct mars_dent *dent)
|
||||||
aio_brick =
|
aio_brick =
|
||||||
make_brick_all(global,
|
make_brick_all(global,
|
||||||
aio_dent,
|
aio_dent,
|
||||||
false,
|
|
||||||
_set_aio_params,
|
_set_aio_params,
|
||||||
NULL,
|
NULL,
|
||||||
aio_path,
|
aio_path,
|
||||||
|
@ -2271,7 +2268,6 @@ int make_log_init(void *buf, struct mars_dent *dent)
|
||||||
trans_brick =
|
trans_brick =
|
||||||
make_brick_all(global,
|
make_brick_all(global,
|
||||||
dent,
|
dent,
|
||||||
false,
|
|
||||||
_set_trans_params,
|
_set_trans_params,
|
||||||
NULL,
|
NULL,
|
||||||
aio_path,
|
aio_path,
|
||||||
|
@ -2659,7 +2655,6 @@ void _rotate_trans(struct mars_rotate *rot)
|
||||||
rot->next_relevant_brick =
|
rot->next_relevant_brick =
|
||||||
make_brick_all(rot->global,
|
make_brick_all(rot->global,
|
||||||
rot->next_relevant_log,
|
rot->next_relevant_log,
|
||||||
false,
|
|
||||||
_set_aio_params,
|
_set_aio_params,
|
||||||
NULL,
|
NULL,
|
||||||
rot->next_relevant_log->d_path,
|
rot->next_relevant_log->d_path,
|
||||||
|
@ -2773,7 +2768,6 @@ int _start_trans(struct mars_rotate *rot)
|
||||||
rot->relevant_brick =
|
rot->relevant_brick =
|
||||||
make_brick_all(rot->global,
|
make_brick_all(rot->global,
|
||||||
rot->relevant_log,
|
rot->relevant_log,
|
||||||
false,
|
|
||||||
_set_aio_params,
|
_set_aio_params,
|
||||||
NULL,
|
NULL,
|
||||||
rot->relevant_log->d_path,
|
rot->relevant_log->d_path,
|
||||||
|
@ -3068,7 +3062,6 @@ int make_bio(void *buf, struct mars_dent *dent)
|
||||||
brick =
|
brick =
|
||||||
make_brick_all(global,
|
make_brick_all(global,
|
||||||
dent,
|
dent,
|
||||||
false,
|
|
||||||
_set_bio_params,
|
_set_bio_params,
|
||||||
NULL,
|
NULL,
|
||||||
dent->d_path,
|
dent->d_path,
|
||||||
|
@ -3192,7 +3185,6 @@ int make_dev(void *buf, struct mars_dent *dent)
|
||||||
dev_brick =
|
dev_brick =
|
||||||
make_brick_all(global,
|
make_brick_all(global,
|
||||||
dent,
|
dent,
|
||||||
false,
|
|
||||||
_set_if_params,
|
_set_if_params,
|
||||||
rot,
|
rot,
|
||||||
dent->d_argv[0],
|
dent->d_argv[0],
|
||||||
|
@ -3271,7 +3263,6 @@ static int _make_direct(void *buf, struct mars_dent *dent)
|
||||||
brick =
|
brick =
|
||||||
make_brick_all(global,
|
make_brick_all(global,
|
||||||
dent,
|
dent,
|
||||||
false,
|
|
||||||
_set_bio_params,
|
_set_bio_params,
|
||||||
NULL,
|
NULL,
|
||||||
src_path,
|
src_path,
|
||||||
|
@ -3292,7 +3283,6 @@ static int _make_direct(void *buf, struct mars_dent *dent)
|
||||||
brick =
|
brick =
|
||||||
make_brick_all(global,
|
make_brick_all(global,
|
||||||
dent,
|
dent,
|
||||||
false,
|
|
||||||
_set_if_params,
|
_set_if_params,
|
||||||
NULL,
|
NULL,
|
||||||
dent->d_argv[1],
|
dent->d_argv[1],
|
||||||
|
|
|
@ -94,7 +94,7 @@ extern void mars_free_dent_all(struct mars_global *global, struct list_head *anc
|
||||||
// low-level brick instantiation
|
// low-level brick instantiation
|
||||||
|
|
||||||
extern struct mars_brick *mars_find_brick(struct mars_global *global, const void *brick_type, const char *path);
|
extern struct mars_brick *mars_find_brick(struct mars_global *global, const void *brick_type, const char *path);
|
||||||
extern struct mars_brick *mars_make_brick(struct mars_global *global, struct mars_dent *belongs, bool is_server, const void *_brick_type, const char *path, const char *name);
|
extern struct mars_brick *mars_make_brick(struct mars_global *global, struct mars_dent *belongs, const void *_brick_type, const char *path, const char *name);
|
||||||
extern int mars_free_brick(struct mars_brick *brick);
|
extern int mars_free_brick(struct mars_brick *brick);
|
||||||
extern int mars_kill_brick(struct mars_brick *brick);
|
extern int mars_kill_brick(struct mars_brick *brick);
|
||||||
extern int mars_kill_brick_all(struct mars_global *global, struct list_head *anchor, bool use_dent_link);
|
extern int mars_kill_brick_all(struct mars_global *global, struct list_head *anchor, bool use_dent_link);
|
||||||
|
@ -121,7 +121,6 @@ extern struct mars_brick *path_find_brick(struct mars_global *global, const void
|
||||||
extern struct mars_brick *make_brick_all(
|
extern struct mars_brick *make_brick_all(
|
||||||
struct mars_global *global,
|
struct mars_global *global,
|
||||||
struct mars_dent *belongs,
|
struct mars_dent *belongs,
|
||||||
bool is_server,
|
|
||||||
int (*setup_fn)(struct mars_brick *brick, void *private),
|
int (*setup_fn)(struct mars_brick *brick, void *private),
|
||||||
void *private,
|
void *private,
|
||||||
const char *new_name,
|
const char *new_name,
|
||||||
|
|
|
@ -1090,7 +1090,7 @@ done:
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(mars_free_brick);
|
EXPORT_SYMBOL_GPL(mars_free_brick);
|
||||||
|
|
||||||
struct mars_brick *mars_make_brick(struct mars_global *global, struct mars_dent *belongs, bool is_server, const void *_brick_type, const char *path, const char *_name)
|
struct mars_brick *mars_make_brick(struct mars_global *global, struct mars_dent *belongs, const void *_brick_type, const char *path, const char *_name)
|
||||||
{
|
{
|
||||||
const char *name = brick_strdup(_name);
|
const char *name = brick_strdup(_name);
|
||||||
const char *names[] = { name, NULL };
|
const char *names[] = { name, NULL };
|
||||||
|
@ -1448,7 +1448,6 @@ EXPORT_SYMBOL_GPL(_sio_brick_type);
|
||||||
struct mars_brick *make_brick_all(
|
struct mars_brick *make_brick_all(
|
||||||
struct mars_global *global,
|
struct mars_global *global,
|
||||||
struct mars_dent *belongs,
|
struct mars_dent *belongs,
|
||||||
bool is_server,
|
|
||||||
int (*setup_fn)(struct mars_brick *brick, void *private),
|
int (*setup_fn)(struct mars_brick *brick, void *private),
|
||||||
void *private,
|
void *private,
|
||||||
const char *new_name,
|
const char *new_name,
|
||||||
|
@ -1565,7 +1564,7 @@ struct mars_brick *make_brick_all(
|
||||||
remote++;
|
remote++;
|
||||||
MARS_DBG("substitute by remote brick '%s' on peer '%s'\n", new_name, remote);
|
MARS_DBG("substitute by remote brick '%s' on peer '%s'\n", new_name, remote);
|
||||||
|
|
||||||
brick = mars_make_brick(global, belongs, is_server, _client_brick_type, new_path, new_name);
|
brick = mars_make_brick(global, belongs, _client_brick_type, new_path, new_name);
|
||||||
if (brick) {
|
if (brick) {
|
||||||
struct client_brick *_brick = (void*)brick;
|
struct client_brick *_brick = (void*)brick;
|
||||||
_brick->max_flying = 10000;
|
_brick->max_flying = 10000;
|
||||||
|
@ -1589,7 +1588,7 @@ struct mars_brick *make_brick_all(
|
||||||
|
|
||||||
// create it...
|
// create it...
|
||||||
if (!brick)
|
if (!brick)
|
||||||
brick = mars_make_brick(global, belongs, is_server, new_brick_type, new_path, new_name);
|
brick = mars_make_brick(global, belongs, new_brick_type, new_path, new_name);
|
||||||
if (unlikely(!brick)) {
|
if (unlikely(!brick)) {
|
||||||
MARS_ERR("creation failed '%s' '%s'\n", new_path, new_name);
|
MARS_ERR("creation failed '%s' '%s'\n", new_path, new_name);
|
||||||
goto err;
|
goto err;
|
||||||
|
|
Loading…
Reference in New Issue