1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Fix some of the arcdisk devsw functions to catch up with warning fixes in

<stand.h>.  Also, since bcache_strategy() used to not have a prototype,
arcdisk happily called bcache_strategy() with 6 parameters instead of 7,
leaving out the disk unit number, which is the 2nd parameter.  Add in the
unit number to the bcache_strategy() call to fix this.
This commit is contained in:
John Baldwin 2000-08-04 05:25:36 +00:00
parent 00dc3782f7
commit 2efeedfd4b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=64221

View File

@ -61,9 +61,9 @@
#endif
static int bd_init(void);
static int bd_strategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, size_t *rsize);
static int bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, size_t *rsize);
static int bd_open(struct open_file *f, void *vdev);
static int bd_strategy(void *devdata, int flag, daddr_t dblk, size_t size, char *buf, size_t *rsize);
static int bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t size, char *buf, size_t *rsize);
static int bd_open(struct open_file *f, ...);
static int bd_close(struct open_file *f);
static void bd_print(int verbose);
@ -139,9 +139,9 @@ bd_print(int verbose)
* slice before it?)
*/
static int
bd_open(struct open_file *f, void *vdev)
bd_open(struct open_file *f, ...)
{
struct arc_devdesc *dev = vdev;
struct arc_devdesc *dev;
struct dos_partition *dptr;
struct open_disk *od;
struct disklabel *lp;
@ -149,6 +149,11 @@ bd_open(struct open_file *f, void *vdev)
int error;
int unit;
u_int32_t fd;
va_list ap;
va_start(ap, f);
dev = va_arg(ap, struct arc_devdesc *);
va_end(ap);
unit = dev->d_kind.arcdisk.unit;
if (unit >= nbdinfo) {
@ -317,17 +322,19 @@ bd_close(struct open_file *f)
}
static int
bd_strategy(void *devdata, int rw, daddr_t dblk, size_t size, void *buf, size_t *rsize)
bd_strategy(void *devdata, int rw, daddr_t dblk, size_t size, char *buf, size_t *rsize)
{
struct bcache_devdata bcd;
struct arc_devdesc *dev = (struct arc_devdesc *)devdata;
bcd.dv_strategy = bd_realstrategy;
bcd.dv_devdata = devdata;
return(bcache_strategy(&bcd, rw, dblk, size, buf, rsize));
return(bcache_strategy(&bcd, dev->d_kind.arcdisk.unit, rw, dblk, size,
buf, rsize));
}
static int
bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, size_t *rsize)
bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t size, char *buf, size_t *rsize)
{
struct open_disk *od = (struct open_disk *)devdata;
fpos_t seek;