Lines Matching refs:bs
6 static int raw_open(BlockDriverState *bs, int flags)
8 bs->sg = bs->file->sg;
15 static int check_for_block_signature(BlockDriverState *bs, const uint8_t *buf)
35 static int check_write_unsafe(BlockDriverState *bs, int64_t sector_num,
40 if (!bs->probed) {
45 return check_for_block_signature(bs, buf);
51 static int raw_read(BlockDriverState *bs, int64_t sector_num,
54 return bdrv_read(bs->file, sector_num, buf, nb_sectors);
57 static int raw_write_scrubbed_bootsect(BlockDriverState *bs,
66 return bdrv_write(bs->file, 0, bootsect, 1);
69 static int raw_write(BlockDriverState *bs, int64_t sector_num,
72 if (check_write_unsafe(bs, sector_num, buf, nb_sectors)) {
75 ret = raw_write_scrubbed_bootsect(bs, buf);
80 ret = bdrv_write(bs->file, 1, buf + 512, nb_sectors - 1);
88 return bdrv_write(bs->file, sector_num, buf, nb_sectors);
91 static BlockDriverAIOCB *raw_aio_readv(BlockDriverState *bs,
95 return bdrv_aio_readv(bs->file, sector_num, qiov, nb_sectors, cb, opaque);
119 static BlockDriverAIOCB *raw_aio_writev(BlockDriverState *bs,
138 if (check_write_unsafe(bs, sector_num, first_buf, nb_sectors)) {
143 ret = raw_write_scrubbed_bootsect(bs, first_buf);
161 return bdrv_aio_writev(bs->file, sector_num + 1, &b->qiov,
165 return bdrv_aio_writev(bs->file, sector_num, qiov, nb_sectors, cb, opaque);
168 static void raw_close(BlockDriverState *bs)
172 static void raw_flush(BlockDriverState *bs)
174 bdrv_flush(bs->file);
177 static BlockDriverAIOCB *raw_aio_flush(BlockDriverState *bs,
180 return bdrv_aio_flush(bs->file, cb, opaque);
183 static int64_t raw_getlength(BlockDriverState *bs)
185 return bdrv_getlength(bs->file);
188 static int raw_truncate(BlockDriverState *bs, int64_t offset)
190 return bdrv_truncate(bs->file, offset);
198 static int raw_is_inserted(BlockDriverState *bs)
200 return bdrv_is_inserted(bs->file);
203 static int raw_eject(BlockDriverState *bs, int eject_flag)
205 return bdrv_eject(bs->file, eject_flag);
208 static int raw_set_locked(BlockDriverState *bs, int locked)
210 bdrv_set_locked(bs->file, locked);
214 static int raw_ioctl(BlockDriverState *bs, unsigned long int req, void *buf)
216 return bdrv_ioctl(bs->file, req, buf);
219 static BlockDriverAIOCB *raw_aio_ioctl(BlockDriverState *bs,
223 return bdrv_aio_ioctl(bs->file, req, buf, cb, opaque);
240 static int raw_has_zero_init(BlockDriverState *bs)
242 return bdrv_has_zero_init(bs->file);