Veritas™ File System Programmer's Reference Guide - Solaris

Last Published:
Product(s): InfoScale & Storage Foundation (7.2)
Platform: Solaris
  1. Veritas File System software developer's kit
    1.  
      About the software developer's kit
    2. File System software developer's kit features
      1.  
        API library interfaces
      2.  
        File Change Log
      3.  
        Multi-volume support
      4.  
        Veritas File System I/O
    3.  
      Software developer's kit packages
    4.  
      Required libraries and header files
    5. Compiling environment
      1.  
        Recompiling with a different compiler
  2. File Change Log
    1. About the File Change Log file
      1.  
        Recorded changes
      2. Using the File Change Log file
        1.  
          Space usage
        2.  
          Full system scan reductions
        3.  
          File history traces
      3.  
        File Change Log logging activation
      4. File Change Log file layout
        1.  
          File Change Log superblock
        2.  
          File Change Log record
    2. Record types
      1.  
        Special records
      2.  
        Typical record sequences
    3. File Change Log tunables
      1.  
        How tunables handle File Change Log growth size
    4. Application programming interface for File Change Log
      1.  
        Ease of use
      2.  
        Backward compatibility
      3. API functions
        1.  
          Functions for accessing File Change Log records
        2.  
          Functions for seeking offsets and time stamps in the File Change Log
        3. vxfs_fcl_open
          1.  
            Return value
        4. vxfs_fcl_close
          1.  
            Parameters
        5. vxfs_fcl_getinfo
          1.  
            Return values
        6. vxfs_fcl_read
          1.  
            Parameters
          2.  
            Input
          3.  
            Output
          4.  
            Return values
        7. vxfs_fcl_getcookie
          1.  
            Parameters
        8. vxfs_fcl_seek
          1.  
            Parameters
          2.  
            Return values
        9. vxfs_fcl_seektime
          1.  
            Parameters
          2.  
            Return values
        10. vxfs_fcl_sync
          1.  
            Parameters
      4. File Change Log record
        1.  
          Defines
        2.  
          fcl_iostats structure
        3.  
          fcl_acsinfo structure
        4.  
          Record structure fields
      5. Copying File Change Log records
        1.  
          Index maintenance application
        2. Computing a usage profile
          1.  
            Initial setup
          2.  
            Sample steps
          3.  
            Off host processing
      6. Veritas File System and File Change Log upgrade and downgrade
        1.  
          Converting File Change Log version 3 files to version 4
        2.  
          Downgrading Veritas File System versions
    5. Reverse path name lookup
      1.  
        Inodes
      2.  
        vxfs_inotopath_gen
  3. Multi-volume support
    1.  
      About multi-volume support
    2.  
      Uses for multi-volume support
    3. Volume application programming interfaces
      1.  
        Administering volume sets
      2.  
        Querying the volume set for a file system
      3.  
        Modifying a volume within a file system
      4.  
        Encapsulationg and de-encapsulating a volume
    4. Allocation policy application programming interfaces
      1.  
        Directing file allocations
      2.  
        Creating and assigning policies
      3.  
        Querying the defined policies
      4.  
        Enforcing a policy
    5.  
      Data structures
    6. Using policies and application programming interfaces
      1.  
        Defining and assigning allocation policies
      2.  
        Using volume application programming interfaces
  4. Named data streams
    1.  
      About named data streams
    2.  
      Uses for named data streams
    3.  
      Named data streams application programming interface
    4.  
      Listing named data streams
    5.  
      Namespace for named data streams
    6.  
      Behavior changes in other system calls
    7.  
      Querying named data streams
    8.  
      Application programming interface
    9.  
      Command reference
  5. Veritas File System I/O
    1.  
      About Veritas File System I/O
    2.  
      Freeze and thaw
    3. Caching advisories
      1.  
        Direct I/O
      2.  
        Concurrent I/O
      3.  
        Unbuffered I/O
      4.  
        Other advisories
    4. Extents
      1. Extent attributes
        1.  
          Attribute specifics
      2.  
        Reservation: preallocating space to a file
      3.  
        Fixed extent size
      4.  
        Application programming interface for extent attributes
      5. Allocation flags
        1.  
          Allocation flags with reservation
        2.  
          Reservation trimming
        3.  
          Non-persistent reservation
        4.  
          No write beyond reservation
        5.  
          Contiguous reservation
        6.  
          Include reservation in the file size
        7.  
          Reading the grown part of the file
      6.  
        Allocation flags with fixed extent size
      7.  
        How to use extent attribute APIs
      8.  
        Setting fixed extent size
  6. Thin Reclamation
    1.  
      About Thin Storage
    2.  
      About Thin Reclamation
    3. Thin Reclamation application programming interface
      1.  
        vxfs_ts_reclaim return values

