Lines Matching refs:nc
246 struct nscookie *nc) in nsinfo__mountns_enter() argument
253 if (nc == NULL) in nsinfo__mountns_enter()
256 nc->oldns = -1; in nsinfo__mountns_enter()
257 nc->newns = -1; in nsinfo__mountns_enter()
280 nc->oldcwd = oldcwd; in nsinfo__mountns_enter()
281 nc->oldns = oldns; in nsinfo__mountns_enter()
282 nc->newns = newns; in nsinfo__mountns_enter()
293 void nsinfo__mountns_exit(struct nscookie *nc) in nsinfo__mountns_exit() argument
295 if (nc == NULL || nc->oldns == -1 || nc->newns == -1 || !nc->oldcwd) in nsinfo__mountns_exit()
298 setns(nc->oldns, CLONE_NEWNS); in nsinfo__mountns_exit()
300 if (nc->oldcwd) { in nsinfo__mountns_exit()
301 WARN_ON_ONCE(chdir(nc->oldcwd)); in nsinfo__mountns_exit()
302 zfree(&nc->oldcwd); in nsinfo__mountns_exit()
305 if (nc->oldns > -1) { in nsinfo__mountns_exit()
306 close(nc->oldns); in nsinfo__mountns_exit()
307 nc->oldns = -1; in nsinfo__mountns_exit()
310 if (nc->newns > -1) { in nsinfo__mountns_exit()
311 close(nc->newns); in nsinfo__mountns_exit()
312 nc->newns = -1; in nsinfo__mountns_exit()