vxfs_dedup (3)

NAME

vxfs_dedup - Share blocks that contain identical data

SYNOPSIS

#include <sys/types.h>

#include <vxfsutil.h>

int vxfs_dedup(int mfd, struct vx_dedup *dedup);

AVAILABILITY

VRTSvxfs

This function’s use is restricted to Symantec-approved internal applications.

DESCRIPTION

The vxfs_dedup() call eliminates redundant data by sharing blocks of identical data, also referred to as deduplication. This function is supported on Version 8 and later disk layouts.

To use this function, specify -l vxfsutil while linking.

The following code is an example call:

vxfs_dedup(mfd, &dedup);

The mfd argument is an open file descriptor of the mount point in which the files to dedup reside. The dedup argument is a pointer to a vx_dedup structure that contains the parameters needed to specify and perform the dedup.


struct vx_dedup { uint32_t ddup_version; uint32_t ddup_pad1; uint64_t ddup_ino1; uint64_t ddup_ino2; uint64_t ddup_off1; uint64_t ddup_off2; char *ddup_fsetname1; char *ddup_fsetname2; uint64_t ddup_reqlen; uint64_t ddup_retlen; uint32_t ddup_syserr; uint32_t ddup_duperr; uint32_t ddup_pad2[6]; };

FIELDS

The vx_dedup structure has the following fields:
ddup_version For internal use only.
ddup_pad1 Unused.
ddup_ino1 and ddup_ino2
  The inode numbers of the files to dedup. The inode numbers can be of different files or of the same file.
ddup_off1 and ddup_off2
  The offsets into the files, where the data to dedup begins and must be block aligned.
ddup_fsetname1 and ddup_fsetname2
  The fileset names of where the files reside. The files must reside in the same fileset and the strings must match. If you pass in a NULL or empty ("") string, the system determines the name of the filesets.
ddup_reqlen The requested amount of data to dedup.
ddup_retlen A return value. See RETURN VALUES below.
ddup_syserr A return value. See RETURN VALUES below.
ddup_duperr A return value. See RETURN VALUES below.
ddup_pad2 Unused.

RETURN VALUES

vxfs_dedup() returns zero on success, and non-zero on partial success or failure.
ddup_retlen A return value of the actual amount of data that was deduped, which may be less or more than the requested amount. vxfs_dedup() attempts to dedup as much data as it can beyond the initial request. The maximum amount of data that can be deduped in a single vxfs_dedup() call is limited by the size of the extent and by the variable vx_dedup_maxlen, which currently has a value of 1 MB.
ddup_syserr A return value that contains the resulting system-specific error of any of the vxfs_dedup() calls.
ddup_duperr A return value that contains the resulting dedup-specific error of any of the vxfs_dedup() calls.
If vxfs_dedup() encounters an error, either ddup_syserr or ddup_duperr is set, and the value is the same as the return value of vxfs_dedup(), allowing the result of the operation to be contained in the request structure.

ERRORS

The following errors are specific to dedup. Primary indicates the first file in the request, and secondary indicates the second file in the request.
VX_DEDUP_EPRIINODE
  The primary inode number is invalid or not found.
VX_DEDUP_EPRIOFF
  The primary file offset is not block aligned, exceeds file size, or produces file overlap.
VX_DEDUP_EPRIMMAP
  The primary file is in use by mmap.
VX_DEDUP_ESECINODE
  The secondary inode number is invalid or not found.
VX_DEDUP_ESECOFF
  The secondary file offset is not block aligned, exceeds file size, or produces overlap.
VX_DEDUP_ESECMMAP
  The secondary file is in use by mmap.
VX_DEDUP_EFILESET
  The fileset or names are invalid or non-matching.
VX_DEDUP_ENOMATCH
  The request contains no matching data to dedup.
VX_DEDUP_EVERSION
  There is an internal dedup version mismatch.
The following errors are specific to the system.
EINVAL The request length exceeds the file size or is 0.
EINVAL The file is not a regular file or the file systems a clone.
EFAULT There is an internal copyin/copyout error.
ENOTSUP The file system layout version is not 8 or above.
EROFS The file system is readonly.
EIO The file system is disabled.
EBUSY The file is a swap file.


VxFS 5.1 SP1 vxfs_dedup (3)