LLAPI_PCC_STATE_GET(3)

πŸ“¦ version 2.17.58, in ubuntu stonking

πŸ’– LLAPI_PCC_STATE_GET πŸ’–

okay so bestie, welcome to LLAPI_PCC_STATE_GET(3), straight out of the Lustre Library Functions section of the manual. this is the page where we find out what the PCC state of a file is, and honestly? it's giving "short but powerful." no cap. ✨


🌸 NAME 🌸

llapi_pcc_state_get, llapi_pcc_state_get_fd, β€” get the current PCC state related to a file πŸ¦‹


✨ SYNOPSIS ✨

#include <lustre/lustreapi.h>

int llapi_pcc_state_get(const char *path, struct lu_pcc_state *state);
int llapi_pcc_state_get_fd(int fd, struct lu_pcc_state *state);

like. two functions. one job. iconic πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

so here's the tea, bestie: llapi_pcc_state_get() and llapi_pcc_state_get_fd() hand you back the PCC state information for whichever file you point at β€” either by path or by fd. πŸ“‚

the info lands in the state argument, which you have to have already allocated before you call (the library is not your mom, it will not allocate it for you, no cap). state is a lu_pcc_state data structure, and it's packing these fields:

struct lu_pcc_state {
     __u32     pccs_type; /* enum lu_pcc_type */
     __u32     pccs_open_count;
     __u32     pccs_flags; /* enum lu_pcc_state_flags */
     __u32     pccs_padding;
     char pccs_path[PATH_MAX];
};

and now the field-by-field rundown, because we don't gatekeep 🫢

  • pccs_type β€” tells you the PCC mode for the given file. it's actually a lu_pcc_type data structure. yes really, that's what it says. πŸ™ˆ
  • pccs_open_count β€” the opener count for the given file, on the client. who's got this file open? the vibes will tell you. πŸ”₯
  • pccs_flags β€” the PCC flags for the given file. and um. not used currently. it's there, it's cute, it does nothing. πŸ’€
  • pccs_path β€” the full path of the cached file on the PCC backend. the actual address of the whole situation. πŸ‘‘

🌈 RETURN VALUES 🌈

llapi_pcc_state_get() and llapi_pcc_state_get_fd() return 0 on success (slay) or a negative errno value on failure (not slay). that's it. that's the contract. periodt. ✨


πŸ’œ ERRORS πŸ’œ

  • -ENOMEM β€” Insufficient memory to complete operation. 😭 the memory said no.
  • -EFAULT β€” Memory region is not properly mapped. the memory region is lowkey lying to you.
  • -EINVAL β€” One or more invalid arguments are given. bestie. what did you pass in. 😀
  • -EOPNOTSUPP β€” PCC state operation is not supported. this operation is simply not the vibe here.

πŸ¦‹ AVAILABILITY πŸ¦‹

llapi_pcc_state_get() and llapi_pcc_state_get_fd() are part of the lustre(7) user application interface library since release 2.13.0. so if you're on something older... sorry babe, it's not happening. 🧚


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, bestie!! πŸ’– this was Lustre User API, dated 2024-08-28, and it lives under the name LLAPI_PCC_STATE_GET(3). go forth and check your PCC state, you absolute main character. πŸŽ€πŸ’…βœ¨πŸ«Ά

πŸ“¦ where this page comes from