# lib/fs.c File Reference

`#include "system.h"`
`#include <rpmlib.h>`
`#include <rpmmacro.h>`
`#include "debug.h"`

Go to the source code of this file.

## Data Structures

struct | fsinfo

## Functions

void | freeFilesystems (void)
| Release storage used by file system usage cache.
static int | getFilesystemList (void)
| Get information for mounted file systems.
int | rpmGetFilesystemList (const char ***listptr, int *num)
| Return (cached) file system mount points.
int | rpmGetFilesystemUsage (const char **fileList, int_32 *fssizes, int numFiles, uint_32 **usagesPtr, int flags)
| Determine per-file system usage for a list of files.

## Variables

static struct fsinfo * | filesystems = NULL
static const char ** | fsnames = NULL
static int | numFilesystems = 0

## Detailed Description

Definition in file fs.c.

## Function Documentation

void freeFilesystems | ( | void |  | ) |

Release storage used by file system usage cache.

Definition at line 26 of file fs.c.

static int getFilesystemList | ( | void |  | ) | `[static]`

Get information for mounted file systems.

Todo:
  determine rdonly for non-linux file systems.

Returns:
  0 on success, 1 on error

Definition at line 137 of file fs.c.

int rpmGetFilesystemList | ( | const char *** | listptr,
|  | int * | num |
| ) |  |  |

Return (cached) file system mount points.

Return values:

  | listptr | addess of file system names (or NULL)
  | num | address of number of file systems (or NULL)

Returns:
  0 on success, 1 on error

Definition at line 231 of file fs.c.

int rpmGetFilesystemUsage | ( | const char ** | fileList,
|  | int_32 * | fssizes,
|  | int | numFiles,
|  | uint_32 ** | usagesPtr,
|  | int | flags |
| ) |  |  |

Determine per-file system usage for a list of files.

Parameters:

  | fileList | array of absolute file names
  | fssizes | array of file sizes
  | numFiles | number of files in list

Return values:

  | usagesPtr | address of per-file system usage array (or NULL)

Parameters:

  | flags | (unused)

Returns:
  0 on success, 1 on error

Definition at line 243 of file fs.c.

## Variable Documentation

struct fsinfo* filesystems = NULL`[static]`

Definition at line 20 of file fs.c.

const char** fsnames = NULL`[static]`

Definition at line 22 of file fs.c.

int numFilesystems = 0`[static]`

Definition at line 24 of file fs.c.