Skip to content
Snippets Groups Projects
Commit d195a180 authored by Federico Vaga's avatar Federico Vaga Committed by Alessandro Rubini
Browse files

headers: move zio_block from zio-buffer.h to zio.h


Signed-off-by: default avatarFederico Vaga <federico.vaga@gmail.com>
Acked-by: default avatarAlessandro Rubini <rubini@gnudd.com>
parent 73e67d38
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@
#include <linux/spinlock.h>
#include <linux/wait.h>
#include <linux/zio.h>
#include <linux/zio-user.h>
#define ZIO_DEFAULT_BUFFER "kmalloc" /* For devices with no own buffer type */
......@@ -87,24 +88,6 @@ enum zio_bi_flag_mask {
};
/* The block is the basic data item being transferred */
struct zio_block {
unsigned long ctrl_flags;
void *data;
size_t datalen;
size_t uoff;
};
/*
* We must know whether the ctrl block has been filled/read or not: "cdone"
* No "set_ctrl" or "clr_cdone" are needed, as cdone starts 0 and is only set
*/
#define zio_get_ctrl(block) ((struct zio_control *)((block)->ctrl_flags & ~1))
#define zio_set_ctrl(block, ctrl) ((block)->ctrl_flags = (unsigned long)(ctrl))
#define zio_is_cdone(block) ((block)->ctrl_flags & 1)
#define zio_set_cdone(block) ((block)->ctrl_flags |= 1)
/*
* Each buffer implementation must provide the following methods, because
* internal management of individual data instances is left to each of them.
......
......@@ -298,6 +298,24 @@ static inline unsigned int zio_get_n_chan_enabled(struct zio_cset *cset) {
char *_name; \
module_param_named(buffer, _name, charp, 0444)
/* The block is the basic data item being transferred */
struct zio_block {
unsigned long ctrl_flags;
void *data;
size_t datalen;
size_t uoff;
};
/*
* We must know whether the ctrl block has been filled/read or not: "cdone"
* No "set_ctrl" or "clr_cdone" are needed, as cdone starts 0 and is only set
*/
#define zio_get_ctrl(block) ((struct zio_control *)((block)->ctrl_flags & ~1))
#define zio_set_ctrl(block, ctrl) ((block)->ctrl_flags = (unsigned long)(ctrl))
#define zio_is_cdone(block) ((block)->ctrl_flags & 1)
#define zio_set_cdone(block) ((block)->ctrl_flags |= 1)
/*
* Misc library-like code, from zio-misc.c
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment