mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
netns: Constify exported functions
Mark function parameters as 'const' where possible. Signed-off-by: Guillaume Nault <gnault@redhat.com> Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
37fe45ad12
commit
56f200c78c
@@ -347,9 +347,9 @@ static inline struct net *read_pnet(const possible_net_t *pnet)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int peernet2id_alloc(struct net *net, struct net *peer, gfp_t gfp);
|
int peernet2id_alloc(struct net *net, struct net *peer, gfp_t gfp);
|
||||||
int peernet2id(struct net *net, struct net *peer);
|
int peernet2id(const struct net *net, struct net *peer);
|
||||||
bool peernet_has_id(struct net *net, struct net *peer);
|
bool peernet_has_id(const struct net *net, struct net *peer);
|
||||||
struct net *get_net_ns_by_id(struct net *net, int id);
|
struct net *get_net_ns_by_id(const struct net *net, int id);
|
||||||
|
|
||||||
struct pernet_operations {
|
struct pernet_operations {
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
@@ -427,7 +427,7 @@ static inline void unregister_net_sysctl_table(struct ctl_table_header *header)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline int rt_genid_ipv4(struct net *net)
|
static inline int rt_genid_ipv4(const struct net *net)
|
||||||
{
|
{
|
||||||
return atomic_read(&net->ipv4.rt_genid);
|
return atomic_read(&net->ipv4.rt_genid);
|
||||||
}
|
}
|
||||||
@@ -459,7 +459,7 @@ static inline void rt_genid_bump_all(struct net *net)
|
|||||||
rt_genid_bump_ipv6(net);
|
rt_genid_bump_ipv6(net);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int fnhe_genid(struct net *net)
|
static inline int fnhe_genid(const struct net *net)
|
||||||
{
|
{
|
||||||
return atomic_read(&net->fnhe_genid);
|
return atomic_read(&net->fnhe_genid);
|
||||||
}
|
}
|
||||||
|
@@ -268,7 +268,7 @@ int peernet2id_alloc(struct net *net, struct net *peer, gfp_t gfp)
|
|||||||
EXPORT_SYMBOL_GPL(peernet2id_alloc);
|
EXPORT_SYMBOL_GPL(peernet2id_alloc);
|
||||||
|
|
||||||
/* This function returns, if assigned, the id of a peer netns. */
|
/* This function returns, if assigned, the id of a peer netns. */
|
||||||
int peernet2id(struct net *net, struct net *peer)
|
int peernet2id(const struct net *net, struct net *peer)
|
||||||
{
|
{
|
||||||
int id;
|
int id;
|
||||||
|
|
||||||
@@ -283,12 +283,12 @@ EXPORT_SYMBOL(peernet2id);
|
|||||||
/* This function returns true is the peer netns has an id assigned into the
|
/* This function returns true is the peer netns has an id assigned into the
|
||||||
* current netns.
|
* current netns.
|
||||||
*/
|
*/
|
||||||
bool peernet_has_id(struct net *net, struct net *peer)
|
bool peernet_has_id(const struct net *net, struct net *peer)
|
||||||
{
|
{
|
||||||
return peernet2id(net, peer) >= 0;
|
return peernet2id(net, peer) >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct net *get_net_ns_by_id(struct net *net, int id)
|
struct net *get_net_ns_by_id(const struct net *net, int id)
|
||||||
{
|
{
|
||||||
struct net *peer;
|
struct net *peer;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user