Freeze and thaw

Freezing a file system temporarily blocks all I/O operations to a file system and then performs a sync on the file system. Current operations are completed and the file system is synchronized to disk. Freezing a file system is a necessary step for obtaining a stable and consistent image of the file system at the volume level.

Consistent volume-level file system images can be obtained and used with a file system snapshot tool. The freeze operation flushes all buffers and pages in the file system cache that contain dirty metadata and user data. The operation then suspends any new activity on the file system until the file system is thawed.

VxFS provides ioctl interfaces to application programs to freeze and thaw VxFS file systems. The interfaces are VX_FREEZE, VX_FREEZE_ALL, and VX_THAW.

The VX_FREEZE ioctl operates on a single file system. The program performing this ioctl can freeze the specified file system and block any attempts to access the file system until it is thawed. The file system thaws after the timeout value that is specified with the VX_FREEZE ioctl has expired, or the VX_THAW ioctl is operated on the file system.

The VX_THAW ioctl operates on a frozen file system. It can be used to thaw the specified file system before the freeze timeout period has elapsed.

The VX_FREEZE_ALL ioctl interface freezes one or more file systems. The VX_FREEZE_ALL ioctl operates in an atomic fashion when there are multiple file systems specified with a freeze operation. VxFS blocks access to the specified file systems simultaneously and disallows a user-initiated write operation that may modify more than one file system with a single write operation. Because VX_FREEZE_ALL can be used with a single file system, VX_FREEZE_ALL is the preferred interface over the VX_FREEZE ioctl.

Executing the VX_FREEZE or VX_FREEZE_ALL ioctls results in a clean file system image that can be mounted after the image is split off from the file system device. In response to a freeze request, all modified file system metadata is flushed to disk with no pending file system transactions in the log that must be replayed before mounting the split off image.

Both the VX_FREEZE and VX_FREEZE_ALL interfaces can be used to freeze locally mounted file systems, or locally or remotely mounted cluster file systems.

The following table shows freeze/thaw compatibility with VxFS releases:

Table: Freeze/thaw compatibility with VxFS releases

VxFS 3.5

VxFS 4.0

VxFS 4.1

VxFS 5.0 and later

VX_FREEZE

Local File System

Local File System

Cluster File System

Local File System

Cluster File System

Local File System

Cluster File System

VX_FREEZE_ALL

Local File System

Local File System

Local File System

Cluster File System

Local File System

Cluster File System

When freezing a file system, care should be taken with choosing a reasonable time-out value for the freeze to reduce impact to external resources targeting the file system. User or system processes and resources are blocked while the file system is frozen. If the specified timeout value is too large, resources are blocked for an extended period of time.

During a file system freeze, any attempt to get a file descriptor from the root directory of the file system for use with the VX_THAW ioctl causes the calling process to be blocked as the result of the frozen state of the file system. The file descriptor must be acquired before issuing the VX_FREEZE_ALL or VX_FREEZE ioctl.

Use the VX_THAW ioctl to thaw file systems that were frozen with the VX_FREEZE_ALL ioctl before the timeout period has expired.

The programming interface is as follows:

include <sys/fs/vx_ioctl.h>
int             timeout;
int             vxfs_fd;
/*
 * A common mistake is to pass the address of "timeout".
 * Do not pass the address of timeout, as that would be
 * interpreted as a very long timeout period
 */
 if (ioctl(vxfs_fd, VX_FREEZE, timeout))
   {perror("ERROR: File system freeze failed");
}

For multiple file systems:

int              vxfs_fd[NUM_FILE_SYSTEMS];
struct           vx_freezeall freeze_info;
freeze_info.num = NUM_FILE_SYSTEMS
freeze_info.timeout = timeout;
freeze_info.fds = &vxfs_fd[0];
if (ioctl(vxfs_fd[0], VX_FREEZE_ALL, &freeze_info))
   {perror("ERROR: File system freeze failed");
}
for (i = 0; i < NUM_FILE_SYSTEMS; i++)
    if (ioctl(vxfs_fd[i], VX_THAW, NULL))
       {perror("ERROR: File system thaw failed");
    }