Re: [RFC][PATCH 1/2] Virtualization of UTS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 24 Mar 2006, Kirill Korotaev wrote:

> This patch introduces utsname namespace in system, which allows to have
> different utsnames on the host.
> Introduces config option CONFIG_UTS_NS and uts_namespace structure for this.
> 

Please include patches inline, so they can be quoted inline.

+#define system_utsname	(current->uts_ns->name)

This should be a static inline.

+struct uts_namespace *create_uts_ns(void)
+{
+	struct uts_namespace *ns;
+
+	ns = kmalloc(sizeof(struct uts_namespace), GFP_KERNEL);
+	if (ns == NULL)
+		return NULL;
+
+	memset(&ns->name, 0, sizeof(ns->name));
+	atomic_set(&ns->cnt, 1);
+	return ns;
+}

IMHO, it's better to do something like:

{
	foo = kmalloc();
	if (foo) {
		stuff;
		etc;
	}
	return foo;
}

I suggest you use kzalloc(), too.

Also, I think the API approach needs to be determined before the patches 
go into -mm, in case it impacts on the code.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux