summaryrefslogtreecommitdiffstats
path: root/sys/boot/arc
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-08-04 05:25:36 +0000
committerjhb <jhb@FreeBSD.org>2000-08-04 05:25:36 +0000
commitb9066bd4b2a7100f02b8c49223b25cab6672b3f9 (patch)
tree55a1479ff72a8694b59121fe181ba879d5679d11 /sys/boot/arc
parent0923c0673cce88b292150cd444c23f37f20a2af8 (diff)
downloadFreeBSD-src-b9066bd4b2a7100f02b8c49223b25cab6672b3f9.zip
FreeBSD-src-b9066bd4b2a7100f02b8c49223b25cab6672b3f9.tar.gz
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.
Diffstat (limited to 'sys/boot/arc')
-rw-r--r--sys/boot/arc/lib/arcdisk.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/sys/boot/arc/lib/arcdisk.c b/sys/boot/arc/lib/arcdisk.c
index 4b5e2cb..116c07c 100644
--- a/sys/boot/arc/lib/arcdisk.c
+++ b/sys/boot/arc/lib/arcdisk.c
@@ -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;
OpenPOWER on IntegriCloud