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

Volume Handler
[MNT daemon]

Handle Volume objects. More...

Functions

PVOLUME new_Volume (const char *udi, const char *base, const char *prefix)
 Generate new Volume Object.
int mntd_volume_init (PVOLUME pv)
 Constructor.
void mntd_volume_destroy (PVOLUME pv)
 Destructor.
void mntd_volume_to_string (PVOLUME pv)
 Show Device Info.
int mntd_volume_set_device (PVOLUME pv, const char *device)
 Set device name.
char * mntd_volume_get_device (PVOLUME pv)
 Get device name.
int mntd_volume_set_mntpnt (PVOLUME pv, const char *mntpnt)
 Set device mount point.
char * mntd_volume_get_mntpnt (PVOLUME pv)
 Get device mount point.
int mntd_volume_set_fstype (PVOLUME pv, const char *fstype)
 Set device mount point.
char * mntd_volume_get_fstype (PVOLUME pv)
 Get device filesystem name.
int mntd_volume_mount (PVOLUME pv)
 Mount device.
int mntd_volume_umount (PVOLUME pv)
 Unmount device.
int mntd_volume_remount (PVOLUME pv, int flag)
 Remount specific mount point rd/rw.
char * mntd_volume_g_build_mntpnt (PVOLUME pv, const char *base, const char *prefix)
 Helper: Build mount point path.
int mntd_volume_helper_base_is_in_mntpath (const char *base, const char *mntpnt)
 Check, if base is part of mntpnt.
int mntd_volume_is_in_mntpath (PVOLUME pv)
 Check, if volume is in mount path.
int mntd_volume_send_mounted (PVOLUME pv)
 Send mounted signal to processes listing to dbus.
int mntd_volume_send_unmounted (PVOLUME pv)
 Send unmounted signal to processes listing to dbus.
int mntd_volume_send_signal (PVOLUME pv, int what)
 Send signal to processes listing to dbus.

Detailed Description

Handle Volume objects.


Function Documentation

void mntd_volume_destroy PVOLUME  pv  ) 
 

Destructor.

Parameters:
pv Pointer to Volume Object

Definition at line 189 of file mntd_volume.c.

References VOLUME_::base, MNTDDATA_::configdata, VOLUME_::device, VOLUME_::fstype, VOLUME_::mntpnt, VOLUME_::prefix, VOLUME_::remount, VOLUME_::udi, VOLUME_::umount, and ConfigData::umount_on_exit.

char * mntd_volume_get_device PVOLUME  pv  ) 
 

Get device name.

String within device name will be copied (with strdup), so you have to free it.

Parameters:
pv Pointer to Volume Object
Returns:
Name of device if already set, or NULL otherwise

Definition at line 331 of file mntd_volume.c.

char * mntd_volume_get_fstype PVOLUME  pv  ) 
 

Get device filesystem name.

String within filesystem name will be copied (with strdup), so you have to free it.

Parameters:
pv Pointer to Volume Object
Returns:
fstype if already set, or NULL otherwise

Definition at line 481 of file mntd_volume.c.

char * mntd_volume_get_mntpnt PVOLUME  pv  ) 
 

Get device mount point.

String within mount point will be copied (with strdup), so you have to free it.

Parameters:
pv Pointer to Volume Object
Returns:
mount point if already set, or NULL otherwise

Definition at line 412 of file mntd_volume.c.

int mntd_volume_mount PVOLUME  pv  ) 
 

Mount device.

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

Definition at line 499 of file mntd_volume.c.

References VOLUME_::_send_signal, mntd_mount_mount(), mntd_volume_g_build_mntpnt(), MSG_ERR, MSG_INF, sb_dir_is_dir(), sb_dir_mkdirs(), sb_dir_remove(), sb_dir_rmdirs(), and VOLUME_::set_mntpnt.

int mntd_volume_remount PVOLUME  pv,
int  flag
 

Remount specific mount point rd/rw.

Parameters:
pv Pointer to Volume Object
flag MOUNT_RD | MOUNT_RW
Returns:
0 if successful, -1 otherwise

Definition at line 657 of file mntd_volume.c.

References mntd_mount_remount_rd(), and mntd_mount_remount_rw().

int mntd_volume_set_device PVOLUME  pv,
const char *  device
 

Set device name.

Parameters:
pv Pointer to Volume Object
device Name of device
Returns:
0 if successful, -1 otherwise

Definition at line 278 of file mntd_volume.c.

References VOLUME_::device, VOLUME_::mount, and MSG_DEBUG.

int mntd_volume_set_fstype PVOLUME  pv,
const char *  fstype
 

Set device mount point.

Parameters:
pv Pointer to Volume Object
fstype Set filesystem name
Returns:
0 if successful, -1 otherwise

Definition at line 431 of file mntd_volume.c.

References VOLUME_::fstype.

int mntd_volume_set_mntpnt PVOLUME  pv,
const char *  mntpnt
 

Set device mount point.

Parameters:
pv Pointer to Volume Object
mntpnt Mount point
Returns:
0 if successful, -1 otherwise

Definition at line 350 of file mntd_volume.c.

References VOLUME_::_send_signal, VOLUME_::mntpnt, and MSG_DEBUG.

void mntd_volume_to_string PVOLUME  pv  ) 
 

Show Device Info.

Parameters:
pv Pointer to Volume Object

Definition at line 255 of file mntd_volume.c.

References MSG_DEBUG.

int mntd_volume_umount PVOLUME  pv  ) 
 

Unmount device.

Unmount device, if it is mounted by mntd, or if it's mounted in the path mntd is responsible for. So be careful, what you mount manually and don't want to be unmounted by mntd. Default is "/mnt/mntd" path, so your normal devices on "/mnt" will not be touched.

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

Definition at line 587 of file mntd_volume.c.

References VOLUME_::_send_signal, VOLUME_::get_mntpnt, mntd_mount_umount(), MSG_ERR, MSG_INF, sb_dir_remove(), VOLUME_::set_fstype, and VOLUME_::set_mntpnt.

PVOLUME new_Volume const char *  udi,
const char *  base,
const char *  prefix
 

Generate new Volume Object.

Parameters:
udi Volumes unique identifier
base Basepath for mount point
prefix Prefix for mount point directory
Returns:
Pointer to Volume object, NULL if error

Definition at line 86 of file mntd_volume.c.

References VOLUME_::_send_mounted, VOLUME_::_send_signal, VOLUME_::_send_unmounted, VOLUME_::base, VOLUME_::destroy, VOLUME_::get_device, VOLUME_::get_fstype, VOLUME_::get_mntpnt, VOLUME_::init, VOLUME_::is_in_mntpath, VOLUME_::mount, VOLUME_::prefix, VOLUME_::remount, VOLUME_::set_device, VOLUME_::set_fstype, VOLUME_::set_mntpnt, VOLUME_::to_string, VOLUME_::udi, and VOLUME_::umount.

Referenced by mntd_volume_manager_add_volume().


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