LLAPI_RMFID(3)

NAME
llapi_rmfid, llapi_rmfid_at - Remove files by their FIDs in Lustre.

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
llapi_rmfid() tries to remove fa->fa_nr Lustre files by FIDs stored in fa->fa_fids All file's hardlinks are subject to removal. This functionality is available only for root or regular users on filesystems mounted with user_fid2path mount option to delete files that they own and are in a directory in which they have write permission.

llapi_rmfid_at() Is similar to llapi_rmfid. It tries to remove Lustre files by FIDs stored in fa->fa_fids where path or device is pointed by an already verified fd.

RETURN VALUES
llapi_rmfid() and llapi_rmfid_at() return 0 on success or a negative errno value on failure. Result for each file is stored in the corresponding fa->fa_fid[N].f_ver

ERRORS

-ENOENT
    file does not exist.

-EBUSY
    file is open and can't be removed

-EPERM
    The file cannot be open by user or CAP_DAC_READ_SEARCH is not granted.

-EINVAL
    Invalid FID is passed

-ENOMEM
    Not enough memory to process the request

-ENOTTY
    file may not point to a Lustre filesystem mountpoint

AVAILABILITY
llapi_rmfid() and llapi_rmfid_at() is part of the lustre(7) user application interface library since release 2.13.0

SEE ALSO
llapi_rmfid_at(3), lustreapi(7)