diff options
author | Dhaval Giani <dhaval@linux.vnet.ibm.com> | 2010-01-07 16:24:35 +0530 |
---|---|---|
committer | Dhaval Giani <dhaval@linux.vnet.ibm.com> | 2010-01-07 21:09:08 +0530 |
commit | 99ccdf671e9df5b13f646e1487393d562aa7fa62 (patch) | |
tree | 0e27f0b05ddcbb157dd48e2cfa24485dd1ad25b2 /src/libcgroup-internal.h | |
parent | e1cc4cb97e00a1878541cc78bc3e5103a266da2e (diff) | |
download | libcg-99ccdf671e9df5b13f646e1487393d562aa7fa62.tar.gz libcg-99ccdf671e9df5b13f646e1487393d562aa7fa62.tar.xz libcg-99ccdf671e9df5b13f646e1487393d562aa7fa62.zip |
libcgroup: Setup the namespace datastructures
This patch handles the validation of the newer configuration files.
Some of the rules to be followed
1. We cannot have more controllers in the namespcae section than
already mounted.
2. If more than one controller are mounted at the same point, then
they will have the same namespace. In case it is not explicitly
mentioned, the subsystems at the mount point will be set to the
same namespace. This does not mean that controllers mounted at different
points need to have the same namespace.
Changes from v4:
1. Changed a variable name from mount to mount_path
2. Added more comments
Changes from v3:
1. Removed most of the strdups
2. Fixed return values for errors
Changes from v2:
1. mount and namespace keyword cannot come in the same file.
Changes from v1:
1. Fix a bug where if a namespace was not defined, we were not exiting
2. Comment the validate namespace function
3. Make some of the variables more descriptive
4. Make namespace thread specific
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Diffstat (limited to 'src/libcgroup-internal.h')
-rw-r--r-- | src/libcgroup-internal.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libcgroup-internal.h b/src/libcgroup-internal.h index 81a7b98..b9ef442 100644 --- a/src/libcgroup-internal.h +++ b/src/libcgroup-internal.h @@ -22,6 +22,7 @@ __BEGIN_DECLS #include <fts.h> #include <libcgroup.h> #include <limits.h> +#include <pthread.h> #include <sys/stat.h> #include <sys/types.h> @@ -116,6 +117,17 @@ int cg_mkdir_p(const char *path); struct cgroup *create_cgroup_from_name_value_pairs(const char *name, struct control_value *name_value, int nv_number); +/* + * Main mounting structures + */ +struct cg_mount_table_s cg_mount_table[CG_CONTROLLER_MAX]; +static pthread_rwlock_t cg_mount_table_lock = PTHREAD_RWLOCK_INITIALIZER; + +/* + * config related structures + */ + +extern __thread char *cg_namespace_table[CG_CONTROLLER_MAX]; /* * config related API |