LLAPI_RMFID(3)

πŸ“¦ version 2.17.58, in ubuntu stonking

πŸ’– LLAPI_RMFID πŸ’–

okay so bestie, this is a page from the Lustre Library Functions manual β€” it's all about yeeting files off your Lustre filesystem by their FIDs. no cap, it's a whole ✨ thing ✨.


🌸 NAME 🌸

llapi_rmfid, llapi_rmfid_at β€” remove files by their FIDs in Lustre. literally what it says on the tin πŸŽ€


✨ SYNOPSIS ✨

#include <lustre/lustreapi.h>

int llapi_rmfid(const char *path, struct fid_array *fa);
int llapi_rmfid_at(int fd, struct fid_array *fa);

πŸ¦‹ DESCRIPTION πŸ¦‹

So llapi_rmfid() tries to remove fa->fa_nr Lustre files, and it finds them by the FIDs stashed in fa->fa_fids. Heads up though β€” all of a file's hardlinks are subject to removal, so like… every single one. πŸ™ˆ

This functionality is available only for root or regular users, and only on filesystems that were mounted with the user_fid2path mount option. And even then, a regular user can only delete files that they own and that live in a directory where they have write permission. permission check said no? then it's a no, bestie. πŸ’…

llapi_rmfid_at() is basically llapi_rmfid's sibling πŸ‘― β€” it also tries to remove Lustre files by the FIDs stored in fa->fa_fids, except the path or device is pointed to by an already verified fd. so the fd already did its vibe check βœ…, you don't have to redo it.


🌈 RETURN VALUES 🌈

Both llapi_rmfid() and llapi_rmfid_at() return 0 on success, or a negative errno value on failure. 😭

The result for each individual file gets stored in the corresponding fa->fa_fid[N].f_ver.

okay bestie, tiny heads-up so you don't gaslight yourself: yes, the text really does say fa->fa_fid[N] right up in there while the description said fa->fa_fids. that's what the page says, so that's what you get. iykyk 🫢

πŸ’… ERRORS πŸ’…

  • -ENOENT β€” file does not exist. it's giving ghost πŸ‘»
  • -EBUSY β€” file is open and can't be removed. bestie is busy rn, come back later.
  • -EPERM β€” the file cannot be open by user, or CAP_DAC_READ_SEARCH is not granted. nope, not you. πŸ™…
  • -EINVAL β€” invalid FID is passed. that FID is not it, fr fr. πŸ’€
  • -ENOMEM β€” not enough memory to process the request. the RAM said no. 😭
  • -ENOTTY β€” file may not point to a Lustre filesystem mountpoint. wrong 'verse, wrong filesystem. πŸͺ

πŸ‘‘ AVAILABILITY πŸ‘‘

llapi_rmfid() and llapi_rmfid_at() are part of the lustre(7) user application interface library since release 2.13.0 ⭐ so if you're on something older… that's rough, buddy.


πŸŽ€ SEE ALSO πŸŽ€


and that's the whole page, bestie!! πŸ“ this was written up by the Lustre User API girlies β€” page date 2024-08-28 β€” and that's on periodt. πŸ’œπŸ§šβœ¨

πŸ“¦ where this page comes from