diff options
author | Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> | 2008-07-25 22:45:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-26 15:00:04 -0400 |
commit | 20d8b67c06fa5e74f44e80b0a0fd68c8327f7c6a (patch) | |
tree | 7162455643e7ce45e253033bf648bf41d9796dd9 /include/linux/relay.h | |
parent | 7babe8db99d305340cf4828ce1f5a1481d5622ef (diff) |
relay: add buffer-only channels; useful for early logging
Allows one to create and use a channel with no associated files. Files
can be initialized later. This is useful in scenarios such as logging in
early code, before VFS is up. Therefore, such channels can be created and
used as soon as kmem_cache_init() completed.
This is needed by kmemtrace to do tracing in early kernel code.
[kosaki.motohiro@jp.fujitsu.com: build fix]
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Cc: Tom Zanussi <tzanussi@gmail.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/relay.h')
-rw-r--r-- | include/linux/relay.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/relay.h b/include/linux/relay.h index 6cd8c4425fc..953fc055e87 100644 --- a/include/linux/relay.h +++ b/include/linux/relay.h | |||
@@ -48,6 +48,7 @@ struct rchan_buf | |||
48 | size_t *padding; /* padding counts per sub-buffer */ | 48 | size_t *padding; /* padding counts per sub-buffer */ |
49 | size_t prev_padding; /* temporary variable */ | 49 | size_t prev_padding; /* temporary variable */ |
50 | size_t bytes_consumed; /* bytes consumed in cur read subbuf */ | 50 | size_t bytes_consumed; /* bytes consumed in cur read subbuf */ |
51 | size_t early_bytes; /* bytes consumed before VFS inited */ | ||
51 | unsigned int cpu; /* this buf's cpu */ | 52 | unsigned int cpu; /* this buf's cpu */ |
52 | } ____cacheline_aligned; | 53 | } ____cacheline_aligned; |
53 | 54 | ||
@@ -68,6 +69,7 @@ struct rchan | |||
68 | int is_global; /* One global buffer ? */ | 69 | int is_global; /* One global buffer ? */ |
69 | struct list_head list; /* for channel list */ | 70 | struct list_head list; /* for channel list */ |
70 | struct dentry *parent; /* parent dentry passed to open */ | 71 | struct dentry *parent; /* parent dentry passed to open */ |
72 | int has_base_filename; /* has a filename associated? */ | ||
71 | char base_filename[NAME_MAX]; /* saved base filename */ | 73 | char base_filename[NAME_MAX]; /* saved base filename */ |
72 | }; | 74 | }; |
73 | 75 | ||
@@ -169,6 +171,9 @@ struct rchan *relay_open(const char *base_filename, | |||
169 | size_t n_subbufs, | 171 | size_t n_subbufs, |
170 | struct rchan_callbacks *cb, | 172 | struct rchan_callbacks *cb, |
171 | void *private_data); | 173 | void *private_data); |
174 | extern int relay_late_setup_files(struct rchan *chan, | ||
175 | const char *base_filename, | ||
176 | struct dentry *parent); | ||
172 | extern void relay_close(struct rchan *chan); | 177 | extern void relay_close(struct rchan *chan); |
173 | extern void relay_flush(struct rchan *chan); | 178 | extern void relay_flush(struct rchan *chan); |
174 | extern void relay_subbufs_consumed(struct rchan *chan, | 179 | extern void relay_subbufs_consumed(struct rchan *chan, |