aoe  87
About: AoE (ATA over Ethernet) Protocol Driver (Linux kernel 4.8.x and greater are not supported).
  Fossies Dox: aoe-87.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

aoeblk.c File Reference
#include <linux/hdreg.h>
#include <linux/blkdev.h>
#include <linux/fs.h>
#include <linux/ioctl.h>
#include <linux/genhd.h>
#include <linux/netdevice.h>
#include <linux/export.h>
#include <linux/moduleparam.h>
#include <linux/debugfs.h>
#include <scsi/sg.h>
#include "aoe.h"
#include "disk_attr.h"
Include dependency graph for aoeblk.c:

Go to the source code of this file.

Functions

 module_param (aoe_maxsectors, int, 0644)
 
 MODULE_PARM_DESC (aoe_maxsectors, "When nonzero, set the maximum number of sectors per I/O request")
 
void aoe_bio_pagedec (struct bio *bio)
 
static ssize_t aoedisk_show_state (struct device *dev, struct device_attribute *attr, char *page)
 
static ssize_t aoedisk_show_mac (struct device *dev, struct device_attribute *attr, char *page)
 
static ssize_t aoedisk_show_netif (struct device *dev, struct device_attribute *attr, char *page)
 
static ssize_t aoedisk_show_fwver (struct device *dev, struct device_attribute *attr, char *page)
 
static ssize_t aoedisk_show_payload (struct device *dev, struct device_attribute *attr, char *page)
 
static int aoedisk_debugfs_show (struct seq_file *s, void *ignored)
 
static int aoe_debugfs_open (struct inode *inode, struct file *file)
 
static DEVICE_ATTR (state, S_IRUGO, aoedisk_show_state, NULL)
 
static DEVICE_ATTR (mac, S_IRUGO, aoedisk_show_mac, NULL)
 
static DEVICE_ATTR (netif, S_IRUGO, aoedisk_show_netif, NULL)
 
static DEVICE_ATTR (payload, S_IRUGO, aoedisk_show_payload, NULL)
 
static void aoedisk_add_debugfs (struct aoedev *d)
 
void aoedisk_rm_debugfs (struct aoedev *d)
 
static int aoedisk_add_sysfs (struct aoedev *d)
 
void aoedisk_rm_sysfs (struct aoedev *d)
 
static int aoeblk_open (struct block_device *bdev, fmode_t mode)
 
static void aoeblk_release (struct gendisk *disk, fmode_t mode)
 
static void aoeblk_request (struct request_queue *q)
 
static int aoeblk_getgeo (struct block_device *bdev, struct hd_geometry *geo)
 
static int aoeblk_ioctl (struct block_device *bdev, fmode_t mode, uint cmd, ulong arg)
 
void aoeblk_gdalloc (void *vp)
 
void aoeblk_exit (void)
 
int __init aoeblk_init (void)
 

Variables

static struct kmem_cache * buf_pool_cache
 
static struct dentry * aoe_debugfs_dir
 
static int aoe_maxsectors
 
static struct device_attribute dev_attr_firmware_version
 
static struct attribute * aoe_attrs []
 
static const struct attribute_group attr_group
 
static const struct file_operations aoe_debugfs_fops
 
static const struct block_device_operations aoe_bdops
 

Function Documentation

◆ aoe_bio_pagedec()

void aoe_bio_pagedec ( struct bio *  bio)

Definition at line 31 of file aoeblk.c.

References iter.

Referenced by aoe_end_buf().

◆ aoe_debugfs_open()

static int aoe_debugfs_open ( struct inode *  inode,
struct file *  file 
)
static

Definition at line 167 of file aoeblk.c.

References aoedisk_debugfs_show().

◆ aoeblk_exit()

void aoeblk_exit ( void  )

Definition at line 444 of file aoeblk.c.

References aoe_debugfs_dir, and buf_pool_cache.

Referenced by aoe_exit(), and aoe_init().

◆ aoeblk_gdalloc()

◆ aoeblk_getgeo()

static int aoeblk_getgeo ( struct block_device *  bdev,
struct hd_geometry *  geo 
)
static

