-.TH llapi_open_by_fid 3 "2022-11-08" "Lustre User API"
+.TH LLAPI_OPEN_BY_FID 3 2024-08-27 "Lustre User API" "Lustre Library Functions"
.SH NAME
-llapi_open_by_fid \- open a file descriptor from a File Identifier
+llapi_open_by_fid, llapi_open_by_fid_at \- open a file descriptor from a File Identifier
.SH SYNOPSIS
.nf
.B #include <lustre/lustreapi.h>
.BI "int llapi_open_by_fid_at(int " dir_fd ", struct lu_fid *" fid ", int " oflag ");"
.fi
.SH DESCRIPTION
-.PP
.BR llapi_open_by_fid()
opens a file descriptor in the filesystem mountpoint referenced by
.I path
.B AT_CWD
then the open is performed against the local working directory.
.SH RETURN VALUES
-.LP
returns file descriptor number or a negative errno value on failure.
.SH ERRORS
.TP 15
-.SM -EINVAL
+.B -EINVAL
An invalid argument was specified.
.TP 15
-.SM -ENOMEM
+.B -ENOMEM
No memory was available during operation.
+.SH AVAILABILITY
+.B llapi_open_by_fid()
+and
+.B llapi_open_by_fid_at()
+is part of the
+.BR lustre (7)
+user application interface library since release 2.4.0
+.\" Added in commit 2.3.53-7-gf715e4e298
.SH SEE ALSO
.BR llapi_fid_parse (3),
.BR llapi_fid2path (3),
.BR llapi_path2fid (3),
-.BR lustreapi (7),
-.BR open_by_handle_at (3)
+.BR open_by_handle_at (3),
+.BR lustreapi (7)
-.TH llapi_param_get_paths 3 "2020 Feb 24" "Lustre User API"
+.TH LLAPI_PARAM_GET_PATHS 3 2024-08-27 "Lustre User API" "Lustre Library Function"
.SH NAME
-llapi_param_get_paths \- get a list of Lustre parameter file paths
-that match the given pattern
+llapi_param_get_paths \- get a list of Lustre parameter file paths that match the given pattern
.SH SYNOPSIS
-.B #include <lustre/lustreapi.h>
.nf
-.BI "int llapi_param_get_paths(const char" " *pattern, " "glob_t" \
-" *paths" ")"
+.B #include <lustre/lustreapi.h>
+.PP
+.BI "int llapi_param_get_paths(const char *" pattern ", glob_t *" paths );
+.fi
.SH DESCRIPTION
The
.B llapi_param_get_paths(\|)
.I pattern
and are in
the correct locations in the file system are returned.
-
.SH RETURN VALUES
.TP
.B 0
.TP
-ve
error code on failure and sets errno appropriately.
-
+.SH AVAILABILITY
+.B llapi_param_get_paths()
+is part of the
+.BR lustre (7)
+user application interface library since release 2.14.0
+.\" Added in commit v2_13_53-8-g9b44cf70a9
.SH SEE ALSO
.BR llapi_param_get_value (3),
.BR lustreapi (7),
-.TH llapi_param_get_value 3 "2020 Feb 24" "Lustre User API"
+.TH LLAPI_PARAM_GET_VALUE 3 2024-08-27 "Lustre User API" "Lustre Library Functions"
.SH NAME
llapi_param_get_value \- read parameter files for Lustre to a buffer
.SH SYNOPSIS
.nf
.B #include <lustre/lustreapi.h>
.sp
-.BI "int llapi_param_get_value(const char " "*path" ", char " "**buf" \
-", size_t " "*buflen" ");"
+.BI "int llapi_param_get_value(const char *" path ", char **" buf ", size_t *" buflen );
+.fi
.SH DESCRIPTION
-.LP
The
.B llapi_param_get_value()
function reads the contents of files in procfs, sysfs, etc. into a buffer.
If the buffer is preallocated, it will have a fixed size.
If the buffer is not preallocated, it will be automatically sized to fit
the contents of the file. There is also an option to query the size of a file.
-
+.P
The behavior of
.B llapi_param_get_value()
depends on the value of
the value stored in
.I buflen
to still not be large enough when used in a subsequent call.
-.sp
+.P
If
.I buf
is not NULL but
.IR path ,
and buflen will hold the number of bytes written excluding the NUL terminating
byte.
-.sp
+.P
If both
.I buf
and
This suggested size includes the NUL terminating byte, just as in the case where
.I buf
is NULL.
-
.SH RETURN VALUES
.TP
.B 0
.TP
-ve
error code on failure and sets errno appropriately.
-
.SH ERRORS
-.TP
--EINVAL
+.TP 15
+.B -EINVAL
if either
.I path
or
.I buflen
are NULL.
.TP
--EOVERFLOW
+.B -EOVERFLOW
if
.I buf
and
.I *buf
are not NULL, and the pre-allocated buffer is too small.
.TP
--ENOMEM
+.B -ENOMEM
if
.I buf
is not NULL, but the buffer allocation failed
-
+.SH AVAILABILITY
+.B llapi_param_get_value()
+is part of the
+.BR lustre (7)
+user application interface library since release 2.14.0
+.\" Added in commit v2_13_53-8-g9b44cf70a9
.SH SEE ALSO
.BR llapi_get_param_paths (3),
.BR lustreapi (7),
-.TH llapi_path2fid 3 "2018-11-28" "Lustre User API"
+.TH LLAPI_PATH2FID 3 2024-08-28 "Lustre User API" "Lustre Library Functions"
.SH NAME
llapi_path2fid \- translate a path name to a File Identifier
.SH SYNOPSIS
.BI "int llapi_path2fid(const char *" path ", struct lu_fid *" fid );
.fi
.SH DESCRIPTION
-.PP
.BR llapi_path2fid()
-stores the Lustre file identifier (FID) for the file or directory named
-by
+stores the Lustre file identifier (FID) for the file or directory named by
.I path
into
.IR fid .
.B struct lu_fid
data type.
.SH RETURN VALUES
-.LP
returns 0 on success or a negative errno value on failure.
.SH ERRORS
.TP 15
-.SM -EINVAL
+.B -EINVAL
An invalid argument was specified.
.TP
-.SM -ENOTTY
+.B -ENOTTY
.I path
does not reside on a Lustre filesystem.
.TP
-.SM -ENOENT
+.B -ENOENT
.I path
does not exist.
+.SH AVAILABILITY
+.B llapi_path2fid()
+is part of the
+.BR lustre (7)
+user application interface library since release 2.4.0
+.\" Added in commit 2.3.53-7-gf715e4e298
.SH SEE ALSO
-.BR llapi_layout_get_by_fid (3),
-.BR llapi_layout (7),
.BR llapi_fid2path (3),
+.BR llapi_layout_get_by_fid (3),
.BR llapi_path2parent (3),
+.BR llapi_layout (7),
.BR lustreapi (7)
-.TH llapi_path2parent 3 "2014 Oct 13" "Lustre User API"
+.TH LLAPI_PATH2PARENT 3 2024-08-28 "Lustre User API" "Lustre Library Functions"
.SH NAME
-llapi_path2parent, llapi_fd2parent \- Retrieve <parent FID>/name(s) for an entry
-in Lustre.
+llapi_path2parent, llapi_fd2parent \- Retrieve <parent FID>/name(s) for an entry in Lustre.
.SH SYNOPSIS
.nf
.B #include <lustre/lustreapi.h>
.PP
-.BI "int llapi_path2parent(const char *" path ", unsigned int " linkno ","
-.BI " struct lu_fid *" parent_fid ", char *" name ","
+.BI "int llapi_path2parent(const char *" path ", unsigned int " linkno ,
+.BI " struct lu_fid *" parent_fid ", char *" name ,
.BI " size_t " name_size );
-
-.BI "int llapi_fd2parent(int " fd ", unsigned int " linkno ","
-.BI " struct lu_fid *" parent_fid ", char *" name ","
+.PP
+.BI "int llapi_fd2parent(int " fd ", unsigned int " linkno ,
+.BI " struct lu_fid *" parent_fid ", char *" name ,
.BI " size_t " name_size );
-.sp
.fi
.SH DESCRIPTION
-.PP
.BR llapi_path2parent()
for link number
.I linkno
.B llapi_fd2parent()
behaves similarly except that it operates on an open file descriptor
instead of a path.
-.sp
.SH RETURN VALUES
-.LP
0 is returned on success or a negative errno value on failure.
.SH ERRORS
.TP 15
-.SM -ENODATA
+.B -ENODATA
linkno has reached the total link count of the file.
.TP
-.SM -ENOTTY
+.B -ENOTTY
.I path
or
.I fd
does not reside on a Lustre filesystem.
.TP
-.SM -ENOENT
+.B -ENOENT
.I path
does not exist.
.TP
-.SM -EINVAL
+.B -EINVAL
An invalid argument was specified.
.TP
-.SM -EOVERFLOW
+.B -EOVERFLOW
The given buffer was too small to hold the pathname.
.TP
-.SM -EPERM
+.B -EPERM
The file cannot be open by user or CAP_DAC_READ_SEARCH is not granted.
-.SH "SEE ALSO"
+.SH AVAILABILITY
+.B llapi_path2parent()
+and
+.B llapi_fd2parent()
+are part of the
+.BR lustre (7)
+user application interface library since release 2.4.0
+.\" Added in commit 2.3.53-7-gf715e4e298
+.SH SEE ALSO
.BR lfs-path2fid (1),
.BR llapi_fid2path (3),
.BR llapi_path2fid (3),
-.TH llapi_pcc_attach 3 "2019 April 20" "Lustre User API"
+.TH LLAPI_PCC_ATTACH 3 2024-08-28 "Lustre User API" "Lustre Library Functions"
.SH NAME
llapi_pcc_attach, llapi_pcc_attach_fid, llapi_pcc_attach_fid_str \- attach a file into PCC
.SH SYNOPSIS
.B #include <lustre/lustreapi.h>
.PP
.BI "int llapi_pcc_attach(const char *" path ", __u32 " id ,
-.BI " enum lu_pcc_type " type ");"
+.BI " enum lu_pcc_type " type );
.PP
.BI "int llapi_pcc_attach_fid(const char *" mntpath ", const struct lu_fid *" fid ,
-.BI " __u32 " id ", enum lu_pcc_type " type ");"
+.BI " __u32 " id ", enum lu_pcc_type " type );
.PP
.BI "int llapi_pcc_attach_fid_str(const char *" mntpath ", const char *" fidstr ,
-.BI " __u32 " id ", enum lu_pcc_type " type ");"
+.BI " __u32 " id ", enum lu_pcc_type " type );
.fi
.SH DESCRIPTION
-.PP
The function
.BR llapi_pcc_attach() ,
-.BR llapi_pcc_attach_fid() ,
+.B llapi_pcc_attach_fid()
and
-.BR llapi_pcc_attach_fid_str()
+.B llapi_pcc_attach_fid_str()
tries to attach the file referenced by
.IR path ,
.IR fid ,
LU_PCC_READONLY
means RO-PCC mode.
.SH RETURN VALUES
-.PP
.B llapi_pcc_attach()
return 0 on success or a negative errno value on failure.
.SH ERRORS
.TP 15
-.SM -ENOMEM
+.B -ENOMEM
Insufficient memory to complete operation.
.TP
-.SM -EFAULT
+.B -EFAULT
Memory region is not properly mapped.
.TP
-.SM -EINVAL
+.B -EINVAL
One or more invalid arguments are given.
.TP
-.SM -EOPNOTSUPP
+.B -EOPNOTSUPP
PCC attach operation is not supported.
-.SH "SEE ALSO"
+.SH AVAILABILITY
+.BR llapi_pcc_attach() ,
+.B llapi_pcc_attach_fid()
+and
+.B llapi_pcc_attach_fid_str()
+are part of the
+.BR lustre (7)
+user application interface library since release 2.13.0
+.\" Added in commit v2_12_53-113-gf172b11688
+.SH SEE ALSO
.BR lustreapi (7)
-.TH llapi_pcc_clear 3 "2019 June 20" "Lustre User API"
+.TH LLAPI_PCC_CLEAR 3 2024-08-28 "Lustre User API" "Lustre Library Functions"
.SH NAME
llapi_pcc_clear \- Remove all PCC backends from a client
.SH SYNOPSIS
.BI " enum lu_pcc_cleanup_flags " flags );
.fi
.SH DESCRIPTION
-.PP
The function
.BR llapi_pcc_clear()
deletes all PCC backends on the client with the mount point referenced by
for the usage of the input parameter
.IR flags .
.SH RETURN VALUES
-.PP
.B llapi_pcc_clear()
returns 0 on success or a negative errno on failure.
.SH ERRORS
.TP 15
-.SM -ENOMEM
+.B -ENOMEM
Insufficient memory to complete operation.
.TP
-.SM -EFAULT
+.B -EFAULT
Memory region is not properly mapped.
.TP
-.SM -EINVAL
+.B -EINVAL
One or more invalid arguments are given.
.TP
-.SM -EOPNOTSUPP
+.B -EOPNOTSUPP
PCC backend operation is not supported.
-.SH "SEE ALSO"
+.SH AVAILABILITY
+.B llapi_pcc_clear()
+is part of the
+.BR lustre (7)
+user application interface library since release 2.16.0
+.\" Added in commit v2_15_63-106-gc74878caa7
+.SH SEE ALSO
.BR llapi_pcc_del (3),
.BR lustreapi (7)
-.TH llapi_pcc_del 3 "2019 June 20" "Lustre User API"
+.TH LLAPI_PCC_DEL 3 2024-08-28 "Lustre User API" "Lustre Library Functions"
.SH NAME
llapi_pcc_del \- Delete a PCC backend from a client
.SH SYNOPSIS
.BI " enum lu_pcc_cleanup_flags " flags );
.fi
.SH DESCRIPTION
-.PP
The function
.BR llapi_pcc_del()
deletes a PCC backend referenced by
traditional HSM storage solution and the file data is still accessible as long
as the copytool is still running at this client.
.SH RETURN VALUES
-.PP
.B llapi_pcc_del()
returns 0 on success or a negative errno value on failure.
.SH ERRORS
.TP 15
-.SM -ENOMEM
+.B -ENOMEM
Insufficient memory to complete operation.
.TP
-.SM -EFAULT
+.B -EFAULT
Memory region is not properly mapped.
.TP
-.SM -EINVAL
+.B -EINVAL
One or more invalid arguments are given.
.TP
-.SM -EOPNOTSUPP
+.B -EOPNOTSUPP
PCC backend operation is not supported.
-.SH "SEE ALSO"
+.SH AVAILABILITY
+.B llapi_pcc_del()
+is part of the
+.BR lustre (7)
+user application interface library since release 2.16.0
+.\" Added in commit v2_15_63-106-gc74878caa7
+.SH SEE ALSO
.BR lustreapi (7)
-.TH llapi_pcc_detach_fid_fd 3 "2019 April 20" "Lustre User API"
+.TH LLAPI_PCC_DETACH_FID_FD 3 2024-08-28 "Lustre User API" "Lustre Library Functions"
.SH NAME
-llapi_pcc_detach_fid_fd, llapi_pcc_detach_fid, llapi_pcc_detach_fid_str,
-llapi_pcc_detach_file \- detach the given file from PCC
+llapi_pcc_detach_fid_fd, llapi_pcc_detach_fid, llapi_pcc_detach_fid_str, llapi_pcc_detach_file \- detach the given file from PCC
.SH SYNOPSIS
.nf
.B #include <lustre/lustreapi.h>
.PP
-.BI "int llapi_pcc_detach_fid_fd(int " dirfd ", const struct lu_fid *" fid ",
+.BI "int llapi_pcc_detach_fid_fd(int " dirfd ", const struct lu_fid *" fid ,
.BI " __u32 " flags );
.PP
.BI "int llapi_pcc_detach_fid(const char *" mntpath ",
.BI " const struct lu_fid *" fid ", __u32 " flags );
.PP
-.BI "int llapi_pcc_detach_fid_str(const char *" mntpath ",
+.BI "int llapi_pcc_detach_fid_str(const char *" mntpath ,
.BI " const char *" fidstr ", __u32 " flags );
.PP
.BI "int llapi_pcc_detach_file(const char *" path ", __u32 " flags );
.fi
.SH DESCRIPTION
-.PP
.BR llapi_pcc_detach_fid_fd() ,
.BR llapi_pcc_detach_fid() ,
.BR llapi_pcc_detach_fid_str() ,
and
-.BR llapi_pcc_detach_file()
+.B llapi_pcc_detach_file()
detach a cached file from PCC by an ioctl on the directory or the file itself.
The file is referenced by
.IR fid ,
.B enum lu_pcc_detach_flags
data structure, which contains the following values:
.nf
-.LP
PCC_DETACH_FL_NONE = 0x0,
PCC_DETACH_FL_UNCACHE = 0x01,
PCC_DETACH_FL_KNOWN_READWRITE = 0x02,
indicates that PCC cached copy is removed. It is used to tell the user space
caller that the file is detached and the corresponding PCC copy is removed.
.SH RETURN VALUES
-.LP
.BR llapi_pcc_detach_fid_fd() ,
.BR llapi_pcc_detach_fid() ,
.BR llapi_pcc_detach_fid_str() ,
return 0 on success or a negative errno value on failure.
.SH ERRORS
.TP 15
-.SM -ENOMEM
+.B -ENOMEM
Insufficient memory to complete operation.
.TP
-.SM -EFAULT
+.B -EFAULT
Memory region is not properly mapped.
.TP
-.SM -EINVAL
+.B -EINVAL
One or more invalid arguments are given.
.TP
-.SM -EOPNOTSUPP
+.B -EOPNOTSUPP
PCC state operation is not supported.
.TP
-.SM -ENOTTY
+.B -ENOTTY
File does not reside on a Lustre filesystem.
.TP
-.SM -ENOENT
+.B -ENOENT
.I path
does not exist.
-.SH "SEE ALSO"
+.SH AVAILABILITY
+.BR llapi_pcc_detach_fid_fd() ,
+.BR llapi_pcc_detach_fid() ,
+.BR llapi_pcc_detach_fid_str() ,
+and
+.B llapi_pcc_detach_file()
+are part of the
+.BR lustre (7)
+user application interface library since release 2.13.0
+.\" Added in commit v2_12_53-113-gf172b11688
+.SH SEE ALSO
.BR llapi_pcc_attach (3),
.BR lustreapi (7)
-.TH llapi_pcc_state_get 3 "2019 April 20" "Lustre User API"
+.TH LLAPI_PCC_STATE_GET 3 2024-08-28 "Lustre User API" "Lustre Library Functions"
.SH NAME
-llapi_pcc_state_get, llapi_pcc_state_get_fd, \- get the current PCC state
-related to a file
+llapi_pcc_state_get, llapi_pcc_state_get_fd, \- get the current PCC state related to a file
.SH SYNOPSIS
.nf
.B #include <lustre/lustreapi.h>
.PP
-.BI "int llapi_pcc_state_get(const char *" path ", struct lu_pcc_state *" state ");"
-.PP
-.BI "int llapi_pcc_state_get_fd(int " fd ", struct lu_pcc_state *" state ");"
+.BI "int llapi_pcc_state_get(const char *" path ", struct lu_pcc_state *" state );
+.PPq
+.BI "int llapi_pcc_state_get_fd(int " fd ", struct lu_pcc_state *" state );
.fi
.SH DESCRIPTION
-.PP
The functions
-.BR llapi_pcc_state_get()
+.B llapi_pcc_state_get()
and
-.BR llapi_pcc_state_get_fd()
+.B llapi_pcc_state_get_fd()
return the PCC state information for the file referenced by
.IR path
or
argument which should be already allocated, which is a
.B lu_pcc_state
data structure, which contains the following fields:
+.PP
.nf
-.LP
struct lu_pcc_state {
__u32 pccs_type; /* enum lu_pcc_type */
__u32 pccs_open_count;
.I pccs_path
is the full path of the cached file on the PCC backend.
.SH RETURN VALUES
-.PP
.B llapi_pcc_state_get()
and
.B llapi_pcc_state_get_fd()
return 0 on success or a negative errno value on failure.
.SH ERRORS
.TP 15
-.SM -ENOMEM
+.B -ENOMEM
Insufficient memory to complete operation.
.TP
-.SM -EFAULT
+.B -EFAULT
Memory region is not properly mapped.
.TP
-.SM -EINVAL
+.B -EINVAL
One or more invalid arguments are given.
.TP
-.SM -EOPNOTSUPP
+.B -EOPNOTSUPP
PCC state operation is not supported.
-.SH "SEE ALSO"
+.SH AVAILABILITY
+.B llapi_pcc_state_get()
+and
+.B llapi_pcc_state_get_fd()
+are part of the
+.BR lustre (7)
+user application interface library since release 2.13.0
+.\" Added in commit v2_12_53-113-gf172b11688
+.SH SEE ALSO
.BR llapi_pcc_attach (3),
.BR lustreapi (7)
-.TH llapi_pccdev_get 3 "2019 April 20" "Lustre User API"
+.TH LLAPI_PCCDEV_GET 3 2024-08-28 "Lustre User API" "Lustre Library Functions"
.SH NAME
llapi_pccdev_get \- List all PCC backends on a client
.SH SYNOPSIS
.BI "int llapi_pccdev_get(const char *" path ");"
.fi
.SH DESCRIPTION
-.PP
The function
.BR llapi_pccdev_get()
lists all PCC backends on the client with the mount point referenced by
.IR path ,
and output the results to stdout in YAML format.
.SH RETURN VALUES
-.PP
.B llapi_pccdev_get()
return 0 on success or a negative errno value on failure.
.SH ERRORS
.TP 15
-.SM -ENOMEM
+.B -ENOMEM
Insufficient memory to complete operation.
.TP
-.SM -EFAULT
+.B -EFAULT
Memory region is not properly mapped.
.TP
-.SM -EINVAL
+.B -EINVAL
One or more invalid arguments are given.
.TP
-.SM -EOPNOTSUPP
+.B -EOPNOTSUPP
PCC backend operation is not supported.
-.SH "SEE ALSO"
-.BR llapi_pccdev_set (3)
+.SH AVAILABILITY
+.B llapi_pccdev_get()
+is part of the
+.BR lustre (7)
+user application interface library since release 2.13.0
+.\" Added in commit v2_12_53-113-gf172b11688
+.SH SEE ALSO
+.BR llapi_pccdev_set (3),
.BR lustreapi (7)
-.TH llapi_pccdev_set 3 "2019 April 20" "Lustre User API"
+.TH LLAPI_PCCDEV_SET 3 2024-08-28 "Lustre User API" "Lustre Library Functions"
.SH NAME
llapi_pccdev_set \- Add/delete a PCC backend on a client
.SH SYNOPSIS
.BI "int llapi_pccdev_set(const char *" path ", const char *" cmd ");"
.fi
.SH DESCRIPTION
-.PP
The function
.BR llapi_pccdev_set()
adds or deletes a PCC backend on the client with the mount point referenced by
.IR cmd
could be in the following forms:
.TP
-.B \ "add\ $PCCPATH\ $PARAM"
+.B \(dq\&add $PCCPATH $PARAM\(dq
Add a PCC backend referenced by the HSM root path
.IR $PCCPATH .
.TP
-.B \ "del\ $PCCPATH"
+.B \(dq\&del $PCCPATH\(dq
Delete a PCC backend referenced by the HSM root path
.IR $PCCPATH .
.TP
-.B \ "clear"
+.B \(dq\&clear\(dq
Clear and remove all PCC backends on a client.
.SH RETURN VALUES
-.PP
.B llapi_pccdev_set()
return 0 on success or a negative errno value on failure.
.SH ERRORS
.TP 15
-.SM -ENOMEM
+.B -ENOMEM
Insufficient memory to complete operation.
.TP
-.SM -EFAULT
+.B -EFAULT
Memory region is not properly mapped.
.TP
-.SM -EINVAL
+.B -EINVAL
One or more invalid arguments are given.
.TP
-.SM -EOPNOTSUPP
+.B -EOPNOTSUPP
PCC backend operation is not supported.
-.SH "SEE ALSO"
+.SH AVAILABILITY
+.B llapi_pccdev_set()
+is part of the
+.BR lustre (7)
+user application interface library since release 2.13.0
+.\" Added in commit v2_12_53-113-gf172b11688
+.SH SEE ALSO
.BR lustreapi (7)
-.TH LLAPI_QUOTACTL 3
+.TH LLAPI_QUOTACTL 3 2024-08-28 "Lustre User API" "Lustre Library Functions"
.SH NAME
llapi_quotactl \- manipulate disk quotas on a Lustre filesystem
.SH SYNOPSIS
.nf
.B #include <lustre/lustreapi.h>
+.PP
+.BI "int llapi_quotactl(char *" mnt ", struct if_quotactl *" qctl );
+.PP
+.B struct if_quotactl {
+.RS 8
+.B "__u32 qc_cmd;"
+.B "__u32 qc_type;"
+.B "__u32 qc_id;"
+.B "__u32 qc_stat;"
+.B "struct obd_dqinfo qc_dqinfo;"
+.B "struct obd_dqblk qc_dqblk;"
+.B "char obd_type[16];"
+.B "struct obd_uuid obd_uuid;"
+.RE
+.B };
+.PP
+.B struct obd_dqblk {
+.RS 8
+.B __u64 dqb_bhardlimit;
+.B __u64 dqb_bsoftlimit;
+.B __u64 dqb_curspace;
+.B __u64 dqb_ihardlimit;
+.B __u64 dqb_isoftlimit;
+.B __u64 dqb_curinodes;
+.B __u64 dqb_btime;
+.B __u64 dqb_itime;
+.B __u32 dqb_valid;
+.B __u32 padding;
+.RE
+.B };
+.PP
+.B struct obd_dqinfo {
+.RS 8
+.B __u64 dqi_bgrace;
+.B __u64 dqi_igrace;
+.B __u32 dqi_flags;
+.B __u32 dqi_valid;
+.RE
+.B };
.sp
-.BI "int llapi_quotactl(char" " *mnt," " struct if_quotactl" " *qctl)
-.sp
-\fBstruct if_quotactl {
- __u32 qc_cmd;
- __u32 qc_type;
- __u32 qc_id;
- __u32 qc_stat;
- struct obd_dqinfo qc_dqinfo;
- struct obd_dqblk qc_dqblk;
- char obd_type[16];
- struct obd_uuid obd_uuid;
-};
-.sp
-\fBstruct obd_dqblk {
- __u64 dqb_bhardlimit;
- __u64 dqb_bsoftlimit;
- __u64 dqb_curspace;
- __u64 dqb_ihardlimit;
- __u64 dqb_isoftlimit;
- __u64 dqb_curinodes;
- __u64 dqb_btime;
- __u64 dqb_itime;
- __u32 dqb_valid;
- __u32 padding;
-};
-.sp
-\fBstruct obd_dqinfo {
- __u64 dqi_bgrace;
- __u64 dqi_igrace;
- __u32 dqi_flags;
- __u32 dqi_valid;
-};
-.sp
-\fBstruct obd_uuid {
- char uuid[40];
-};
+.B struct obd_uuid {
+.RS 8
+.B char uuid[40];
+.RE
+.B };
.fi
.SH DESCRIPTION
-.LP
-.IX "filesystem" "quotactl() disk quotas" "" "\fLquotactl()\fP \(em disk quotas"
-.IX "quotactl() disk quotas" "" "\fLquotactl()\fP \(em disk quotas"
-.IX "disk quotas quotactl()" "" "disk quotas \(em \fLquotactl()\fP"
-.LP
The
.B llapi_quotactl(\|)
function manipulates disk quotas on a Lustre filesystem
-.I mnt.
+.IR mnt .
.I qc_cmd
indicates a command to be applied to
-.SM UID
-.IR qc_id
+.B UID
+.I qc_id
or
-.SM GID
+.B GID
.IR qc_id .
.TP 15
-.SB LUSTRE_Q_QUOTAON
+.B LUSTRE_Q_QUOTAON
Turn on quotas for a Lustre filesystem. Deprecated as of 2.4.0.
.I qc_type
is USRQUOTA, GRPQUOTA or UGQUOTA (both user and group quotas).
The quota files must exist; they are normally created with the
.BR llapi_quotacheck (3)
call.
-
+.PP
This call is restricted to the super-user.
.TP
-.SB LUSTRE_Q_QUOTAOFF
+.B LUSTRE_Q_QUOTAOFF
Turn off quotas for a Lustre filesystem. Deprecated as of 2.4.0.
.I qc_type
is USRQUOTA, GRPQUOTA or UGQUOTA (both user and group quotas).
-
+.PP
This call is restricted to the super-user.
.TP
-.SB LUSTRE_Q_GETQUOTA
+.B LUSTRE_Q_GETQUOTA
Get disk quota limits and current usage for user or group
.IR qc_id .
.I qc_type
is USRQUOTA or GRPQUOTA.
.I uuid
-may be filled with OBD UUID string to query quota information from a specific node.
+may be filled with OBD UUID string
+to query quota information from a specific node.
.I dqb_valid
may be set nonzero to query information only from MDS. If
.I uuid
.I dqb_btime
and
.I dqb_itime
-are block and inode softlimit grace period expiration timestamps for the requested user or group.
-
+are block and inode softlimit grace period expiration
+timestamps for the requested user or group.
+.PP
Quotas must be turned on before using this command.
.TP
-.SB LUSTRE_Q_SETQUOTA
+.B LUSTRE_Q_SETQUOTA
Set disk quota limits for user or group
.IR qc_id .
.I qc_type
is USRQUOTA or GRPQUOTA.
.I dqb_valid
-must be set to QIF_ILIMITS, QIF_BLIMITS or QIF_LIMITS (both inode limits and block limits) dependent on updating limits.
+must be set to QIF_ILIMITS, QIF_BLIMITS or QIF_LIMITS
+(both inode limits and block limits) dependent on updating limits.
.I obd_dqblk
must be filled with limits values (as set in
-.I dqb_valid
-, block limits unit is kilobyte).
-
+.IR dqb_valid ,
+block limits unit is kilobyte).
+.PP
Quotas must be turned on before using this command.
.TP
-.SB LUSTRE_Q_GETINFO
+.B LUSTRE_Q_GETINFO
Get information about quotas.
.I qc_type
is either USRQUOTA or GRPQUOTA. On return
.I dqi_igrace
-is the default inode grace period duration for all users or all groups (in seconds),
+is the default inode grace period duration
+for all users or all groups (in seconds),
.I dqi_bgrace
-is the default block grace period duration for all users or all groups (in seconds),
+is the default block grace period duration
+for all users or all groups (in seconds),
.I dqi_flags
is not used by the current Lustre version.
.TP
-.SB LUSTRE_Q_SETINFO
+.B LUSTRE_Q_SETINFO
Set quota information (like grace times).
.I qc_type
is either USRQUOTA or GRPQUOTA.
.I dqi_flags
is not used by the current Lustre version and must be zeroed.
.SH RETURN VALUES
-.LP
.B llapi_quotactl(\|)
returns:
.TP
.I qctl
is invalid.
.TP
-.SM ENOSYS
+.B ENOSYS
The kernel or Lustre modules have not been compiled with the
-.SB QUOTA
+.B QUOTA
option.
.TP
-.SM ENOMEM
+.B ENOMEM
Insufficient memory to complete operation.
.TP
-.SM ENOTTY
+.B ENOTTY
.I qc_cmd
is invalid.
.TP
-.SM EBUSY
+.B EBUSY
Cannot process during quotacheck.
.TP
-.SM ENOENT
+.B ENOENT
.I uuid
does not correspond to OBD or
.I mnt
does not exist
.TP
-.SM EPERM
+.B EPERM
The call is privileged and the caller was not the super-user.
.TP
-.SM ESRCH
+.B ESRCH
No disk quota is found for the indicated user.
.IP
Quotas have not been turned on for this filesystem.
-.SH "SEE ALSO"
+.SH AVAILABILITY
+.B llapi_quotactl()
+is part of the
+.BR lustre (7)
+user application interface library since release 2.4.0
+.\" Added in commit 2.3.53-7-gf715e4e298
+.SH SEE ALSO
.BR lfs (1),
.BR lustre (7),
.BR lustreapi (7)
-.TH llapi_rmfid 3 "2014 Oct 13" "Lustre User API"
+.TH LLAPI_RMFID 3 2024-08-28 "Lustre User API" "Lustre Library Functions"
.SH NAME
-llapi_rmfid \- Remove files by their FIDs in Lustre.
+llapi_rmfid, llapi_rmfid_at \- Remove files by their FIDs in Lustre.
.SH SYNOPSIS
.nf
.B #include <lustre/lustreapi.h>
.PP
-.BI "int llapi_rmfid(const char *" path ", struct fid_array *" fa ");
-.BI "int llapi_rmfid_at(int " fd ", struct fid_array *" fa ");
-
-.sp
+.BI "int llapi_rmfid(const char *" path ", struct fid_array *" fa );
+.BI "int llapi_rmfid_at(int " fd ", struct fid_array *" fa );
.fi
.SH DESCRIPTION
-.PP
.BR llapi_rmfid()
tries to remove
.I fa->fa_nr
.I user_fid2path
mount option to delete files that they own and are in a directory in which
they have write permission.
-
+.P
.BR llapi_rmfid_at()
Is similar to
.I llapi_rmfid.
.I fa->fa_fids
where path or device is pointed by an already verified
.I fd.
-
.SH RETURN VALUES
-.LP
.B llapi_rmfid()
and
.B llapi_rmfid_at()
.I fa->fa_fid[N].f_ver
.SH ERRORS
.TP 15
-.TP
-.SM -ENOENT
+.B -ENOENT
.I file
does not exist.
.TP
-.SM -EBUSY
+.B -EBUSY
file is open and can't be removed
.TP
-.SM -EPERM
+.B -EPERM
The file cannot be open by user or CAP_DAC_READ_SEARCH is not granted.
.TP
-.SM -EINVAL
+.B -EINVAL
Invalid FID is passed
.TP
-.SM -ENOMEM
+.B -ENOMEM
Not enough memory to process the request
.TP
-.SM -ENOTTY
+.B -ENOTTY
.I file
may not point to a Lustre filesystem mountpoint
-.SH "SEE ALSO"
+.SH AVAILABILITY
+.B llapi_rmfid()
+and
+.B llapi_rmfid_at()
+is part of the
+.BR lustre (7)
+user application interface library since release 2.13.0
+.\" Added in commit 2.12.56-71-g1fd63fcb04
+.SH SEE ALSO
+.BR llapi_rmfid_at (3),
.BR lustreapi (7)
-.BR llapi_rmfid_at (3)
-.TH llapi_root_path_open 3 "2023 Apr 21" "Lustre User API"
+.TH LLAPI_ROOT_PATH_OPEN 3 2024-08-28 "Lustre User API" "Lustre Library Functions"
.SH NAME
llapi_root_path_open \- Return open fd for a given device/path provided
.SH SYNOPSIS
.nf
.B #include <lustre/lustreapi.h>
-
-.sp
+.PP
.BI "int llapi_root_path_open(const char *"device ", int *" fd " );
-
-.sp
.fi
.SH DESCRIPTION
-.LP
.B llapi_root_path_open(\|)
is called with
.I device
filesystem. On success,
.I fd
is populated with valid descriptor.
-
.SH RETURN VALUES
-.LP
.B llapi_root_path_open(\|)
return:
.TP
.TP
<0
on failure.
-.fi
-.SH "SEE ALSO"
+.SH AVAILABILITY
+.B llapi_root_path_open()
+is part of the
+.BR lustre (7)
+user application interface library since release 2.16.0
+.\" Added in commit v2_15_55-108-g5d93025240
+.SH SEE ALSO
.BR lustreapi (7)
-.TH llapi_search_rootpath 3 "2022 May 23" "Lustre User API"
+.TH LLAPI_SEARCH_ROOTPATH 3 2024-08-28 "Lustre User API" "Lustre Library Functions"
.SH NAME
-llapi_search_rootpath, llapi_search_rootpath_by_dev \-
-retrieve the path of a lustre mount point
+llapi_search_rootpath, llapi_search_rootpath_by_dev \- retrieve the path of a lustre mount point
.SH SYNOPSIS
.nf
.B #include <lustre/lustreapi.h>
.BI "int llapi_search_rootpath_by_dev( char *" pathname ", dev_t " dev ")
.fi
.SH DESCRIPTION
-.PP
-.BR llapi_search_rootpath()
+.B llapi_search_rootpath()
and
-.BR llapi_search_rootpath_by_dev()
-find the first Lustre mount point by matching the filesystem name \fIfsname\fP or the filesystem device \fIdev\fP.
+.B llapi_search_rootpath_by_dev()
+find the first Lustre mount point by matching the filesystem name
+.I fsname
+or the filesystem device
+.IR dev .
.PP
-The path of the mount point found is stored into \fIpathname\fP. This buffer should be sufficient to store the path.
+The path of the mount point found is stored into
+.IR pathname .
+This buffer should be sufficient to store the path.
.PP
.BR e.g:
char pathname[PATH_MAX];
.PP
The filesystem device can be retrieved from a file with
.BR stat()
-(field \fIst_dev\fP) or
+(field
+.IR st_dev )
+or
.BR statx()
-(fields \fIstx_dev_major\fP and \fIstx_dev_minor\fP).
+(fields
+.I stx_dev_major
+and
+.IR stx_dev_minor ).
.SH RETURN VALUES
.TP
.B 0
error code on failure and sets errno appropriately.
.SH ERRORS
.TP 15
-.SM EINVAL
-\fIpathname\fP pointer is NULL.
+.B EINVAL
+.I pathname
+pointer is NULL.
.TP
-.SM ENODEV
+.B ENODEV
The Lustre mount point was not found.
+.SH AVAILABILITY
+.B llapi_search_rootpath()
+and
+.B llapi_search_rootpath_by_dev()
+is part of the
+.BR lustre (7)
+user application interface library.
+.B llapi_search_rootpath
+was added in release 2.4.0.
+.\" Added in commit 2.3.53-7-gf715e4e298
+.B llapi_search_rootpath_by_dev
+was added in release 2.16.0.
+.\" Added in commit v2_15_51-73-g4fd7d5585d
.SH SEE ALSO
-.ad l
-.nh
-.BR lustreapi (7),
.BR stat (2),
-.BR statx (2)
+.BR statx (2),
+.BR lustreapi (7)
.so man3/llapi_search_rootpath.3
-
-.TH llapi_search_tgt 3 "2019 Jun 06" "Lustre User API"
+.TH LLAPI_SEARCH_TGT 3 2024-08-28 "Lustre User API" "Lustre Library Functions"
.SH NAME
-llapi_search_tgt \- verify OST or MDT is in specified pool
+llapi_search_tgt, llapi_search_mdt, llapi_search_ost \- verify OST or MDT is in specified pool
.SH SYNOPSIS
.nf
.B #include <lustre/lustreapi.h>
.PP
-.IB int " llapi_search_tgt(" "const char *fsname" ", " "const char *pool_name" ,
-.BI "const char *tgt_name" ", " "bool is_mdt" );
+.BI "int llapi_search_tgt(const char *" fsname ", const char *" pool_name ,
+.BI " const char *" tgt_name ", bool " is_mdt );
.PP
-.IB int " llapi_search_mdt(" "const char *fsname" ", " "const char *pool_name" ,
-.BI "const char *tgt_name" );
+.BI "int llapi_search_mdt(const char *" fsname ", const char *" pool_name ,
+.BI " const char *" tgt_name );
.PP
-.IB int " llapi_search_ost(" "const char *fsname" ", " "const char *pool_name" ,
-.BI "const char *tgt_name" );
+.BI "int llapi_search_ost(const char *" fsname ", const char *" pool_name ,
+.BI " const char *" tgt_name );
+.fi
.SH DESCRIPTION
-.PP
.B llapi_search_tgt()
verifies that the specified
.I tgt_name
.I fsname
and (if specified) in the pool named
.I pool_name
-of that filesystem. At least
+of that filesystem. At least
.I fsname
must be non-NULL, but
.I pool_name
.I is_mdt
appropriately for the target type.
.SH RETURN VALUES
-.LP
.B llapi_search_tgt()
returns 1 if
.I tgt_name
is also set appropriately.
.SH ERRORS
.TP 15
-.SM EINVAL
+.B EINVAL
.I fsname
is NULL or zero-length, or both
.I pool_name
.I tgt_name
are
.BR NULL .
-.TP 15
-.SM ENOENT
+.TP
+.B ENOENT
.I pool_name
is specified but is not part of
.IR fsname .
-.SH "SEE ALSO"
-.BR llapi_pool_name_verify (3),
-.BR lustreapi (7),
+.SH AVAILABILITY
+.BR llapi_search_tgt() ,
+.B llapi_search_mdt()
+and
+.B llapi_search_ost()
+is part of the
.BR lustre (7)
+user application interface library since release 2.4.0
+.\" Added in commit 2.3.53-7-gf715e4e298
+.SH SEE ALSO
+.BR llapi_pool_name_verify (3),
+.BR lustre (7),
+.BR lustreapi (7)
-.TH lustreapi 3 "2009 Jul 10" The Lustre user application interface library
+.TH LLAPI_UNLINK_FOREIGN 3 2024-08-28 "Lustre User API" "Lustre Library Functions"
.SH NAME
llapi_unlink_foreign \- unlink file/dir with foreign layout on a Lustre filesystem
.SH SYNOPSIS
.nf
.B #include <lustre/lustreapi.h>
-.sp
+.PP
.BI "int llapi_unlink_foreign(char *" name ");"
-.sp
.fi
.SH DESCRIPTION
-.LP
.B llapi_unlink_foreign(\|)
will allow to unlink a file/dir of
.I name
command/syscall.
It also works for regular file/dir.
.SH RETURN VALUES
-.LP
.B llapi_unlink_foreign(\|)
return:
.TP
on failure, the absolute value is an error code.
.SH ERRORS
.TP 15
-.SM ENOENT
+.B ENOENT
.I name
does not exist.
.TP
-.SM ENOTTY
+.B ENOTTY
.I name
may not point to a Lustre filesystem.
-.SH "EXAMPLE"
+.SH EXAMPLES
.nf
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
-
+\&
#include <lustre/lustreapi.h>
-
+\&
int main(int argc, char **argv)
{
char *foreign = NULL;
int c, rc;
-
+\&
while ((c = getopt(argc, argv, "hf:")) != -1) {
switch (c) {
case 'f':
break;
}
}
-
+\&
if (foreign == NULL) {
fprintf(stderr, "a foreign file/dir pathname must be provided\n");
exit(0);
}
-
+\&
rc = llapi_unlink_foreign(foreign);
if (rc < 0)
fprintf(stderr, "llapi_unlink_foreign() error: %d\n", rc);
-
+\&
return rc;
}
.fi
-.SH "SEE ALSO"
+.SH AVAILABILITY
+.B llapi_unlink_foreign()
+is part of the
+.BR lustre (7)
+user application interface library since release 2.9.0
+.\" Added in commit v2_8_59_0-75-gbfd4600f31
+.SH SEE ALSO
.BR lustre (7),
.BR lustreapi (7)