Class FuseFS::StatsHelper
In: lib/fuse/fusedir.rb
Parent: Object

Helper for filesystem accounting

Methods

adjust   new   to_statistics  

Attributes

max_nodes  [RW]  @return [Integer] maximum number of (virtual) inodes
max_space  [RW]  @return [Integer] size of filesystem in bytes
nodes  [R]  @return [Integer] used inodes (typically count of files and directories)
space  [R]  @return [Integer] used space in bytes
strict  [RW]  If set true, adjustments that cause space/nodes to exceed the maximums will raise ENOSPC (no space left on device) @return [Boolean]

Public Class methods

@param [Integer] max_space @param [Integer] max_nodes @param [Booleanr] strict

Public Instance methods

Adjust accumlated statistics @param [Integer] delta_space change in {space} usage @param [Integer] delta_nodes change in {nodes} usage

@return [void] @raise [Errno::ENOSPC] if {strict} and adjusted {space}/{nodes} would exceed {max_space} or {max_nodes}

@overload to_statistics()

  @return [Array<Integer>] in format expected by {FuseDir#statistics}

@overload to_statistics(free_space,free_nodes)

  Calculate total space so that free space remains fixed
  @param [Integer] free_space available space in bytes
  @param [Integer] free_nodes available (virtual) inodes
  @return [Array<Integer>] in format expected by {FuseDir#statistics}

[Validate]