add replicated directories for userspace usage

This commit is contained in:
Thomas Schoebel-Theuer 2012-03-06 15:01:54 +01:00 committed by Thomas Schoebel-Theuer
parent 3381fdd8d5
commit 00f7b9e55b
3 changed files with 40 additions and 1 deletions

View File

@ -457,7 +457,7 @@ EXPORT_SYMBOL_GPL(mars_recv_raw);
/* TODO: make this bytesex-aware
*/
#define MARS_NET_MAGIC 0x63f0A2ec6148f48cll
#define MARS_NET_MAGIC 0x63f0A2ec6148f48dll
#define MAX_FIELD_LEN 32

View File

@ -2972,6 +2972,9 @@ static int check_deleted(void *buf, struct mars_dent *dent)
enum {
// root element: this must have index 0
CL_ROOT,
// global userspace
CL_GLOBAL_USERSPACE,
CL_GLOBAL_USERSPACE_ITEMS,
// global todos
CL_GLOBAL_TODO,
CL_GLOBAL_TODO_DELETE,
@ -2984,6 +2987,8 @@ enum {
CL_REST_SPACE,
// resource definitions
CL_RESOURCE,
CL_RESOURCE_USERSPACE,
CL_RESOURCE_USERSPACE_ITEMS,
CL_DEFAULTS0,
CL_DEFAULTS,
CL_DEFAULTS_ITEMS0,
@ -3014,6 +3019,22 @@ static const struct light_class light_classes[] = {
[CL_ROOT] = {
},
/* Subdirectory for global userspace items...
*/
[CL_GLOBAL_USERSPACE] = {
.cl_name = "userspace",
.cl_len = 9,
.cl_type = 'd',
.cl_hostcontext = false,
.cl_father = CL_ROOT,
},
[CL_GLOBAL_USERSPACE_ITEMS] = {
.cl_name = "",
.cl_len = 0, // catch any
.cl_type = 'l',
.cl_father = CL_GLOBAL_USERSPACE,
},
/* Subdirectory for global controlling items...
*/
[CL_GLOBAL_TODO] = {
@ -3098,6 +3119,22 @@ static const struct light_class light_classes[] = {
.cl_father = CL_ROOT,
},
/* Subdirectory for resource-specific userspace items...
*/
[CL_RESOURCE_USERSPACE] = {
.cl_name = "userspace",
.cl_len = 9,
.cl_type = 'd',
.cl_hostcontext = false,
.cl_father = CL_RESOURCE,
},
[CL_RESOURCE_USERSPACE_ITEMS] = {
.cl_name = "",
.cl_len = 0, // catch any
.cl_type = 'l',
.cl_father = CL_RESOURCE_USERSPACE,
},
/* Subdirectory for defaults...
*/
[CL_DEFAULTS0] = {

View File

@ -355,6 +355,7 @@ sub _create_cluster {
my ($cmd) = @_;
system("mkdir $mars") unless -d $mars;
system("mkdir $mars/ips") unless -d "$mars/ips";
system("mkdir $mars/userspace") unless -d "$mars/userspace";
system("mkdir $mars/defaults") unless -d "$mars/defaults";
system("mkdir $mars/defaults-$host") unless -d "$mars/defaults-$host";
system("mkdir $mars/todo-global") unless -d "$mars/todo-global";
@ -462,6 +463,7 @@ sub create_res {
symlink($appear, "$tmp/device-$host") or die "cannot create symlink for local device appearance\n";
}
mkdir("$tmp/userspace") unless -d "$tmp/userspace";
mkdir("$tmp/defaults") unless -d "$tmp/defaults";
mkdir("$tmp/defaults-$host");
mkdir("$tmp/actual-$host");