Whamcloud - gitweb
LU-16946 utils: allow lfs find time within a range 71/55271/6
authorFrederick Dilger <fdilger@whamcloud.com>
Thu, 30 May 2024 22:00:57 +0000 (18:00 -0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 10 Jun 2024 06:14:39 +0000 (06:14 +0000)
commit28bad5e2a9930fc2a02c37a27678a740eb66c335
tree083d39b7db96840d0e5a35709e9c2d477e15c901
parentc5af382434023e4aa9d3a31efb10ec50165ffa1c
LU-16946 utils: allow lfs find time within a range

If multiple times are specified on the command-line like:

        lfs find -atime +60 -atime -90 ...

use those times as the upper and lower bounds of the margin.
This makes it easier to find files that were created within
a specific range of dates.

While working on this patch I noticed that that margin
bounds are a little odd; using the range:

(limit - margin, limit]

instead of what I intuitively thought,

(limit - margin, limit + margin)

The logic behind this is unknown to me, but it can be found
'liblustreapi.c' in the method 'find_value_cmp()'.
However, for the time being, when using a time range, it will
simply shift the limit to the largest of the two and have
the margin cover the difference.

Signed-off-by: Frederick Dilger <fdilger@whamcloud.com>
Change-Id: I2e5b856396472eab91e1d2c3214f304010601a41
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55271
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/doc/lfs-find.1
lustre/tests/sanity.sh
lustre/utils/lfs.c