"Fossies" - the Fresh Open Source Software Archive

Member "aoe-aoe6-86/conf/21-dev.c" (4 Jul 2015, 578 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) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #include <linux/hdreg.h>
    2 #include <linux/blkdev.h>
    3 #include <linux/fs.h>
    4 #include <linux/ioctl.h>
    5 #include <linux/genhd.h>
    6 #include <linux/netdevice.h>
    7 #include <scsi/sg.h>
    8 
    9 static ssize_t aoedisk_show_state(struct device *dev,
   10                   struct device_attribute *attr, char *page)
   11 {
   12     struct kobject *kobj = &dev->kobj; /* dev should have kobj */
   13     struct gendisk *gd = NULL;
   14 
   15     return kobj - (struct kobject *) &gd->dev; /* gd should have dev */
   16 }
   17 static DEVICE_ATTR(state, S_IRUGO, aoedisk_show_state, NULL);
   18 static struct attribute *aoe_attrs[] = {
   19     &dev_attr_state.attr,
   20     NULL,
   21 };