Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

File system reservations and file system quotas

The IFSReserve interface allows applications to reserve a minimal space for a set of file system paths (a group). Quotas can also be set, which specify the maximum amount of space a group can use.

Manufacturers can define their own groups using the FSReserveGroup system resource in any system CIF. Manufacturers can also use the FSReserveGroup resource to specify privileges required, if needed. For example:

FSReserveGroup {
   group = AEEUID_BrewFileReserve,
   required_privs = {AEEUID_BrewFileReserveModify}, 
}

To support multiple groups, manufacturers need to modify cs/src/OEM/OEMFS/msm/OEMefs.c..

An application can use file system reservations as follows:

  1. Get the group ID for the path by calling IFSReserve_GetGroup().
  2. Set the reservation by calling IFSReserve_SetReservation(), specifying the path, amount of space to reserve (in bytes), and the group ID.
  3. Add paths to the reservation by calling IFSReserve_SetGroup().

    Existing files and directories should be added to the group individually. Files and directories created under a directory that is part of a group are automatically added to that group.

  4. Optionally set a quota for the group by calling IFSReserve_SetQuota(), specifying the maximum amount of space in bytes.

A path can be removed from a reservation group by setting it to group zero.

For more information on IFSReserve functions, see the http://developer.brewmp.com/reference/api-all.