c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen#ifndef MOUNTPOINT_H
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen#define MOUNTPOINT_H
b494ffed8ded8d170d9ace3dc607b1d278048241Timo Sirainen
b494ffed8ded8d170d9ace3dc607b1d278048241Timo Sirainenstruct mountpoint {
b494ffed8ded8d170d9ace3dc607b1d278048241Timo Sirainen char *device_path;
b494ffed8ded8d170d9ace3dc607b1d278048241Timo Sirainen char *mount_path;
b494ffed8ded8d170d9ace3dc607b1d278048241Timo Sirainen char *type;
7c7d2244502af05f77c74736dc1aec0123fdba80Timo Sirainen dev_t dev;
7c7d2244502af05f77c74736dc1aec0123fdba80Timo Sirainen unsigned int block_size; /* may not be set for iteration */
b494ffed8ded8d170d9ace3dc607b1d278048241Timo Sirainen};
b494ffed8ded8d170d9ace3dc607b1d278048241Timo Sirainen
9446c7a5d400cba60d097c528bd08312552438e3Timo Sirainen/* Returns 1 = found, 0 = not found (from mount tabs, or the path itself),
9446c7a5d400cba60d097c528bd08312552438e3Timo Sirainen -1 = error */
b494ffed8ded8d170d9ace3dc607b1d278048241Timo Sirainenint mountpoint_get(const char *path, pool_t pool, struct mountpoint *point_r);
b494ffed8ded8d170d9ace3dc607b1d278048241Timo Sirainen
7c7d2244502af05f77c74736dc1aec0123fdba80Timo Sirainen/* Iterate through mountpoints */
7c7d2244502af05f77c74736dc1aec0123fdba80Timo Sirainenstruct mountpoint_iter *mountpoint_iter_init(void);
7c7d2244502af05f77c74736dc1aec0123fdba80Timo Sirainen/* Returns the next mountpoint or NULL if there are no more. */
7c7d2244502af05f77c74736dc1aec0123fdba80Timo Sirainenconst struct mountpoint *mountpoint_iter_next(struct mountpoint_iter *iter);
7c7d2244502af05f77c74736dc1aec0123fdba80Timo Sirainen/* Returns 0 if mountpoints were iterated successfully, -1 if it failed. */
7c7d2244502af05f77c74736dc1aec0123fdba80Timo Sirainenint mountpoint_iter_deinit(struct mountpoint_iter **iter);
7c7d2244502af05f77c74736dc1aec0123fdba80Timo Sirainen
b494ffed8ded8d170d9ace3dc607b1d278048241Timo Sirainen#endif