sam_release(3)

NAME
sam_release - Sets release attributes on a file or directory

SYNOPSIS

cc [ flag ... ] file ... -L/opt/SUNWsamfs/lib -lsam [ library ... ]

#include "/opt/SUNWsamfs/include/lib.h"

int sam_release(const char *path, const char *ops);

DESCRIPTION
sam_release() sets release attributes on a file or directory using a Sun StorageTek SAM-FS or Sun SAM-QFS system call. path is the file on which to set the attributes. ops is the character string of options, for example: "dn". Individual options are described below.

OPTIONS

a   Set the attribute that specifies that a file's disk space be released when at least one archive copy of the file exists. Not valid with n.

d   Return the release attributes on the file to the default, i.e. the file space is released according to archiver rules or as needed by the releaser. When this option is specified, the attributes are reset to the default. If the partial attribute is reset, all blocks are released for an offline regular file. If it is used, it should be the first character in the string.

i   Specifies that the file's disk space be released immediately. This will occur if the file is currently not staging, has at least one archive copy, and has some data in it.

n   Specifies that the disk space for this file never be released. Only the super-user can set this attribute on a file.

p   Set the partial attribute on the file so that, when the file's disk space is released, the first portion of that disk space will be retained. Not valid with sam_release n option. Also not valid with either of the checksum g (generate) or u (use) attributes. (See ssum(1) or sam_ssum(3)). If the partial attribute is set when the file is offline, the partial blocks are not on the disk and the entire file will be staged if accessed. The sam_stage p attribute can be used to stage the partial blocks to the disk.

s n Set the partial attribute on the file so that, when the file's disk space is released, the first n kilobytes of that disk space will be retained. Not valid with release -n. Also not valid with either of the checksum generate or use attributes (ssum -g or ssum -u). The minimum value is 8 kbytes and the maximum value is the maxpartial value set for this file system by the mount command (see unt_samfs (1M)).

NOTE: Even though only a portion of the file is retained on disk,
    the amount of disk space consumed is equal to one DAU. So, for example, if the partial size is set to 16K and the DAU size is 256K, even though only 16K of data remains after a partial release, the actual disk space used is 256K.

RETURN VALUES
Upon successful completion a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.

ERRORS

sam_release() fails if one or more of the following are true:

EINVAL
    An invalid option was specified, or the file is neither a regular file nor a directory.

EPERM
    Not the owner or super-user.

EFAULT
    path or ops points to an illegal address.

EINTR
    A signal was caught during the sam_release() function.

ELOOP
    Too many symbolic links were encountered in translating path.

EMULTIHOP
    Components of path require hopping to multiple remote machines and the file system does not allow it.

ENAMETOOLONG
    The length of the path argument exceeds {PATH_MAX}, or the length of a path component exceeds {NAME_MAX} while {_POSIX_NO_TRUNC} is in effect.

ENOENT
    The named file does not exist or is the null pathname.

ENOLINK
    path points to a remote machine and the link to that machine is no longer active.

ENOTDIR
    A component of the path prefix is not a directory.

ENOTSUP
    License does not support option.

SEE ALSO
release(1), ssum(1).

sam_ssum(3).