From: Masatake YAMATO Date: Fri, 9 Jan 2026 05:05:44 +0000 (+0900) Subject: lsfd: (refactor) add has_mnt_id helper macro X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=035cf61cde0286905ea454f34b4baa416933f02d;p=thirdparty%2Futil-linux.git lsfd: (refactor) add has_mnt_id helper macro Signed-off-by: Masatake YAMATO --- diff --git a/lsfd-cmd/file.c b/lsfd-cmd/file.c index d52f3a319..8571aa860 100644 --- a/lsfd-cmd/file.c +++ b/lsfd-cmd/file.c @@ -478,7 +478,7 @@ static bool file_fill_column(struct proc *proc __attribute__((__unused__)), xasprintf(&str, "%d", file->stat.st_nlink == 0); break; case COL_MNT_ID: - xasprintf(&str, "%d", is_opened_file(file)? file->mnt_id: 0); + xasprintf(&str, "%d", has_mnt_id(file)? file->mnt_id: 0); break; case COL_MODE: if (does_file_has_fdinfo_alike(file)) diff --git a/lsfd-cmd/lsfd.h b/lsfd-cmd/lsfd.h index ea9bf5e70..63a9f460e 100644 --- a/lsfd-cmd/lsfd.h +++ b/lsfd-cmd/lsfd.h @@ -226,6 +226,7 @@ struct file { #define is_opened_file(_f) ((_f)->association >= 0) #define is_mapped_file(_f) (is_association((_f), SHM) || is_association((_f), MEM)) #define is_association(_f, a) ((_f)->association < 0 && (_f)->association == -ASSOC_ ## a) +#define has_mnt_id(_f) (is_opened_file(_f)) struct file_class { const struct file_class *super;