~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to kernel/pid_namespace.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
#include <linux/err.h>
15
15
#include <linux/acct.h>
16
16
#include <linux/slab.h>
 
17
#include <linux/proc_fs.h>
17
18
 
18
19
#define BITS_PER_PAGE           (PAGE_SIZE*8)
19
20
 
72
73
{
73
74
        struct pid_namespace *ns;
74
75
        unsigned int level = parent_pid_ns->level + 1;
75
 
        int i;
 
76
        int i, err = -ENOMEM;
76
77
 
77
78
        ns = kmem_cache_zalloc(pid_ns_cachep, GFP_KERNEL);
78
79
        if (ns == NULL)
96
97
        for (i = 1; i < PIDMAP_ENTRIES; i++)
97
98
                atomic_set(&ns->pidmap[i].nr_free, BITS_PER_PAGE);
98
99
 
 
100
        err = pid_ns_prepare_proc(ns);
 
101
        if (err)
 
102
                goto out_put_parent_pid_ns;
 
103
 
99
104
        return ns;
100
105
 
 
106
out_put_parent_pid_ns:
 
107
        put_pid_ns(parent_pid_ns);
101
108
out_free_map:
102
109
        kfree(ns->pidmap[0].page);
103
110
out_free:
104
111
        kmem_cache_free(pid_ns_cachep, ns);
105
112
out:
106
 
        return ERR_PTR(-ENOMEM);
 
113
        return ERR_PTR(err);
107
114
}
108
115
 
109
116
static void destroy_pid_namespace(struct pid_namespace *ns)