CS350 COS
COS
Loading...
Searching...
No Matches
disk.h File Reference
#include <sys/queue.h>
#include <sys/sga.h>
Include dependency graph for disk.h:

Go to the source code of this file.

Data Structures

struct  Disk
 

Typedefs

typedef void(* DiskCB) (int, void *)
 
typedef struct Disk Disk
 

Functions

void Disk_AddDisk (Disk *disk)
 
void Disk_RemoveDisk (Disk *disk)
 
DiskDisk_GetByID (uint64_t ctrlNo, uint64_t diskNo)
 
int Disk_Read (Disk *disk, void *buf, SGArray *sga, DiskCB cb, void *arg)
 
int Disk_Write (Disk *disk, void *buf, SGArray *sga, DiskCB cb, void *arg)
 
int Disk_Flush (Disk *disk, void *buf, SGArray *sga, DiskCB cb, void *arg)
 

Typedef Documentation

◆ Disk

typedef struct Disk Disk

Definition at line 10 of file disk.h.

◆ DiskCB

typedef void(* DiskCB) (int, void *)

Definition at line 8 of file disk.h.

Function Documentation

◆ Disk_AddDisk()

void Disk_AddDisk ( Disk disk)
Here is the caller graph for this function:

◆ Disk_Flush()

int Disk_Flush ( Disk disk,
void *  buf,
SGArray sga,
DiskCB  cb,
void *  arg 
)

Definition at line 56 of file disk.c.

57{
58 return disk->flush(disk, buf, sga, cb, arg);
59}
static char buf[4096]
Definition: ethdump.c:10
int(* flush)(Disk *, void *, SGArray *, DiskCB, void *)
Definition: disk.h:20

◆ Disk_GetByID()

Disk * Disk_GetByID ( uint64_t  ctrlNo,
uint64_t  diskNo 
)

Definition at line 31 of file disk.c.

32{
33 Disk *d;
34
35 LIST_FOREACH(d, &diskList, entries) {
36 if (d->ctrlNo == ctrlNo && d->diskNo == diskNo)
37 return d;
38 }
39
40 return NULL;
41}
#define LIST_FOREACH(var, head, field)
Definition: queue.h:410
#define NULL
Definition: stddef.h:6
Definition: disk.h:11
uint64_t ctrlNo
Definition: disk.h:13
uint64_t diskNo
Definition: disk.h:14
Here is the caller graph for this function:

◆ Disk_Read()

int Disk_Read ( Disk disk,
void *  buf,
SGArray sga,
DiskCB  cb,
void *  arg 
)

Definition at line 44 of file disk.c.

45{
46 return disk->read(disk, buf, sga, cb, arg);
47}
int(* read)(Disk *, void *, SGArray *, DiskCB, void *)
Definition: disk.h:18
Here is the caller graph for this function:

◆ Disk_RemoveDisk()

void Disk_RemoveDisk ( Disk disk)

Definition at line 25 of file disk.c.

26{
27 LIST_REMOVE(disk, entries);
28}
#define LIST_REMOVE(elm, field)
Definition: queue.h:465

◆ Disk_Write()

int Disk_Write ( Disk disk,
void *  buf,
SGArray sga,
DiskCB  cb,
void *  arg 
)

Definition at line 50 of file disk.c.

51{
52 return disk->write(disk, buf, sga, cb, arg);
53}
int(* write)(Disk *, void *, SGArray *, DiskCB, void *)
Definition: disk.h:19
Here is the caller graph for this function: