]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Remove mon_pipe for communicating from monitor to manager
authorNeil Brown <neilb@suse.de>
Sat, 12 Jul 2008 10:27:40 +0000 (20:27 +1000)
committerNeil Brown <neilb@suse.de>
Sat, 12 Jul 2008 10:27:40 +0000 (20:27 +1000)
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.

managemon.c
mdadm.h
mdmon.c
monitor.c

index 569449b5d97aedac090e1bf2d60886989ece6ae0..e7c60aa9b28fe6deea6aa7f16c9891f1a8712595 100644 (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)
diff --git a/mdadm.h b/mdadm.h
index ba9174ea8da6e673db277cf3cad4fe072bdfb090..c0cad4331f42e39c18fa913bac66c2d513317cf2 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -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
diff --git a/mdmon.c b/mdmon.c
index b980083c2a639117d43a16d5b65384c4d00ace6d..bb0c4f75a1498390e516af4a0114558c4d4e1fae 100644 (file)
--- a/mdmon.c
+++ b/mdmon.c
@@ -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]);
 
index 5bb2559602d1f4cf2b241a2fe78df489dceb6623..0d85d32f2bb3a12151d8ccd7ff520cc498e87715 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -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);
 }