diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2023-04-17 22:11:58 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2023-04-17 22:21:54 -0300 |
commit | 4d623903f1ed63a06e469c4ce45231440d1be5b6 (patch) | |
tree | 1b84231c4d0ebf3ff1d67b16eda49e296772189c /tools | |
parent | c35ce1d918c12900375a60165c908de47856900d (diff) | |
download | linux-4d623903f1ed63a06e469c4ce45231440d1be5b6.tar.gz linux-4d623903f1ed63a06e469c4ce45231440d1be5b6.tar.bz2 linux-4d623903f1ed63a06e469c4ce45231440d1be5b6.zip |
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>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/namespaces.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/namespaces.c b/tools/perf/util/namespaces.c index 8a3b7bd27b19..214a8391e07c 100644 --- a/tools/perf/util/namespaces.c +++ b/tools/perf/util/namespaces.c @@ -165,14 +165,14 @@ struct nsinfo *nsinfo__new(pid_t pid) RC_CHK_ACCESS(nsi)->pid = pid; RC_CHK_ACCESS(nsi)->tgid = pid; RC_CHK_ACCESS(nsi)->nstgid = pid; - RC_CHK_ACCESS(nsi)->need_setns = false; + nsinfo__clear_need_setns(nsi); RC_CHK_ACCESS(nsi)->in_pidns = false; /* Init may fail if the process exits while we're trying to look at its * proc information. In that case, save the pid but don't try to enter * the namespace. */ if (nsinfo__init(nsi) == -1) - RC_CHK_ACCESS(nsi)->need_setns = false; + nsinfo__clear_need_setns(nsi); return nsi; } @@ -276,7 +276,7 @@ void nsinfo__mountns_enter(struct nsinfo *nsi, nc->oldns = -1; nc->newns = -1; - if (!nsi || !RC_CHK_ACCESS(nsi)->need_setns) + if (!nsi || !nsinfo__need_setns(nsi)) return; if (snprintf(curpath, PATH_MAX, "/proc/self/ns/mnt") >= PATH_MAX) |