Add channel flags to relay, remove global callback param.
relay should probably have had a flags param from the beginning; it
wasn't originally added because it wasn't originally needed - it
probably would have helped avoided some of the callback contortions
that were added due to a lack of flags. This adds them and does a
small amount of low-hanging cleanup, and is also in preparation for
some new flags in future patches.
Signed-off-by: Tom Zanussi <zanussi@comcast.net>
---
block/blktrace.c | 5 ++---
include/linux/relay.h | 21 +++++++++++----------
kernel/relay.c | 20 ++++++++++----------
virt/kvm/kvm_trace.c | 9 ++++-----
4 files changed, 27 insertions(+), 28 deletions(-)
diff --git a/block/blktrace.c b/block/blktrace.c
index eb9651c..150c5f7 100644
--- a/block/blktrace.c
+++ b/block/blktrace.c
@@ -356,8 +356,7 @@ static int blk_remove_buf_file_callback(struct dentry *dentry)
static struct dentry *blk_create_buf_file_callback(const char *filename,
struct dentry *parent,
int mode,
- struct rchan_buf *buf,
- int *is_global)
+ struct rchan_buf *buf)
{
return debugfs_create_file(filename, mode, parent, buf,
&relay_file_operations);
@@ -424,7 +423,7 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
goto err;
bt->rchan = relay_open("trace", dir, buts->buf_size,
- buts->buf_nr, &blk_relay_callbacks, bt);
+ buts->buf_nr, &blk_relay_callbacks, bt, 0UL);
if (!bt->rchan)
goto err;
diff --git a/include/linux/relay.h b/include/linux/relay.h
index 52e4d61..18fd269 100644
--- a/include/linux/relay.h
+++ b/include/linux/relay.h
@@ -25,7 +25,13 @@
/*
* Tracks changes to rchan/rchan_buf structs
*/
-#define RELAYFS_CHANNEL_VERSION 7
+#define RELAYFS_CHANNEL_VERSION 8
+
+/*
+ * relay channel flags
+ */
+#define RCHAN_MODE_OVERWRITE 0x00000001 /* 'flight' mode */
+#define RCHAN_GLOBAL_BUFFER 0x00000002 /* not using per-cpu */
...