I'm trying to find a SDK call similar to what OnTAP CLI 'maxfiles' does.
filer> maxfiles etng_done Volume etng_done: maximum number of files is currently 174999984 (144602284 used).
I found a 'volume-list-info' API, it looks like what I need, but it doesn't generate exactly the same output:
<files-total>174999984</files-total> // This is current max value from 'maxfiles' output <files-used>144607960</files-used> // This is not exactly the same value as in 'maxfiles' output <files-private-used>513</files-private-used> <inodefile-public-capacity>174999984</inodefile-public-capacity> // This is current max value from 'maxfiles' output <inodefile-private-capacity>31142</inodefile-private-capacity> ...
So my question is how do I get "files used" of 'maxfiles' output via SDK API?
It is interesting that the manpage for maxfiles doesn't state anything about used files:
maxfiles increases the number of files that a volume can hold, as close as possible to max. File inodes are stored in blocks, and the filer may round the requested max number of files to the nearest block.
Once increased, the value of max can never be lowered, so the new value must be larger than the current value.
The value cannot be changed for a flexcache volume.
If no argument is specified, maxfiles displays the current value of max for all volumes in the system. If just the vol_name argument is given, the current value of max for the specified volume is displayed. For a flexcache volume, the origin volume's value is displayed.
Because each allowable file consumes disk space, and because the value of max can never be reduced, increasing max consumes disk space permanently. Increasing the max number of files to a large value can also result in less available memory after an upgrade. This means, you might not be able to run WAFL_check. If maxfiles identifies a new size as unreasonably large, it queries the user to verify that the new value is correct.
The filer's df command (see na_df(1)) can be used to determine how many files have currently been created in the file system.
I would compare if the df information matches the API information. The used files in the maxfiles could be a hold-over.