"Fossies" - the Fresh Open Source Software Archive

Member "aoe-aoe6-86/conf/21-patches/dtd-gd.diff" (4 Jul 2015, 4349 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 diff -upr dtd/linux/drivers/block/aoe/aoeblk.c gd/linux/drivers/block/aoe/aoeblk.c
    2 --- dtd/linux/drivers/block/aoe/aoeblk.c    2013-06-19 01:27:11.000000000 -0400
    3 +++ gd/linux/drivers/block/aoe/aoeblk.c 2013-06-22 15:42:59.000000000 -0400
    4 @@ -40,10 +40,8 @@ aoe_bio_pagedec(struct bio *bio)
    5     }
    6  }
    7  
    8 -static ssize_t aoedisk_show_state(struct device *dev,
    9 -                 struct device_attribute *attr, char *page)
   10 +static ssize_t aoedisk_show_state(struct gendisk *disk, char *page)
   11  {
   12 -   struct gendisk *disk = dev_to_disk(dev);
   13     struct aoedev *d = disk->private_data;
   14  
   15     return snprintf(page, PAGE_SIZE,
   16 @@ -53,10 +51,8 @@ static ssize_t aoedisk_show_state(struct
   17             (d->nopen && !(d->flags & DEVFL_UP)) ? ",closewait" : "");
   18     /* I'd rather see nopen exported so we can ditch closewait */
   19  }
   20 -static ssize_t aoedisk_show_mac(struct device *dev,
   21 -               struct device_attribute *attr, char *page)
   22 +static ssize_t aoedisk_show_mac(struct gendisk *disk, char *page)
   23  {
   24 -   struct gendisk *disk = dev_to_disk(dev);
   25     struct aoedev *d = disk->private_data;
   26     struct aoetgt *t = d->targets[0];
   27  
   28 @@ -64,10 +60,8 @@ static ssize_t aoedisk_show_mac(struct d
   29         return snprintf(page, PAGE_SIZE, "none\n");
   30     return snprintf(page, PAGE_SIZE, "%012llx\n", mac_addr(t->addr));
   31  }
   32 -static ssize_t aoedisk_show_netif(struct device *dev,
   33 -                 struct device_attribute *attr, char *page)
   34 +static ssize_t aoedisk_show_netif(struct gendisk *disk, char *page)
   35  {
   36 -   struct gendisk *disk = dev_to_disk(dev);
   37     struct aoedev *d = disk->private_data;
   38     struct net_device *nds[8], **nd, **nnd, **ne;
   39     struct aoetgt **t, **te;
   40 @@ -102,18 +96,14 @@ static ssize_t aoedisk_show_netif(struct
   41     return p-page;
   42  }
   43  /* firmware version */
   44 -static ssize_t aoedisk_show_fwver(struct device *dev,
   45 -                 struct device_attribute *attr, char *page)
   46 +static ssize_t aoedisk_show_fwver(struct gendisk *disk, char *page)
   47  {
   48 -   struct gendisk *disk = dev_to_disk(dev);
   49     struct aoedev *d = disk->private_data;
   50  
   51     return snprintf(page, PAGE_SIZE, "0x%04x\n", (unsigned int) d->fw_ver);
   52  }
   53 -static ssize_t aoedisk_show_payload(struct device *dev,
   54 -                   struct device_attribute *attr, char *page)
   55 +static ssize_t aoedisk_show_payload(struct gendisk *disk, char *page)
   56  {
   57 -   struct gendisk *disk = dev_to_disk(dev);
   58     struct aoedev *d = disk->private_data;
   59  
   60     return snprintf(page, PAGE_SIZE, "%lu\n", d->maxbcnt);
   61 @@ -169,22 +159,34 @@ static int aoe_debugfs_open(struct inode
   62     return single_open(file, aoedisk_debugfs_show, inode->i_private);
   63  }
   64  
   65 -static DEVICE_ATTR(state, S_IRUGO, aoedisk_show_state, NULL);
   66 -static DEVICE_ATTR(mac, S_IRUGO, aoedisk_show_mac, NULL);
   67 -static DEVICE_ATTR(netif, S_IRUGO, aoedisk_show_netif, NULL);
   68 -static struct device_attribute dev_attr_firmware_version = {
   69 -   .attr = { .name = "firmware-version", .mode = S_IRUGO },
   70 -   .show = aoedisk_show_fwver,
   71 +static struct disk_attribute disk_attr_state = {
   72 +   .attr = {.name = "state", .mode = S_IRUGO },
   73 +   .show = aoedisk_show_state
   74 +};
   75 +static struct disk_attribute disk_attr_mac = {
   76 +   .attr = {.name = "mac", .mode = S_IRUGO },
   77 +   .show = aoedisk_show_mac
   78 +};
   79 +static struct disk_attribute disk_attr_netif = {
   80 +   .attr = {.name = "netif", .mode = S_IRUGO },
   81 +   .show = aoedisk_show_netif
   82 +};
   83 +static struct disk_attribute disk_attr_fwver = {
   84 +   .attr = {.name = "firmware-version", .mode = S_IRUGO },
   85 +   .show = aoedisk_show_fwver
   86 +};
   87 +static struct disk_attribute disk_attr_payload = {
   88 +   .attr = {.name = "payload", .mode = S_IRUGO },
   89 +   .show = aoedisk_show_payload
   90  };
   91 -static DEVICE_ATTR(payload, S_IRUGO, aoedisk_show_payload, NULL);
   92  
   93  static struct attribute *aoe_attrs[] = {
   94 -   &dev_attr_state.attr,
   95 -   &dev_attr_mac.attr,
   96 -   &dev_attr_netif.attr,
   97 -   &dev_attr_firmware_version.attr,
   98 -   &dev_attr_payload.attr,
   99 -   NULL,
  100 +   &disk_attr_state.attr,
  101 +   &disk_attr_mac.attr,
  102 +   &disk_attr_netif.attr,
  103 +   &disk_attr_fwver.attr,
  104 +   &disk_attr_payload.attr,
  105 +   NULL
  106  };
  107  
  108  static const struct attribute_group attr_group = {
  109 @@ -232,12 +234,12 @@ aoedisk_rm_debugfs(struct aoedev *d)
  110  static int
  111  aoedisk_add_sysfs(struct aoedev *d)
  112  {
  113 -   return sysfs_create_group(&disk_to_dev(d->gd)->kobj, &attr_group);
  114 +   return sysfs_create_group(&d->gd->kobj, &attr_group);
  115  }
  116  void
  117  aoedisk_rm_sysfs(struct aoedev *d)
  118  {
  119 -   sysfs_remove_group(&disk_to_dev(d->gd)->kobj, &attr_group);
  120 +   sysfs_remove_group(&d->gd->kobj, &attr_group);
  121  }
  122  
  123  static int