• Guillaume Nault's avatar
    netns: Remove __peernet2id_alloc() · 49052941
    Guillaume Nault authored
    __peernet2id_alloc() was used for both plain lookups and for netns ID
    allocations (depending the value of '*alloc'). Let's separate lookups
    from allocations instead. That is, integrate the lookup code into
    __peernet2id() and make peernet2id_alloc() responsible for allocating
    new netns IDs when necessary.
    
    This makes it clear that __peernet2id() doesn't modify the idr and
    prepares the code for lockless lookups.
    
    Also, mark the 'net' argument of __peernet2id() as 'const', since we're
    modifying this line.
    Signed-off-by: default avatarGuillaume Nault <gnault@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    49052941
net_namespace.c 32.4 KB