kafstimod.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* kafstimod.h: AFS timeout daemon
  2. *
  3. * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #ifndef _LINUX_AFS_KAFSTIMOD_H
  12. #define _LINUX_AFS_KAFSTIMOD_H
  13. #include "types.h"
  14. struct afs_timer;
  15. struct afs_timer_ops {
  16. /* called when the front of the timer queue has timed out */
  17. void (*timed_out)(struct afs_timer *timer);
  18. };
  19. /*****************************************************************************/
  20. /*
  21. * AFS timer/timeout record
  22. */
  23. struct afs_timer
  24. {
  25. struct list_head link; /* link in timer queue */
  26. unsigned long timo_jif; /* timeout time */
  27. const struct afs_timer_ops *ops; /* timeout expiry function */
  28. };
  29. static inline void afs_timer_init(struct afs_timer *timer,
  30. const struct afs_timer_ops *ops)
  31. {
  32. INIT_LIST_HEAD(&timer->link);
  33. timer->ops = ops;
  34. }
  35. extern int afs_kafstimod_start(void);
  36. extern void afs_kafstimod_stop(void);
  37. extern void afs_kafstimod_add_timer(struct afs_timer *timer,
  38. unsigned long timeout);
  39. extern int afs_kafstimod_del_timer(struct afs_timer *timer);
  40. #endif /* _LINUX_AFS_KAFSTIMOD_H */