]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Don't lock array for START_ARRAY
authorNeil Brown <neilb@cse.unsw.edu.au>
Thu, 20 Jun 2002 05:23:05 +0000 (22:23 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 20 Jun 2002 05:23:05 +0000 (22:23 -0700)
... as autostart_array does it's own locking.

 ----------- Diffstat output ------------
 ./drivers/md/md.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

drivers/md/md.c

index acce321b5938d0cb1c8031590c22658b61c84ad8..519fd7be7d594e626492d7bab4d3f44c97c380b5 100644 (file)
@@ -2546,6 +2546,20 @@ static int md_ioctl(struct inode *inode, struct file *file,
                goto abort;
        }
 
+
+       if (cmd == START_ARRAY) {
+               /* START_ARRAY doesn't need to lock the array as autostart_array
+                * does the locking, and it could even be a different array
+                */
+               err = autostart_array(val_to_kdev(arg));
+               if (err) {
+                       printk(KERN_WARNING "md: autostart %s failed!\n",
+                              partition_name(val_to_kdev(arg)));
+                       goto abort;
+               }
+               goto done;
+       }
+
        err = mddev_lock(mddev);
        if (err) {
                printk(KERN_INFO "md: ioctl lock interrupted, reason %d, cmd %d\n",
@@ -2583,18 +2597,6 @@ static int md_ioctl(struct inode *inode, struct file *file,
                        }
                        goto done_unlock;
 
-               case START_ARRAY:
-                       /*
-                        * possibly make it lock the array ...
-                        */
-                       err = autostart_array(val_to_kdev(arg));
-                       if (err) {
-                               printk(KERN_WARNING "md: autostart %s failed!\n",
-                                       partition_name(val_to_kdev(arg)));
-                               goto abort_unlock;
-                       }
-                       goto done_unlock;
-
                default:;
        }