stackglue.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* -*- mode: c; c-basic-offset: 8; -*-
  2. * vim: noexpandtab sw=8 ts=8 sts=0:
  3. *
  4. * stackglue.h
  5. *
  6. * Glue to the underlying cluster stack.
  7. *
  8. * Copyright (C) 2007 Oracle. All rights reserved.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public
  12. * License as published by the Free Software Foundation, version 2.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. */
  19. #ifndef STACKGLUE_H
  20. #define STACKGLUE_H
  21. #include <linux/types.h>
  22. #include <linux/list.h>
  23. #include <linux/dlmconstants.h>
  24. /*
  25. * dlmconstants.h does not have a LOCAL flag. We hope to remove it
  26. * some day, but right now we need it. Let's fake it. This value is larger
  27. * than any flag in dlmconstants.h.
  28. */
  29. #define DLM_LKF_LOCAL 0x00100000
  30. #include "dlm/dlmapi.h"
  31. struct ocfs2_locking_protocol {
  32. void (*lp_lock_ast)(void *astarg);
  33. void (*lp_blocking_ast)(void *astarg, int level);
  34. void (*lp_unlock_ast)(void *astarg, int error);
  35. };
  36. union ocfs2_dlm_lksb {
  37. struct dlm_lockstatus lksb_o2dlm;
  38. };
  39. int ocfs2_dlm_lock(struct dlm_ctxt *dlm,
  40. int mode,
  41. union ocfs2_dlm_lksb *lksb,
  42. u32 flags,
  43. void *name,
  44. unsigned int namelen,
  45. void *astarg);
  46. int ocfs2_dlm_unlock(struct dlm_ctxt *dlm,
  47. union ocfs2_dlm_lksb *lksb,
  48. u32 flags,
  49. void *astarg);
  50. int ocfs2_dlm_lock_status(union ocfs2_dlm_lksb *lksb);
  51. void *ocfs2_dlm_lvb(union ocfs2_dlm_lksb *lksb);
  52. void o2cb_get_stack(struct ocfs2_locking_protocol *proto);
  53. void o2cb_put_stack(void);
  54. #endif /* STACKGLUE_H */