From b86c313072d35ed2d8927eb46808ad9268fdfc21 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Fri, 5 Jan 2024 10:27:42 +0900 Subject: [PATCH] lsfd: (refactor) rename a member of struct proc Signed-off-by: Masatake YAMATO --- misc-utils/lsfd.c | 14 +++++++------- misc-utils/lsfd.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/misc-utils/lsfd.c b/misc-utils/lsfd.c index 1fbc028e4..503f24158 100644 --- a/misc-utils/lsfd.c +++ b/misc-utils/lsfd.c @@ -851,9 +851,9 @@ static struct file *collect_file_symlink(struct path_cxt *pc, return f; if (is_association(f, NS_MNT)) { - proc->ns_mnt = find_mnt_ns(f->stat.st_ino); - if (proc->ns_mnt == NULL) - proc->ns_mnt = add_mnt_ns(f->stat.st_ino); + proc->mnt_ns = find_mnt_ns(f->stat.st_ino); + if (proc->mnt_ns == NULL) + proc->mnt_ns = add_mnt_ns(f->stat.st_ino); } else if (is_association(f, NS_NET)) load_sock_xinfo(pc, name, f->stat.st_ino); @@ -1801,18 +1801,18 @@ static void read_process(struct lsfd_control *ctl, struct path_cxt *pc, */ /* 1/3. Read /proc/$pid/ns/mnt */ - if (proc->ns_mnt == NULL) + if (proc->mnt_ns == NULL) collect_namespace_files_tophalf(pc, proc); /* 2/3. read /proc/$pid/mountinfo unless we have read it already. * The backing device for "nsfs" is solved here. */ - if (proc->ns_mnt == NULL || !proc->ns_mnt->read_mountinfo) { + if (proc->mnt_ns == NULL || !proc->mnt_ns->read_mountinfo) { FILE *mountinfo = ul_path_fopen(pc, "r", "mountinfo"); if (mountinfo) { read_mountinfo(mountinfo); - if (proc->ns_mnt) - proc->ns_mnt->read_mountinfo = true; + if (proc->mnt_ns) + proc->mnt_ns->read_mountinfo = true; fclose(mountinfo); } } diff --git a/misc-utils/lsfd.h b/misc-utils/lsfd.h index 1a180fe05..b9a402ad2 100644 --- a/misc-utils/lsfd.h +++ b/misc-utils/lsfd.h @@ -157,7 +157,7 @@ struct proc { struct proc * leader; char *command; uid_t uid; - struct mnt_namespace *ns_mnt; + struct mnt_namespace *mnt_ns; struct list_head procs; struct list_head files; unsigned int kthread: 1; -- 2.47.3