mountpoint.h revision 7c7d2244502af05f77c74736dc1aec0123fdba80
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen#ifndef MOUNTPOINT_H
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen#define MOUNTPOINT_H
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainenstruct mountpoint {
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainen char *device_path;
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen char *mount_path;
5666a3d6a7ea89362b8d9e8b39b15424cd9d6388Timo Sirainen char *type;
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen dev_t dev;
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen unsigned int block_size; /* may not be set for iteration */
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen};
573f0491a5733fe21fa062a455acb4790b4e0499Timo Sirainen
573f0491a5733fe21fa062a455acb4790b4e0499Timo Sirainen/* Returns 1 = found, 0 = not found (from mount tabs, or the path itself),
573f0491a5733fe21fa062a455acb4790b4e0499Timo Sirainen -1 = error */
3ed2d0f6b5e67e2663d44489d9da3176823789a8Timo Sirainenint mountpoint_get(const char *path, pool_t pool, struct mountpoint *point_r);
65f8fb656051f1059f7b5a2da9c5555adcc30439Timo Sirainen
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen/* Iterate through mountpoints */
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainenstruct mountpoint_iter *mountpoint_iter_init(void);
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen/* Returns the next mountpoint or NULL if there are no more. */
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainenconst struct mountpoint *mountpoint_iter_next(struct mountpoint_iter *iter);
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen/* Returns 0 if mountpoints were iterated successfully, -1 if it failed. */
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainenint mountpoint_iter_deinit(struct mountpoint_iter **iter);
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen#endif
fdc557286bc9f92c5f3bb49096ff6e2bcec0ea79Timo Sirainen