Remove mon_pipe for communicating from monitor to manager
The returned value was never used, and we don't really want this return path anyway as writing to a pipe could conceivably block, and the monitor must not block.
This commit is contained in:
parent
f94d52f43e
commit
2f64e61a50
|
@ -152,7 +152,6 @@ static void write_wakeup(struct supertype *c)
|
||||||
|
|
||||||
/* send the monitor thread a pointer to the ping action */
|
/* send the monitor thread a pointer to the ping action */
|
||||||
write(c->mgr_pipe[1], &err, 1);
|
write(c->mgr_pipe[1], &err, 1);
|
||||||
read(c->mon_pipe[0], &err, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void remove_old(void)
|
static void remove_old(void)
|
||||||
|
|
1
mdadm.h
1
mdadm.h
|
@ -583,7 +583,6 @@ struct supertype {
|
||||||
struct active_array *arrays;
|
struct active_array *arrays;
|
||||||
int sock; /* listen to external programs */
|
int sock; /* listen to external programs */
|
||||||
int mgr_pipe[2]; /* communicate between threads */
|
int mgr_pipe[2]; /* communicate between threads */
|
||||||
int mon_pipe[2]; /* communicate between threads */
|
|
||||||
int devnum;
|
int devnum;
|
||||||
char *devname; /* e.g. md0. This appears in metadata_verison:
|
char *devname; /* e.g. md0. This appears in metadata_verison:
|
||||||
* external:/md0/12
|
* external:/md0/12
|
||||||
|
|
6
mdmon.c
6
mdmon.c
|
@ -66,9 +66,6 @@ int clone_monitor(struct supertype *container)
|
||||||
rv = pipe(container->mgr_pipe);
|
rv = pipe(container->mgr_pipe);
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
return rv;
|
return rv;
|
||||||
rv = pipe(container->mon_pipe);
|
|
||||||
if (rv < 0)
|
|
||||||
goto err_mon_pipe;
|
|
||||||
|
|
||||||
rv = clone(run_child, stack+4096-64,
|
rv = clone(run_child, stack+4096-64,
|
||||||
CLONE_FS|CLONE_FILES|CLONE_VM|CLONE_SIGHAND|CLONE_THREAD,
|
CLONE_FS|CLONE_FILES|CLONE_VM|CLONE_SIGHAND|CLONE_THREAD,
|
||||||
|
@ -79,9 +76,6 @@ int clone_monitor(struct supertype *container)
|
||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
err_clone:
|
err_clone:
|
||||||
close(container->mon_pipe[0]);
|
|
||||||
close(container->mon_pipe[1]);
|
|
||||||
err_mon_pipe:
|
|
||||||
close(container->mgr_pipe[0]);
|
close(container->mgr_pipe[0]);
|
||||||
close(container->mgr_pipe[1]);
|
close(container->mgr_pipe[1]);
|
||||||
|
|
||||||
|
|
|
@ -408,7 +408,7 @@ static void dprint_wake_reasons(fd_set *fds)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int wait_and_act(struct supertype *container, int pfd,
|
static int wait_and_act(struct supertype *container, int pfd,
|
||||||
int monfd, int nowait)
|
int nowait)
|
||||||
{
|
{
|
||||||
fd_set rfds;
|
fd_set rfds;
|
||||||
int maxfd = 0;
|
int maxfd = 0;
|
||||||
|
@ -477,7 +477,6 @@ static int wait_and_act(struct supertype *container, int pfd,
|
||||||
|
|
||||||
if (read(pfd, &err, 1) > 0)
|
if (read(pfd, &err, 1) > 0)
|
||||||
err = handle_pipe(active_cmd, *aap);
|
err = handle_pipe(active_cmd, *aap);
|
||||||
write(monfd, &err, 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -528,7 +527,7 @@ void do_monitor(struct supertype *container)
|
||||||
int first = 1;
|
int first = 1;
|
||||||
do {
|
do {
|
||||||
rv = wait_and_act(container, container->mgr_pipe[0],
|
rv = wait_and_act(container, container->mgr_pipe[0],
|
||||||
container->mon_pipe[1], first);
|
first);
|
||||||
first = 0;
|
first = 0;
|
||||||
} while (rv >= 0);
|
} while (rv >= 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue