Changeset View
Changeset View
Standalone View
Standalone View
stand/kboot/hostdisk.c
Show All 28 Lines | |||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <stdarg.h> | #include <stdarg.h> | ||||
#include "bootstrap.h" | #include "bootstrap.h" | ||||
#include "host_syscall.h" | #include "host_syscall.h" | ||||
static int hostdisk_init(void); | static int hostdisk_init(void); | ||||
static int hostdisk_strategy(void *devdata, int flag, daddr_t dblk, | static int hostdisk_strategy(void *devdata, int flag, daddr_t dblk, | ||||
size_t size, char *buf, size_t *rsize); | size_t size, char *buf, size_t *rsize); | ||||
static int hostdisk_open(struct open_file *f, ...); | static int hostdisk_open(struct open_file *f, struct devdesc *); | ||||
static int hostdisk_close(struct open_file *f); | static int hostdisk_close(struct open_file *f); | ||||
static int hostdisk_ioctl(struct open_file *f, u_long cmd, void *data); | static int hostdisk_ioctl(struct open_file *f, u_long cmd, void *data); | ||||
static int hostdisk_print(int verbose); | static int hostdisk_print(int verbose); | ||||
struct devsw hostdisk = { | struct devsw hostdisk = { | ||||
"/dev", | "/dev", | ||||
DEVT_DISK, | DEVT_DISK, | ||||
hostdisk_init, | hostdisk_init, | ||||
Show All 34 Lines | hostdisk_strategy(void *devdata, int flag, daddr_t dblk, size_t size, | ||||
if (n < 0) | if (n < 0) | ||||
return (EIO); | return (EIO); | ||||
*rsize = n; | *rsize = n; | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
hostdisk_open(struct open_file *f, ...) | hostdisk_open(struct open_file *f, struct devdesc *desc) | ||||
tsoome: f is __unused | |||||
{ | { | ||||
struct devdesc *desc; | |||||
va_list vl; | |||||
va_start(vl, f); | |||||
desc = va_arg(vl, struct devdesc *); | |||||
va_end(vl); | |||||
desc->d_unit = host_open(desc->d_opendata, O_RDONLY, 0); | desc->d_unit = host_open(desc->d_opendata, O_RDONLY, 0); | ||||
Done Inline Actionsthis will likely cause me a merge conflict, but this change is worth it. imp: this will likely cause me a merge conflict, but this change is worth it. | |||||
if (desc->d_unit <= 0) { | if (desc->d_unit <= 0) { | ||||
printf("hostdisk_open: couldn't open %s: %d\n", | printf("hostdisk_open: couldn't open %s: %d\n", | ||||
(char *)desc->d_opendata, desc->d_unit); | (char *)desc->d_opendata, desc->d_unit); | ||||
return (ENOENT); | return (ENOENT); | ||||
} | } | ||||
return (0); | return (0); | ||||
Show All 24 Lines |
f is __unused