| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: xbd_xenbus.c,v 1.117 2020/04/17 10:32:19 jdolecek Exp $ */ | | 1 | /* $NetBSD: xbd_xenbus.c,v 1.118 2020/04/17 10:35:06 jdolecek Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2006 Manuel Bouyer. | | 4 | * Copyright (c) 2006 Manuel Bouyer. |
5 | * | | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions | | 7 | * modification, are permitted provided that the following conditions |
8 | * are met: | | 8 | * are met: |
9 | * 1. Redistributions of source code must retain the above copyright | | 9 | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * 2. Redistributions in binary form must reproduce the above copyright | | 11 | * 2. Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | | 13 | * documentation and/or other materials provided with the distribution. |
14 | * | | 14 | * |
| @@ -40,27 +40,27 @@ | | | @@ -40,27 +40,27 @@ |
40 | * - initiate request: xbdread/write/open/ioctl/.. | | 40 | * - initiate request: xbdread/write/open/ioctl/.. |
41 | * - depending on operation, it is handled directly by disk(9) subsystem or | | 41 | * - depending on operation, it is handled directly by disk(9) subsystem or |
42 | * goes through physio(9) first. | | 42 | * goes through physio(9) first. |
43 | * - the request is ultimately processed by xbd_diskstart() that prepares the | | 43 | * - the request is ultimately processed by xbd_diskstart() that prepares the |
44 | * xbd requests, post them in the ring I/O queue, then signal the backend. | | 44 | * xbd requests, post them in the ring I/O queue, then signal the backend. |
45 | * | | 45 | * |
46 | * When a response is available in the queue, the backend signals the frontend | | 46 | * When a response is available in the queue, the backend signals the frontend |
47 | * via its event channel. This triggers xbd_handler(), which will link back | | 47 | * via its event channel. This triggers xbd_handler(), which will link back |
48 | * the response to its request through the request ID, and mark the I/O as | | 48 | * the response to its request through the request ID, and mark the I/O as |
49 | * completed. | | 49 | * completed. |
50 | */ | | 50 | */ |
51 | | | 51 | |
52 | #include <sys/cdefs.h> | | 52 | #include <sys/cdefs.h> |
53 | __KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.117 2020/04/17 10:32:19 jdolecek Exp $"); | | 53 | __KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.118 2020/04/17 10:35:06 jdolecek Exp $"); |
54 | | | 54 | |
55 | #include "opt_xen.h" | | 55 | #include "opt_xen.h" |
56 | | | 56 | |
57 | | | 57 | |
58 | #include <sys/param.h> | | 58 | #include <sys/param.h> |
59 | #include <sys/buf.h> | | 59 | #include <sys/buf.h> |
60 | #include <sys/bufq.h> | | 60 | #include <sys/bufq.h> |
61 | #include <sys/device.h> | | 61 | #include <sys/device.h> |
62 | #include <sys/disk.h> | | 62 | #include <sys/disk.h> |
63 | #include <sys/disklabel.h> | | 63 | #include <sys/disklabel.h> |
64 | #include <sys/conf.h> | | 64 | #include <sys/conf.h> |
65 | #include <sys/fcntl.h> | | 65 | #include <sys/fcntl.h> |
66 | #include <sys/kernel.h> | | 66 | #include <sys/kernel.h> |
| @@ -240,27 +240,27 @@ const struct cdevsw xbd_cdevsw = { | | | @@ -240,27 +240,27 @@ const struct cdevsw xbd_cdevsw = { |
240 | .d_write = xbdwrite, | | 240 | .d_write = xbdwrite, |
241 | .d_ioctl = xbdioctl, | | 241 | .d_ioctl = xbdioctl, |
242 | .d_stop = nostop, | | 242 | .d_stop = nostop, |
243 | .d_tty = notty, | | 243 | .d_tty = notty, |
244 | .d_poll = nopoll, | | 244 | .d_poll = nopoll, |
245 | .d_mmap = nommap, | | 245 | .d_mmap = nommap, |
246 | .d_kqfilter = nokqfilter, | | 246 | .d_kqfilter = nokqfilter, |
247 | .d_discard = nodiscard, | | 247 | .d_discard = nodiscard, |
248 | .d_flag = D_DISK | D_MPSAFE | | 248 | .d_flag = D_DISK | D_MPSAFE |
249 | }; | | 249 | }; |
250 | | | 250 | |
251 | extern struct cfdriver xbd_cd; | | 251 | extern struct cfdriver xbd_cd; |
252 | | | 252 | |
253 | static struct dkdriver xbddkdriver = { | | 253 | static const struct dkdriver xbddkdriver = { |
254 | .d_strategy = xbdstrategy, | | 254 | .d_strategy = xbdstrategy, |
255 | .d_minphys = xbdminphys, | | 255 | .d_minphys = xbdminphys, |
256 | .d_open = xbdopen, | | 256 | .d_open = xbdopen, |
257 | .d_close = xbdclose, | | 257 | .d_close = xbdclose, |
258 | .d_diskstart = xbd_diskstart, | | 258 | .d_diskstart = xbd_diskstart, |
259 | .d_iosize = xbd_iosize, | | 259 | .d_iosize = xbd_iosize, |
260 | }; | | 260 | }; |
261 | | | 261 | |
262 | static int | | 262 | static int |
263 | xbd_xenbus_match(device_t parent, cfdata_t match, void *aux) | | 263 | xbd_xenbus_match(device_t parent, cfdata_t match, void *aux) |
264 | { | | 264 | { |
265 | struct xenbusdev_attach_args *xa = aux; | | 265 | struct xenbusdev_attach_args *xa = aux; |
266 | | | 266 | |