---
name: "dpm_addpool"
section: "3"
platform: "linux"
package: "libdpm-dev"
version: "1.10.0-2+b3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/dpm_addpool"
---

# dpm\_addpool(3)

define a new disk pool

## NAME

dpm\_addpool - define a new disk pool

## SYNOPSIS

**#include \<sys/types.h\>**\
 **#include "dpm\_api.h"**

**int dpm\_addpool (struct dpm\_pool \****dpm\_pool***)**

## DESCRIPTION

**dpm\_addpool** defines a new disk pool.

- *dpm\_pool*

  contains the pool definition.

```
struct dpm_pool {
	char		poolname[CA_MAXPOOLNAMELEN+1];
	u_signed64	defsize;
	int		gc_start_thresh;
	int		gc_stop_thresh;
	int		def_lifetime;
	int		defpintime;
	int		max_lifetime;
	int		maxpintime;
	char		fss_policy[CA_MAXPOLICYLEN+1];
	char		gc_policy[CA_MAXPOLICYLEN+1];
	char		mig_policy[CA_MAXPOLICYLEN+1];
	char		rs_policy[CA_MAXPOLICYLEN+1];
	int		nbgids;
	gid_t		*gids;
	char		ret_policy;
	char		s_type;
	u_signed64	capacity;
	u_signed64	free;
	int		nbelem;
};
```

- *poolname*

  specifies the disk pool name.

- *defsize*

  specifies the default amount of space reserved for a file (in bytes).

- *gc\_start\_thresh*

  specifies the minimum free space in the pool. If the percentage of free space goes below this value, the garbage collector is started. Default is 0.

- *gc\_stop\_thresh*

  specifies the percentage of free space in the pool above which the garbage collector is stopped. Default is 0.

- *def\_lifetime*

  specifies the default time a space or volatile file is kept in the system (in seconds).

- *defpintime*

  specifies the default time a file is kept on a given disk (in seconds).

- *max\_lifetime*

  specifies the maximum time a space or volatile file is kept in the system (in seconds).

- *maxpintime*

  specifies the maximum time a file is kept on a given disk (in seconds).

- *nbgids*

  is the size of the array of group ids *gids*.

- *gids*

  The disk pool is restricted to this set of gids unless the group gid is zero.

- *ret\_policy*

  specifies the retention policy supported by the disk pool. It can be **R** (for Replica), **O** (for Output) or **C** (for Custodial).

- *s\_type*

  indicates the type of space supported in the disk pool. It can be **V** (for Volatile), **D** (for Durable), **P** (for Permanent) or **-** (to accept any type).

This function requires ADMIN privilege.

## RETURN VALUE

This routine returns 0 if the operation was successful or -1 if the operation failed. In the latter case, **serrno** is set appropriately.

## ERRORS

- **EACCES**

  The caller does not have ADMIN privilege.

- **EFAULT**

  *dpm\_pool* is a NULL pointer.

- **EEXIST**

  This pool exists already.

- **ENOMEM**

  Memory could not be allocated for storing the pool definition.

- **EINVAL**

  The length of *poolname* exceeds **CA\_MAXPOOLNAMELEN** or the number of gids is too big.

- **SENOSHOST**

  Host unknown.

- **SEINTERNAL**

  Database error.

- **SECOMERR**

  Communication error.
