]>
Commit | Line | Data |
---|---|---|
e1c66c6d LE |
1 | /* BlockDriver implementation for "raw" |
2 | * | |
3 | * Copyright (C) 2013, Red Hat, Inc. | |
4 | * | |
5 | * Author: | |
6 | * Laszlo Ersek <lersek@redhat.com> | |
7 | * | |
8 | * Permission is hereby granted, free of charge, to any person obtaining a copy | |
9 | * of this software and associated documentation files (the "Software"), to | |
10 | * deal in the Software without restriction, including without limitation the | |
11 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
12 | * sell copies of the Software, and to permit persons to whom the Software is | |
13 | * furnished to do so, subject to the following conditions: | |
14 | * | |
15 | * The above copyright notice and this permission notice shall be included in | |
16 | * all copies or substantial portions of the Software. | |
17 | * | |
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
23 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
24 | * IN THE SOFTWARE. | |
25 | */ | |
26 | ||
27 | #include "block/block_int.h" | |
28 | ||
29 | static TYPE raw_reopen_prepare(BlockDriverState *bs) | |
30 | { | |
31 | return bdrv_reopen_prepare(bs->file); | |
32 | } | |
33 | ||
34 | static TYPE raw_co_readv(BlockDriverState *bs) | |
35 | { | |
9eaafd90 | 36 | BLKDBG_EVENT(bs->file, BLKDBG_READ_AIO); |
e1c66c6d LE |
37 | return bdrv_co_readv(bs->file); |
38 | } | |
39 | ||
40 | static TYPE raw_co_writev(BlockDriverState *bs) | |
41 | { | |
9eaafd90 | 42 | BLKDBG_EVENT(bs->file, BLKDBG_WRITE_AIO); |
e1c66c6d LE |
43 | return bdrv_co_writev(bs->file); |
44 | } | |
45 | ||
46 | static TYPE raw_co_is_allocated(BlockDriverState *bs) | |
47 | { | |
48 | return bdrv_co_is_allocated(bs->file); | |
49 | } | |
50 | ||
51 | static TYPE raw_co_write_zeroes(BlockDriverState *bs) | |
52 | { | |
53 | return bdrv_co_write_zeroes(bs->file); | |
54 | } | |
55 | ||
56 | static TYPE raw_co_discard(BlockDriverState *bs) | |
57 | { | |
58 | return bdrv_co_discard(bs->file); | |
59 | } | |
60 | ||
61 | static TYPE raw_getlength(BlockDriverState *bs) | |
62 | { | |
63 | return bdrv_getlength(bs->file); | |
64 | } | |
65 | ||
66 | static TYPE raw_get_info(BlockDriverState *bs) | |
67 | { | |
68 | return bdrv_get_info(bs->file); | |
69 | } | |
70 | ||
71 | static TYPE raw_truncate(BlockDriverState *bs) | |
72 | { | |
73 | return bdrv_truncate(bs->file); | |
74 | } | |
75 | ||
76 | static TYPE raw_is_inserted(BlockDriverState *bs) | |
77 | { | |
78 | return bdrv_is_inserted(bs->file); | |
79 | } | |
80 | ||
81 | static TYPE raw_media_changed(BlockDriverState *bs) | |
82 | { | |
83 | return bdrv_media_changed(bs->file); | |
84 | } | |
85 | ||
86 | static TYPE raw_eject(BlockDriverState *bs) | |
87 | { | |
88 | return bdrv_eject(bs->file); | |
89 | } | |
90 | ||
91 | static TYPE raw_lock_medium(BlockDriverState *bs) | |
92 | { | |
93 | return bdrv_lock_medium(bs->file); | |
94 | } | |
95 | ||
96 | static TYPE raw_ioctl(BlockDriverState *bs) | |
97 | { | |
98 | return bdrv_ioctl(bs->file); | |
99 | } | |
100 | ||
101 | static TYPE raw_aio_ioctl(BlockDriverState *bs) | |
102 | { | |
103 | return bdrv_aio_ioctl(bs->file); | |
104 | } | |
105 | ||
106 | static TYPE raw_has_zero_init(BlockDriverState *bs) | |
107 | { | |
108 | return bdrv_has_zero_init(bs->file); | |
109 | } | |
110 |