lib/fs.c File Reference

#include "system.h"
#include <rpmio.h>
#include <rpmlog.h>
#include <rpmmacro.h>
#include "fs.h"
#include "debug.h"
Include dependency graph for fs.c:

Go to the source code of this file.

Data Structures

struct  fsinfo

Functions

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

Variables

static struct fsinfofilesystems = NULL
static const char ** fsnames = NULL
static int numFilesystems = 0

Detailed Description

Definition in file fs.c.


Function Documentation

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 141 of file fs.c.

References _, _free(), fsinfo::dev, errno, fsnames, getmntent(), fsinfo::mntPoint, MOUNTED, numFilesystems, our_mntent::our_mntdir, fsinfo::rdonly, rpmFreeFilesystems(), rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, xcalloc(), xrealloc(), and xstrdup().

Referenced by rpmGetFilesystemList(), and rpmGetFilesystemUsage().

void rpmFreeFilesystems ( void   ) 

Release storage used by file system usage cache.

Definition at line 32 of file fs.c.

References _free(), fsnames, fsinfo::mntPoint, and numFilesystems.

Referenced by getFilesystemList(), and rpmcliFini().

int rpmGetFilesystemList ( const char ***  listptr,
uint32_t *  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 271 of file fs.c.

References fsnames, getFilesystemList(), and numFilesystems.

Referenced by fsnamesTag(), fssizesTag(), and rpmtsInitDSI().

int rpmGetFilesystemUsage ( const char **  fileList,
uint32_t *  fssizes,
int  numFiles,
uint64_t **  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 283 of file fs.c.

References _, _free(), alloca(), dirName, errno, fsnames, getFilesystemList(), numFilesystems, rpmGetPath(), rpmlog(), RPMLOG_ERR, and xcalloc().

Referenced by fssizesTag().


Variable Documentation

struct fsinfo* filesystems = NULL [static]

Definition at line 25 of file fs.c.

const char** fsnames = NULL [static]
int numFilesystems = 0 [static]
Generated on Wed Jun 30 22:48:04 2010 for rpm by  doxygen 1.6.3