Replace reference of pid_ns with init pid in dev_ns

This closes Cellrox/devns-patches#4

The dev_ns is coupled to pid_ns at creation time. There is no need for
dev_ns to keep a reference to pid_ns. The reference was used to be able
to tell the pid of the respective init task for use by printk; instead,
store the pid itself in dev_ns.

Change-Id: I4997582ef7cf9cdde5b9919d80d06ea058b6b561
Signed-off-by: Oren Laadan <orenl@cellrox.com>
Reported-by: Jeremy Andrus <jchristian.andrus@gmail.com>
fb_devns: fix warning in prinkt statement

This closes Cellrox/devns-patches#2

Change-Id: I551dc0ac529e0775d28bf98438af2e942dd7107c
Signed-off-by: Oren Laadan <orenl@cellrox.com>
Reported-by: Jeremy Andrus <jchristian.andrus@gmail.com>
Fix compile errors when CONFIG_DEV_NS is unselected

This closes Cellrox/devns-patches#1

Change-Id: I8982c2ece0e83fe0893b4631f8451fdb6832891e
Signed-off-by: Oren Laadan <orenl@cellrox.com>
Reported-by: Jeremy Andrus <jchristian.andrus@gmail.com>
Fix kernel when CONFIG_DEV_NS is unselected

This closes Cellrox/devns-patches#3

When CONFIG_DEV_NS is not selected, then @init_dev_ns is NULL, and
therefore current_dev_ns() is NULL, too.

Remove dependency on @init_dev_ns by using suitable wrappers, such
as is_init_dev_ns(); and verify that current_dev_ns() isn't used
directly either.

(For now, we stay with init_dev_ns being NULL, to avoid the need to
compile dev_namespace.c when CONFIG_DEV_NS is unset).

Change-Id: Ia24927454b7c9757e8349180d1e23317638c3922
Signed-off-by: Oren Laadan <orenl@cellrox.com>
Reported-by: Jeremy Andrus <jchristian.andrus@gmail.com>
Minor nits and cleanups

Change-Id: I9e4b3b8002d01c19fe136e6b3d596221a35a78bc
Signed-off-by: Oren Laadan <orenl@cellrox.com>
fb_devns: don't try swapping zero size buffers

Don't attempts to memory swap zero sized framebuffers. Trying to do so
will cause access violations on memcpy and crash the kernel.

Change-Id: Iff3f87b8630fb92a4a49819ff58098eec8c2e5d7
Signed-off-by: Oren Laadan <orenl@cellrox.com>
Signed-off-by: Micha Kalfon <micha@cellrox.com>