#ifndef __KERN_FS_IOBUF_H__
#define __KERN_FS_IOBUF_H__
#include <defs.h>
struct iobuf {
void *io_base;
off_t io_offset;
size_t io_len;
size_t io_resid;
};
#define iobuf_used(iob) ((size_t)((iob)->io_len - (iob)->io_resid))
struct iobuf *iobuf_init(struct iobuf *iob, void *base, size_t len, off_t offset);
int iobuf_move(struct iobuf *iob, void *data, size_t len, bool m2b, size_t *copiedp);
int iobuf_move_zeros(struct iobuf *iob, size_t len, size_t *copiedp);
void iobuf_skip(struct iobuf *iob, size_t n);
#endif