Definition at line 305 of file aoeblk.c.

References DEVFL_UP, aoedev::flags, and aoedev::geo.

◆ aoeblk_init()

int __init aoeblk_init ( void  )

Definition at line 452 of file aoeblk.c.

References aoe_debugfs_dir, and buf_pool_cache.

Referenced by aoe_init().

◆ aoeblk_ioctl()

static int aoeblk_ioctl ( struct block_device *  bdev,
fmode_t  mode,
uint  cmd,
ulong  arg 
)
static

Definition at line 321 of file aoeblk.c.

References DEVFL_UP, aoedev::flags, and aoedev::ident.

◆ aoeblk_open()

static int aoeblk_open ( struct block_device *  bdev,
fmode_t  mode 
)
static

Definition at line 244 of file aoeblk.c.

References DEVFL_TKILL, DEVFL_UP, aoedev::flags, aoedev::lock, and aoedev::nopen.

◆ aoeblk_release()

static void aoeblk_release ( struct gendisk *  disk,
fmode_t  mode 
)
static

◆ aoeblk_request()

static void aoeblk_request ( struct request_queue *  q)
static

Definition at line 286 of file aoeblk.c.

References aoe_end_request(), aoecmd_work(), aoedev::aoemajor, aoedev::aoeminor, DEVFL_UP, and aoedev::flags.

Referenced by aoeblk_gdalloc().

◆ aoedisk_add_debugfs()

static void aoedisk_add_debugfs ( struct aoedev d)
static

Definition at line 202 of file aoeblk.c.

References aoe_debugfs_dir, aoe_debugfs_fops, aoedev::debugfs, and aoedev::gd.

Referenced by aoeblk_gdalloc().

◆ aoedisk_add_sysfs()

static int aoedisk_add_sysfs ( struct aoedev d)
static

Definition at line 233 of file aoeblk.c.

References attr_group, and aoedev::gd.

Referenced by aoeblk_gdalloc().

◆ aoedisk_debugfs_show()

static int aoedisk_debugfs_show ( struct seq_file *  s,
void *  ignored 
)
static

◆ aoedisk_rm_debugfs()

void aoedisk_rm_debugfs ( struct aoedev d)

Definition at line 226 of file aoeblk.c.

References aoedev::debugfs.

Referenced by freedev().

◆ aoedisk_rm_sysfs()

void aoedisk_rm_sysfs ( struct aoedev d)

Definition at line 238 of file aoeblk.c.

References attr_group, and aoedev::gd.

Referenced by freedev().

◆ aoedisk_show_fwver()

static ssize_t aoedisk_show_fwver ( struct device *  dev,
struct device_attribute *  attr,
char *  page 
)
static

Definition at line 105 of file aoeblk.c.

References aoedev::fw_ver.

◆ aoedisk_show_mac()

static ssize_t aoedisk_show_mac ( struct device *  dev,
struct device_attribute *  attr,
char *  page 
)
static

Definition at line 56 of file aoeblk.c.

References aoetgt::addr, aoetgt::d, mac_addr(), and aoedev::targets.

◆ aoedisk_show_netif()

static ssize_t aoedisk_show_netif ( struct device *  dev,
struct device_attribute *  attr,
char *  page 
)
static

Definition at line 67 of file aoeblk.c.

References NAOEIFS, aoeif::nd, aoedev::ntargets, and aoedev::targets.

◆ aoedisk_show_payload()

static ssize_t aoedisk_show_payload ( struct device *  dev,
struct device_attribute *  attr,
char *  page 
)
static

Definition at line 113 of file aoeblk.c.

References aoedev::maxbcnt.

◆ aoedisk_show_state()

static ssize_t aoedisk_show_state ( struct device *  dev,
struct device_attribute *  attr,
char *  page 
)
static

Definition at line 43 of file aoeblk.c.

References DEVFL_KICKME, DEVFL_UP, aoedev::flags, and aoedev::nopen.

◆ DEVICE_ATTR() [1/4]

