-
Technical task
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
None
-
3
-
9223372036854775807
A scan of a Lustre target reads objects off the device. It holds names and
parent FIDs but no pathnames, so `lfind(8)` reports objects by FID and a user
cannot turn one into a path.
The High Level Design asks the initial Output Format module for both: text
printing of FIDs, which exists, and generating pathnames for them, which does
not.
Add a call that names the object a scan record describes:
```
int llapi_scan_rec_path(int mnt_fd, const char *mnt_path,
const struct llapi_scan_rec *rec,
char *buf, size_t buflen);
```
It uses the path a namespace scan already recorded, and resolves the FID
through a client mount when there is none.
Add the option that uses it, where MOUNT is a client mount of the same
filesystem:
```
lfind --device DEVICE --fid2path MOUNT --type f
```
Without it, `lfind` prints FIDs as before.
Three behaviours a consumer will see:
Resolution costs one ioctl per match, so it runs on the objects a search kept
and not on every object scanned. That is why it is an option and not the
default.
An object with no pathname is counted and reported at the end, not printed. An
OST data object, and a target's own objects, never have one.
A hardlinked object is printed once, under its first name, because the scan
enumerates objects rather than names.