LLAPI\_GROUP\_LOCK(3) Lustre Library Functions LLAPI\_GROUP\_LOCK(3)

# [NAME](#NAME)

llapi\_group\_lock, llapi\_group\_unlock, llapi\_group\_lock64, llapi\_group\_unlock64 - get and put a Lustre group lock.

# [SYNOPSIS](#SYNOPSIS)

```
#include <lustre/lustreapi.h>
```

```
int llapi_group_lock(int fd, int gid);
int llapi_group_lock64(int fd, __u64 gid);
```

```
int llapi_group_unlock(int fd, int gid);
int llapi_group_unlock64(int fd, __u64 gid);
```

# [DESCRIPTION](#DESCRIPTION)

The functions **llapi\_group\_lock()** and **llapi\_group\_lock64()** take a group lock on the file descriptor *fd* with group identifier *gid* (int or \_\_u64 type) .

The functions **llapi\_group\_unlock()** and **llapi\_group\_unlock64()** release a group lock identified by group identifier *gid* (int or \_\_u64 type) on the file descriptor *fd*.

The group lock is a whole file lock that blocks concurrent I/O originating from descriptors that have not been locked. Multiple processes can acquire a lock by specifying the same group identifier.

# [RETURN VALUES](#RETURN_VALUES)

**llapi\_group\_lock(),** **llapi\_group\_lock64(),** **llapi\_group\_unlock()** and **llapi\_group\_unlock64()** return 0 on success or a negative errno value on failure.

# [ERRORS](#ERRORS)

[**-EBADF**](#EBADF)

*fd* is not a valid file descriptor.

[**-ENOTTY**](#ENOTTY)

*fd* does not describe an object suitable for this request.

[**-EINVAL**](#EINVAL)

*fd* is already group locked with a different group identifier.

# [AVAILABILITY](#AVAILABILITY)

**llapi\_group\_lock()**, **llapi\_group\_unlock()**, **llapi\_group\_lock64()** and **llapi\_group\_unlock64()** are part of the [**lustre**(7)](/man/enterprise-packages/lustre/lustre.7) user application interface library. **llapi\_group\_lock** and **llapi\_group\_unlock** were added in releease 2.7.0. **llapi\_group\_lock64** and **llapi\_group\_unlock64** were added in release 2.15.0.

# [SEE ALSO](#SEE_ALSO)

[**lustreapi**(7)](/man/enterprise-packages/lustre/lustreapi.7)

2024-08-27 Lustre User API

---

Document: llapi_group_lock(3) from lustre 2.17.59-r1 (Chainguard OS)
Source: https://github.com/lustre/lustre-release
