|
iPXE
|
Block device translator. More...
#include <stdlib.h>#include <string.h>#include <errno.h>#include <assert.h>#include <ipxe/iobuf.h>#include <ipxe/xfer.h>#include <ipxe/blockdev.h>#include <ipxe/blocktrans.h>Go to the source code of this file.
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| static void | blktrans_close (struct block_translator *blktrans, int rc) |
| Close block device translator. More... | |
| static int | blktrans_deliver (struct block_translator *blktrans, struct io_buffer *iobuf, struct xfer_metadata *meta) |
| Deliver data. More... | |
| static struct xfer_buffer * | blktrans_buffer (struct block_translator *blktrans) |
| Get underlying data transfer buffer. More... | |
| int | block_translate (struct interface *block, void *buffer, size_t size) |
| Insert block device translator. More... | |
Variables | |
| static struct interface_operation | blktrans_block_operations [] |
| Block device translator block device interface operations. More... | |
| static struct interface_descriptor | blktrans_block_desc |
| Block device translator block device interface descriptor. More... | |
| static struct interface_operation | blktrans_xfer_operations [] |
| Block device translator data transfer interface operations. More... | |
| static struct interface_descriptor | blktrans_xfer_desc |
| Block device translator data transfer interface descriptor. More... | |
Block device translator.
Definition in file blocktrans.c.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Close block device translator.
| blktrans | Block device translator |
| rc | Reason for close |
Definition at line 48 of file blocktrans.c.
References block_device_capacity::blksize, block_translator::blksize, block_translator::block, block_capacity(), block_device_capacity::blocks, intf_shutdown(), xfer_buffer::len, block_device_capacity::max_count, rc, block_translator::xfer, and block_translator::xferbuf.
Referenced by blktrans_deliver().
|
static |
Deliver data.
| blktrans | Block device translator |
| iobuf | I/O buffer |
| meta | Data transfer metadata |
| rc | Return status code |
Definition at line 77 of file blocktrans.c.
References blktrans_close(), DBGC, iob_disown, meta, rc, strerror(), block_translator::xferbuf, and xferbuf_deliver().
|
static |
Get underlying data transfer buffer.
| blktrans | Block device translator |
| xferbuf | Data transfer buffer |
Definition at line 104 of file blocktrans.c.
References block_translator::xferbuf.
Insert block device translator.
| block | Block device interface |
| buffer | Data buffer (or NULL) |
| size | Length of data buffer, or block size |
| rc | Return status code |
Definition at line 139 of file blocktrans.c.
References block_translator::blksize, blktrans_block_desc, blktrans_xfer_desc, block, block_translator::block, buffer, DBGC2, ENOMEM, intf_init(), intf_insert(), NULL, rc, ref_init, ref_put, block_translator::refcnt, size, block_translator::xfer, block_translator::xferbuf, xferbuf_fixed_init(), xferbuf_void_init(), and zalloc().
Referenced by http_block_read(), and http_block_read_capacity().
|
static |
Block device translator block device interface operations.
Definition at line 110 of file blocktrans.c.
|
static |
Block device translator block device interface descriptor.
Definition at line 115 of file blocktrans.c.
Referenced by block_translate().
|
static |
Block device translator data transfer interface operations.
Definition at line 120 of file blocktrans.c.
|
static |
Block device translator data transfer interface descriptor.
Definition at line 127 of file blocktrans.c.
Referenced by block_translate().
1.8.15