PageRenderTime 18ms CodeModel.GetById 9ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

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