static DEVICE_ATTR ( mac  ,
S_IRUGO  ,
aoedisk_show_mac  ,
NULL   
)
static

◆ DEVICE_ATTR() [2/4]

static DEVICE_ATTR ( netif  ,
S_IRUGO  ,
aoedisk_show_netif  ,
NULL   
)
static

◆ DEVICE_ATTR() [3/4]

static DEVICE_ATTR ( payload  ,
S_IRUGO  ,
aoedisk_show_payload  ,
NULL   
)
static

◆ DEVICE_ATTR() [4/4]

static DEVICE_ATTR ( state  ,
S_IRUGO  ,
aoedisk_show_state  ,
NULL   
)
static

◆ module_param()

module_param ( aoe_maxsectors  ,
int  ,
0644   
)

◆ MODULE_PARM_DESC()

MODULE_PARM_DESC ( aoe_maxsectors  ,
"When  nonzero,
set the maximum number of sectors per I/O request"   
)

Variable Documentation

◆ aoe_attrs

struct attribute* aoe_attrs[]
static
Initial value:
= {
&dev_attr_state.attr,
&dev_attr_mac.attr,
&dev_attr_netif.attr,
&dev_attr_payload.attr,
NULL,
}

Definition at line 181 of file aoeblk.c.

◆ aoe_bdops

const struct block_device_operations aoe_bdops
static
Initial value:
= {
.open = aoeblk_open,
.release = aoeblk_release,
.ioctl = aoeblk_ioctl,
.getgeo = aoeblk_getgeo,
.owner = THIS_MODULE,
}

Definition at line 348 of file aoeblk.c.

Referenced by aoeblk_gdalloc().

◆ aoe_debugfs_dir

struct dentry* aoe_debugfs_dir
static

Definition at line 21 of file aoeblk.c.

Referenced by aoeblk_exit(), aoeblk_init(), and aoedisk_add_debugfs().

◆ aoe_debugfs_fops

const struct file_operations aoe_debugfs_fops
static
Initial value:
= {
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
}

Definition at line 194 of file aoeblk.c.

Referenced by aoedisk_add_debugfs().

◆ aoe_maxsectors

int aoe_maxsectors
static

Definition at line 24 of file aoeblk.c.

Referenced by aoeblk_gdalloc().

◆ attr_group

const struct attribute_group attr_group
static
Initial value:
= {
.attrs = aoe_attrs,
}

Definition at line 190 of file aoeblk.c.

Referenced by aoedisk_add_sysfs(), and aoedisk_rm_sysfs().

◆ buf_pool_cache

struct kmem_cache* buf_pool_cache
static

Definition at line 20 of file aoeblk.c.

Referenced by aoeblk_exit(), aoeblk_gdalloc(), and aoeblk_init().

◆ dev_attr_firmware_version

struct device_attribute dev_attr_firmware_version
static
Initial value:
= {
.attr = { .name = "firmware-version", .mode = S_IRUGO },
}

Definition at line 175 of file aoeblk.c.

aoeblk_release
static void aoeblk_release(struct gendisk *disk, fmode_t mode)
Definition: aoeblk.c:270
aoe_attrs
static struct attribute * aoe_attrs[]
Definition: aoeblk.c:181
aoedisk_show_fwver
static ssize_t aoedisk_show_fwver(struct device *dev, struct device_attribute *attr, char *page)
Definition: aoeblk.c:105
aoeblk_open
static int aoeblk_open(struct block_device *bdev, fmode_t mode)
Definition: aoeblk.c:244
aoe_debugfs_open
static int aoe_debugfs_open(struct inode *inode, struct file *file)
Definition: aoeblk.c:167
aoeblk_getgeo
static int aoeblk_getgeo(struct block_device *bdev, struct hd_geometry *geo)
Definition: aoeblk.c:305
dev_attr_firmware_version
static struct device_attribute dev_attr_firmware_version
Definition: aoeblk.c:175
aoeblk_ioctl
static int aoeblk_ioctl(struct block_device *bdev, fmode_t mode, uint cmd, ulong arg)
Definition: aoeblk.c:321