dm-uevent.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Device Mapper Uevent Support
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms of the GNU General Public License as published by the
  6. * Free Software Foundation; either version 2 of the License, or (at your
  7. * option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along
  15. * with this program; if not, write to the Free Software Foundation, Inc.,
  16. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. *
  18. * Copyright IBM Corporation, 2007
  19. * Author: Mike Anderson <andmike@linux.vnet.ibm.com>
  20. */
  21. #ifndef DM_UEVENT_H
  22. #define DM_UEVENT_H
  23. enum dm_uevent_type {
  24. DM_UEVENT_PATH_FAILED,
  25. DM_UEVENT_PATH_REINSTATED,
  26. };
  27. #ifdef CONFIG_DM_UEVENT
  28. extern int dm_uevent_init(void);
  29. extern void dm_uevent_exit(void);
  30. extern void dm_send_uevents(struct list_head *events, struct kobject *kobj);
  31. extern void dm_path_uevent(enum dm_uevent_type event_type,
  32. struct dm_target *ti, const char *path,
  33. unsigned nr_valid_paths);
  34. #else
  35. static inline int dm_uevent_init(void)
  36. {
  37. return 0;
  38. }
  39. static inline void dm_uevent_exit(void)
  40. {
  41. }
  42. static inline void dm_send_uevents(struct list_head *events,
  43. struct kobject *kobj)
  44. {
  45. }
  46. static inline void dm_path_uevent(enum dm_uevent_type event_type,
  47. struct dm_target *ti, const char *path,
  48. unsigned nr_valid_paths)
  49. {
  50. }
  51. #endif /* CONFIG_DM_UEVENT */
  52. #endif /* DM_UEVENT_H */