[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 29/29] device/subrs.c: use io_req_t instead of struct buf
From: |
Marin Ramesa |
Subject: |
[PATCH 29/29] device/subrs.c: use io_req_t instead of struct buf |
Date: |
Mon, 9 Dec 2013 23:57:44 +0100 |
Struct buf is not defined. Use io_req_t instead of it.
* device/subrs.c (harderr) (bp): Change name to ior and use io_req_t as type
instead of (struct buf *).
(harderr) (minor): Use io_unit instead of b_dev.
(harderr): Use io_recnum instead of b_blkno.
(gateblk): Use io_req_t as return value instead of (struct buf *).
(brelse) (bp): Change name to ior and use io_req_t as type instead of (struct
buf *).
(brelse) (ior): Remove variable.
---
device/subrs.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/device/subrs.c b/device/subrs.c
index 0382bc6..0a7d690 100644
--- a/device/subrs.c
+++ b/device/subrs.c
@@ -40,15 +40,15 @@
/*
* Print out disk name and block number for hard disk errors.
*/
-void harderr(bp, cp)
- struct buf *bp;
+void harderr(ior, cp)
+ io_req_t ior;
char * cp;
{
printf("%s%d%c: hard error sn%d ",
cp,
- minor(bp->b_dev) >> 3,
- 'a' + (minor(bp->b_dev) & 0x7),
- bp->b_blkno);
+ minor(ior->io_unit) >> 3,
+ 'a' + (minor(ior->io_unit) & 0x7),
+ ior->io_recnum);
}
/*
@@ -103,7 +103,7 @@ void wakeup(channel)
thread_wakeup((event_t) channel);
}
-struct buf *
+io_req_t
geteblk(size)
int size;
{
@@ -128,11 +128,9 @@ geteblk(size)
return (ior);
}
-void brelse(bp)
- struct buf *bp;
+void brelse(ior)
+ io_req_t ior;
{
- io_req_t ior = bp;
-
(void) vm_deallocate(kernel_map,
(vm_offset_t) ior->io_data,
ior->io_alloc_size);
--
1.8.1.4
- [PATCH 22/29] device/kmsg.c (kmsgread): check if io_count is larger or equal to zero and cast it to vm_size_t, (continued)
- [PATCH 22/29] device/kmsg.c (kmsgread): check if io_count is larger or equal to zero and cast it to vm_size_t, Marin Ramesa, 2013/12/09
- [PATCH 23/29] device/kmsg.c (kmsgread, kmsg_read_done): cast arguments to memcpy(), Marin Ramesa, 2013/12/09
- [PATCH 24/29] device/kmsg.c (kmsg_read_done): check if amt is negative, Marin Ramesa, 2013/12/09
- [PATCH 25/29] device/net_io.c: remove forward declarations, Marin Ramesa, 2013/12/09
- [PATCH 26/29] device/net_io.c (net_getstat): check if addr_byte_count is negative, Marin Ramesa, 2013/12/09
- [PATCH 27/29] device/net_io.c (net_getstat): cast arguments to memcpy(), Marin Ramesa, 2013/12/09
- [PATCH 28/29] device/net_io.c (net_getstat): cast arguments to memset(), Marin Ramesa, 2013/12/09
- [PATCH 29/29] device/subrs.c: use io_req_t instead of struct buf,
Marin Ramesa <=