]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lslocks: make SIZE filterable by normalizing to bytes
authorMasatake YAMATO <yamato@redhat.com>
Mon, 15 Dec 2025 21:41:59 +0000 (06:41 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Mon, 29 Dec 2025 07:40:51 +0000 (16:40 +0900)
commit01f7ce772c552fe9c367dc21550426bda95f051c
treec03cb007a7c59a67f115bf7e183370933b480cb2
parent92513f5fff7f18ab0a9767a2281629e7bfd60506
lslocks: make SIZE filterable by normalizing to bytes

The SIZE column may be printed in raw bytes or human-readable
units (KB/MB, etc.), which makes number-based comparison impossible.

Normalize SIZE to a byte value and store it in the cell via
libsmartcols `scols_cell_set_userdata`. When evaluating filter
expressions, use the stored byte value instead of the printed SIZE.

This enables consistent numeric comparisons (e.g., -Q 'SIZE > 1M')
regardless of the output format.

No change to printed output.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
misc-utils/lslocks.c