/core/10.4/fusefs/fuse_nodehash.h

http://macfuse.googlecode.com/ · C++ Header · 74 lines · 42 code · 11 blank · 21 comment · 0 complexity · 9f4e10bd3ad82ede3d3f828a90a862c9 MD5 · raw file

  1. /*
  2. * Copyright (C) 2006-2008 Google. All Rights Reserved.
  3. * Amit Singh <singh@>
  4. */
  5. /*
  6. * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
  7. *
  8. * This file contains Original Code and/or Modifications of Original Code as
  9. * defined in and that are subject to the Apple Public Source License Version
  10. * 2.0 (the 'License'). You may not use this file except in compliance with
  11. * the License. Please obtain a copy of the License at
  12. * http://www.opensource.apple.com/apsl/ and read it before using this file.
  13. *
  14. * The Original Code and all software distributed under the License are
  15. * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  16. * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  17. * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS
  18. * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see
  19. * the License for the specific language governing rights and limitations
  20. * under the License.
  21. */
  22. #ifndef _FUSE_NODEHASH_H_
  23. #define _FUSE_NODEHASH_H_
  24. #include <stdint.h>
  25. #include <sys/systm.h>
  26. #include <sys/vnode.h>
  27. #include <libkern/OSMalloc.h>
  28. #include "fuse_device.h"
  29. typedef struct HNode * HNodeRef;
  30. extern errno_t HNodeInit(lck_grp_t *lockGroup,
  31. lck_attr_t *lockAttr,
  32. OSMallocTag mallocTag,
  33. uint32_t magic,
  34. size_t fsNodeSize);
  35. extern void HNodeTerm(void);
  36. extern void * FSNodeGenericFromHNode(HNodeRef hnode);
  37. extern HNodeRef HNodeFromFSNodeGeneric(void *fsNode);
  38. extern HNodeRef HNodeFromVNode(vnode_t vn);
  39. extern void * FSNodeGenericFromVNode(vnode_t vn);
  40. extern fuse_device_t HNodeGetDevice(HNodeRef hnode);
  41. extern uint64_t HNodeGetInodeNumber(HNodeRef hnode);
  42. extern vnode_t HNodeGetVNodeForForkAtIndex(HNodeRef hnode,
  43. size_t forkIndex);
  44. extern size_t HNodeGetForkIndexForVNode(vnode_t vn);
  45. extern void HNodeExchangeFromFSNode(void *fsnode1, void *fsnode2);
  46. extern errno_t HNodeLookupRealQuickIfExists(fuse_device_t dev,
  47. uint64_t ino,
  48. size_t forkIndex,
  49. HNodeRef *hnodePtr,
  50. vnode_t *vnPtr);
  51. extern errno_t HNodeLookupCreatingIfNecessary(fuse_device_t dev,
  52. uint64_t ino,
  53. size_t forkIndex,
  54. HNodeRef *hnodePtr,
  55. vnode_t *vnPtr);
  56. extern void HNodeAttachVNodeSucceeded(HNodeRef hnode,
  57. size_t forkIndex,
  58. vnode_t vn);
  59. extern boolean_t HNodeAttachVNodeFailed(HNodeRef hnode, size_t forkIndex);
  60. extern boolean_t HNodeDetachVNode(HNodeRef hnode, vnode_t vn);
  61. extern void HNodeScrubDone(HNodeRef hnode);
  62. void HNodePrintState(void);
  63. #endif /* _FUSE_NODEHASH_H_ */