• Home
  • Raw
  • Download

Lines Matching refs:id

85 static int net_assign_generic(struct net *net, unsigned int id, void *data)  in net_assign_generic()  argument
89 BUG_ON(id < MIN_PERNET_OPS_ID); in net_assign_generic()
93 if (old_ng->s.len > id) { in net_assign_generic()
94 old_ng->ptr[id] = data; in net_assign_generic()
115 ng->ptr[id] = data; in net_assign_generic()
128 if (ops->id && ops->size) { in ops_init()
133 err = net_assign_generic(net, *ops->id, data); in ops_init()
143 if (ops->id && ops->size) { in ops_init()
146 ng->ptr[*ops->id] = NULL; in ops_init()
185 if (ops->size && ops->id) { in ops_free_list()
187 kfree(net_generic(net, *ops->id)); in ops_free_list()
210 static int net_eq_idr(int id, void *net, void *peer) in net_eq_idr() argument
213 return id ? : NET_ID_ZERO; in net_eq_idr()
220 int id = idr_for_each(&net->netns_ids, net_eq_idr, peer); in __peernet2id() local
223 if (id == NET_ID_ZERO) in __peernet2id()
225 if (id > 0) in __peernet2id()
226 return id; in __peernet2id()
231 static void rtnl_net_notifyid(struct net *net, int cmd, int id, u32 portid,
238 int id; in peernet2id_alloc() local
244 id = __peernet2id(net, peer); in peernet2id_alloc()
245 if (id >= 0) { in peernet2id_alloc()
247 return id; in peernet2id_alloc()
260 id = alloc_netid(net, peer, -1); in peernet2id_alloc()
264 if (id < 0) in peernet2id_alloc()
267 rtnl_net_notifyid(net, RTM_NEWNSID, id, 0, NULL, gfp); in peernet2id_alloc()
269 return id; in peernet2id_alloc()
276 int id; in peernet2id() local
279 id = __peernet2id(net, peer); in peernet2id()
282 return id; in peernet2id()
294 struct net *get_net_ns_by_id(const struct net *net, int id) in get_net_ns_by_id() argument
298 if (id < 0) in get_net_ns_by_id()
302 peer = idr_find(&net->netns_ids, id); in get_net_ns_by_id()
549 int id; in unhash_nsid() local
552 id = __peernet2id(tmp, net); in unhash_nsid()
553 if (id >= 0) in unhash_nsid()
554 idr_remove(&tmp->netns_ids, id); in unhash_nsid()
556 if (id >= 0) in unhash_nsid()
557 rtnl_net_notifyid(tmp, RTM_DELNSID, id, 0, NULL, in unhash_nsid()
939 int id = nla_get_s32(tb[NETNSA_TARGET_NSID]); in rtnl_net_getid() local
941 target = rtnl_get_net_ns_capable(NETLINK_CB(skb).sk, id); in rtnl_net_getid()
986 static int rtnl_net_dumpid_one(int id, void *peer, void *data) in rtnl_net_dumpid_one() argument
994 net_cb->fillargs.nsid = id; in rtnl_net_dumpid_one()
1081 static void rtnl_net_notifyid(struct net *net, int cmd, int id, u32 portid, in rtnl_net_notifyid() argument
1088 .nsid = id, in rtnl_net_notifyid()
1168 if (ops->init || (ops->id && ops->size)) { in __register_pernet_operations()
1234 if (ops->id) { in register_pernet_operations()
1239 *ops->id = error; in register_pernet_operations()
1244 WRITE_ONCE(max_gen_ptrs, max(max_gen_ptrs, *ops->id + 1)); in register_pernet_operations()
1249 if (ops->id) in register_pernet_operations()
1250 ida_free(&net_generic_ids, *ops->id); in register_pernet_operations()
1260 if (ops->id) in unregister_pernet_operations()
1261 ida_free(&net_generic_ids, *ops->id); in unregister_pernet_operations()