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 <behlendorf1@llnl.gov>
This commit is contained in:
parent
f0d8bb26b4
commit
1a73940d39
|
@ -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);
|
||||
|
|
|
@ -70,10 +70,13 @@ 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;
|
||||
|
||||
splat_print(file, "%s\n", spl_version);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue