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:
Neil Brown 2008-07-12 20:27:40 +10:00
parent f94d52f43e
commit 2f64e61a50
4 changed files with 2 additions and 11 deletions

View File

@ -152,7 +152,6 @@ static void write_wakeup(struct supertype *c)
/* send the monitor thread a pointer to the ping action */
write(c->mgr_pipe[1], &err, 1);
read(c->mon_pipe[0], &err, 1);
}
static void remove_old(void)

View File

@ -583,7 +583,6 @@ struct supertype {
struct active_array *arrays;
int sock; /* listen to external programs */
int mgr_pipe[2]; /* communicate between threads */
int mon_pipe[2]; /* communicate between threads */
int devnum;
char *devname; /* e.g. md0. This appears in metadata_verison:
* external:/md0/12

View File

@ -66,9 +66,6 @@ int clone_monitor(struct supertype *container)
rv = pipe(container->mgr_pipe);
if (rv < 0)
return rv;
rv = pipe(container->mon_pipe);
if (rv < 0)
goto err_mon_pipe;
rv = clone(run_child, stack+4096-64,
CLONE_FS|CLONE_FILES|CLONE_VM|CLONE_SIGHAND|CLONE_THREAD,
@ -79,9 +76,6 @@ int clone_monitor(struct supertype *container)
return rv;
err_clone:
close(container->mon_pipe[0]);
close(container->mon_pipe[1]);
err_mon_pipe:
close(container->mgr_pipe[0]);
close(container->mgr_pipe[1]);

View File

@ -408,7 +408,7 @@ static void dprint_wake_reasons(fd_set *fds)
#endif
static int wait_and_act(struct supertype *container, int pfd,
int monfd, int nowait)
int nowait)
{
fd_set rfds;
int maxfd = 0;
@ -477,7 +477,6 @@ static int wait_and_act(struct supertype *container, int pfd,
if (read(pfd, &err, 1) > 0)
err = handle_pipe(active_cmd, *aap);
write(monfd, &err, 1);
}
}
@ -528,7 +527,7 @@ void do_monitor(struct supertype *container)
int first = 1;
do {
rv = wait_and_act(container, container->mgr_pipe[0],
container->mon_pipe[1], first);
first);
first = 0;
} while (rv >= 0);
}