Main Page | Modules | Data Structures | File List | Data Fields | Related Pages

Volume Manager Handler
[MNT daemon]

Manage Volumes in maps. More...

Functions

PVOLUMEMANAGER new_VolumeManager (const char *base, const char *prefix)
 Generate new Volume Manager Object.
int mntd_volume_manager_init (PVOLUMEMANAGER pvm)
 Constructor.
void mntd_volume_manager_destroy (PVOLUMEMANAGER pvm)
 Destructor.
void mntd_volume_manager_func_free (void *userdata)
 Callback function for freeing memory for Volume object.
void mntd_volume_manager_add_volume (PVOLUMEMANAGER pvm, const char *udi)
 Add volume to manager.
void mntd_volume_manager_remove_volume (PVOLUMEMANAGER pvm, const char *udi)
 Remove volume from manager.
void mntd_volume_manager_rescan (PVOLUMEMANAGER pvm)
 Rescan devices.
void mntd_volume_manager_foreach_mounted (PVOLUMEMANAGER pvm, int(*func)(void *data, void *userdata), void *userdata)
 call function for each mounted volume
char * mntd_volume_manager_get_mntpnt (PVOLUMEMANAGER pvm, const char *udi)
 Get specific mount point.
int mntd_volume_manager_contains (PVOLUMEMANAGER pvm, const char *udi)
 Check if given volume exists.
int mntd_volume_manager_remount (PVOLUMEMANAGER pvm, const char *udi, int flag)
 Remount specific mount point rd/rw.

Detailed Description

Manage Volumes in maps.


Function Documentation

void mntd_volume_manager_add_volume PVOLUMEMANAGER  pvm,
const char *  udi
 

Add volume to manager.

Parameters:
pvm Pointer to Volume Manager Object
udi udi (key) of object

Definition at line 227 of file mntd_volume_manager.c.

References HASHMAP_::destroy, MSG_WARNING, and new_Volume().

int mntd_volume_manager_contains PVOLUMEMANAGER  pvm,
const char *  udi
 

Check if given volume exists.

Parameters:
pvm Pointer to Volume Manager Object
udi udi (key) of object
Returns:
1 if found, 0 otherwise

Definition at line 366 of file mntd_volume_manager.c.

References HASHMAP_::contains.

void mntd_volume_manager_destroy PVOLUMEMANAGER  pvm  ) 
 

Destructor.

Parameters:
pvm Pointer to Volume Manager Object

Definition at line 166 of file mntd_volume_manager.c.

References HASHMAP_::destroy.

void mntd_volume_manager_foreach_mounted PVOLUMEMANAGER  pvm,
int(*)(void *data, void *userdata)  func,
void *  userdata
 

call function for each mounted volume

Parameters:
pvm Pointer to Volume Manager Object
func Pointer to callback function
userdata userdata pointer that will be passed to callback function

Definition at line 308 of file mntd_volume_manager.c.

References HASHMAP_::foreach.

void mntd_volume_manager_func_free void *  userdata  ) 
 

Callback function for freeing memory for Volume object.

Parameters:
userdata Pointer userdata

Definition at line 203 of file mntd_volume_manager.c.

References VOLUME_::destroy.

Referenced by new_VolumeManager().

char * mntd_volume_manager_get_mntpnt PVOLUMEMANAGER  pvm,
const char *  udi
 

Get specific mount point.

Parameters:
pvm Pointer to Volume Manager Object
udi udi (key) of object
Returns:
Mount point, or NULL if error

Definition at line 331 of file mntd_volume_manager.c.

References VOLUME_::get_mntpnt.

int mntd_volume_manager_init PVOLUMEMANAGER  pvm  ) 
 

Constructor.

Parameters:
pvm Pointer to Volume Manager Object
Returns:
0 if successful, -1 otherwise

Definition at line 154 of file mntd_volume_manager.c.

int mntd_volume_manager_remount PVOLUMEMANAGER  pvm,
const char *  udi,
int  flag
 

Remount specific mount point rd/rw.

Parameters:
pvm Pointer to Volume Manager Object
udi udi (key) of object
flag MOUNT_RD | MOUNT_RW
Returns:
0 if successful, -1 otherwise

Definition at line 386 of file mntd_volume_manager.c.

References VOLUME_::remount.

void mntd_volume_manager_remove_volume PVOLUMEMANAGER  pvm,
const char *  udi
 

Remove volume from manager.

Parameters:
pvm Pointer to Volume Manager Object
udi udi (key) of object

Definition at line 264 of file mntd_volume_manager.c.

References HASHMAP_::remove.

void mntd_volume_manager_rescan PVOLUMEMANAGER  pvm  ) 
 

Rescan devices.

Parameters:
pvm Pointer to Volume Manager Object

Definition at line 291 of file mntd_volume_manager.c.

References MSG_ERR.

PVOLUMEMANAGER new_VolumeManager const char *  base,
const char *  prefix
 

Generate new Volume Manager Object.

Parameters:
base Basepath for mountpath
prefix Prefix for mountpath
Returns:
Pointer to Volume Manager object, NULL if error

Definition at line 78 of file mntd_volume_manager.c.

References HASHMAP_::contains, DEFAULT_BUCKETS, HASHMAP_::destroy, HASHMAP_::init, mntd_volume_manager_func_free(), and new_HashMap().

Referenced by main().


Generated on Wed Mar 30 13:43:27 2005 for Mntd by  doxygen 1.3.9.1