"Fossies" - the Fresh Open Source Software Archive

Member "aoe-aoe6-86/conf/35-patches/old-new.diff" (4 Jul 2015, 974 Bytes) of archive /linux/misc/aoe-aoe6-86.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Diff source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 --- a/linux/drivers/block/aoe/aoechr.c.old  2013-05-30 10:55:29.237409949 -0400
    2 +++ a/linux/drivers/block/aoe/aoechr.c  2013-05-30 10:54:46.538481086 -0400
    3 @@ -9,7 +9,7 @@
    4  #include <linux/init.h>
    5  #include <linux/delay.h>
    6  #include <linux/slab.h>
    7 -#include <linux/smp_lock.h>
    8 +#include <linux/mutex.h>
    9  #include <linux/export.h>
   10  #include "aoe.h"
   11  
   12 @@ -54,6 +54,7 @@ static struct aoe_chardev chardevs[] = {
   13     { MINOR_REVALIDATE, "revalidate" },
   14     { MINOR_FLUSH, "flush" },
   15  };
   16 +static DEFINE_MUTEX(aoechr_mutex);
   17  
   18  static int
   19  discover(void)
   20 @@ -182,16 +183,16 @@ aoechr_open(struct inode *inode, struct 
   21  {
   22     int n, i;
   23  
   24 -   lock_kernel();
   25 +   mutex_lock(&aoechr_mutex);
   26     n = MINOR(inode->i_rdev);
   27     filp->private_data = (void *) (unsigned long) n;
   28  
   29     for (i = 0; i < ARRAY_SIZE(chardevs); ++i)
   30         if (chardevs[i].minor == n) {
   31 -           unlock_kernel();
   32 +           mutex_unlock(&aoechr_mutex);
   33             return 0;
   34         }
   35 -   unlock_kernel();
   36 +   mutex_unlock(&aoechr_mutex);
   37     return -EINVAL;
   38  }
   39