diff options
author | Ned Bass <[email protected]> | 2010-07-01 10:12:57 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2010-07-01 10:59:46 -0700 |
commit | 1a73940d39f07332921a7f78eaca9bd9266c5c7a (patch) | |
tree | 30d7040f2d531ba06ea938fc22cedfa5f526e174 | |
parent | f0d8bb26b492dca0da1faff50b097b1665143bf4 (diff) |
Initialize the /dev/splatctl device buffer
On open() and initialize the buffer with the SPL version string. The
user space splat utility expects to find the SPL version string when
it opens and reads from /dev/splatctl.
Signed-off-by: Brian Behlendorf <[email protected]>
-rw-r--r-- | module/spl/spl-generic.c | 1 | ||||
-rw-r--r-- | module/splat/splat-ctl.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c index d5c1523e1..956be6882 100644 --- a/module/spl/spl-generic.c +++ b/module/spl/spl-generic.c @@ -47,6 +47,7 @@ #define DEBUG_SUBSYSTEM S_GENERIC char spl_version[16] = "SPL v" SPL_META_VERSION; +EXPORT_SYMBOL(spl_version); long spl_hostid = 0; EXPORT_SYMBOL(spl_hostid); diff --git a/module/splat/splat-ctl.c b/module/splat/splat-ctl.c index 09f084710..ba68de212 100644 --- a/module/splat/splat-ctl.c +++ b/module/splat/splat-ctl.c @@ -70,11 +70,14 @@ splat_open(struct inode *inode, struct file *file) kfree(info); return -ENOMEM; } + memset(info->info_buffer, 0, info->info_size); info->info_head = info->info_buffer; file->private_data = (void *)info; - return 0; + splat_print(file, "%s\n", spl_version); + + return 0; } static int |