]> git.proxmox.com Git - mirror_spl.git/commitdiff
Initialize the /dev/splatctl device buffer
authorNed Bass <bass6@llnl.gov>
Thu, 1 Jul 2010 17:12:57 +0000 (10:12 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 1 Jul 2010 17:59:46 +0000 (10:59 -0700)
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 <behlendorf1@llnl.gov>
module/spl/spl-generic.c
module/splat/splat-ctl.c

index d5c1523e1a2d45d7cbb47e502bc1dd21e3e044b6..956be688223f2774e2462bc0fc5fb79855bee1f5 100644 (file)
@@ -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);
index 09f0847109e5bde571cf272da0f7ff7585b1d86b..ba68de212269b0a5d504496a89b2d106e0e0f727 100644 (file)
@@ -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