Lines Matching refs:nc
202 struct nscookie *nc) in nsinfo__mountns_enter() argument
209 if (nc == NULL) in nsinfo__mountns_enter()
212 nc->oldns = -1; in nsinfo__mountns_enter()
213 nc->newns = -1; in nsinfo__mountns_enter()
236 nc->oldcwd = oldcwd; in nsinfo__mountns_enter()
237 nc->oldns = oldns; in nsinfo__mountns_enter()
238 nc->newns = newns; in nsinfo__mountns_enter()
249 void nsinfo__mountns_exit(struct nscookie *nc) in nsinfo__mountns_exit() argument
251 if (nc == NULL || nc->oldns == -1 || nc->newns == -1 || !nc->oldcwd) in nsinfo__mountns_exit()
254 setns(nc->oldns, CLONE_NEWNS); in nsinfo__mountns_exit()
256 if (nc->oldcwd) { in nsinfo__mountns_exit()
257 WARN_ON_ONCE(chdir(nc->oldcwd)); in nsinfo__mountns_exit()
258 zfree(&nc->oldcwd); in nsinfo__mountns_exit()
261 if (nc->oldns > -1) { in nsinfo__mountns_exit()
262 close(nc->oldns); in nsinfo__mountns_exit()
263 nc->oldns = -1; in nsinfo__mountns_exit()
266 if (nc->newns > -1) { in nsinfo__mountns_exit()
267 close(nc->newns); in nsinfo__mountns_exit()
268 nc->newns = -1; in nsinfo__mountns_exit()