Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf namespaces: Use the need_setns() accessors instead of accessing ->need_setns directly

This uses pre-existing accessors and reduces the use of
RC_CHK_ACCESS(nsi).

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+3 -3
+3 -3
tools/perf/util/namespaces.c
··· 165 165 RC_CHK_ACCESS(nsi)->pid = pid; 166 166 RC_CHK_ACCESS(nsi)->tgid = pid; 167 167 RC_CHK_ACCESS(nsi)->nstgid = pid; 168 - RC_CHK_ACCESS(nsi)->need_setns = false; 168 + nsinfo__clear_need_setns(nsi); 169 169 RC_CHK_ACCESS(nsi)->in_pidns = false; 170 170 /* Init may fail if the process exits while we're trying to look at its 171 171 * proc information. In that case, save the pid but don't try to enter 172 172 * the namespace. 173 173 */ 174 174 if (nsinfo__init(nsi) == -1) 175 - RC_CHK_ACCESS(nsi)->need_setns = false; 175 + nsinfo__clear_need_setns(nsi); 176 176 177 177 return nsi; 178 178 } ··· 276 276 nc->oldns = -1; 277 277 nc->newns = -1; 278 278 279 - if (!nsi || !RC_CHK_ACCESS(nsi)->need_setns) 279 + if (!nsi || !nsinfo__need_setns(nsi)) 280 280 return; 281 281 282 282 if (snprintf(curpath, PATH_MAX, "/proc/self/ns/mnt") >= PATH_MAX)