1 /*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
6 *
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
10 */
11
12 /*
13 * Copyright 2013 Damian Bogel. All rights reserved.
14 */
15
16 #ifndef _FSH_IMPL_H
17 #define _FSH_IMPL_H
18
19 #include <sys/pathname.h>
20 #include <sys/types.h>
21 #include <sys/vfs.h>
22 #include <sys/vnode.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 struct fsh_fsrecord;
29
30 /* API for vnode.c and vfs.c only */
31 /* vnode.c */
32 extern int fsh_open(vnode_t **vpp, int mode, cred_t *cr, caller_context_t *ct);
33 extern int fsh_close(vnode_t *vp, int flag, int count, offset_t offset,
34 cred_t *cr, caller_context_t *ct);
35 extern int fsh_read(vnode_t *vp, uio_t *uiop, int ioflag, cred_t *cr,
36 caller_context_t *ct);
37 extern int fsh_write(vnode_t *vp, uio_t *uiop, int ioflag, cred_t *cr,
38 caller_context_t *ct);
39
40 /* vfs.c */
41 extern int fsh_mount(vfs_t *vfsp, vnode_t *mvp, struct mounta *uap,
42 cred_t *cr);
43 extern int fsh_unmount(vfs_t *vfsp, int flag, cred_t *cr);
44 extern int fsh_root(vfs_t *vfsp, vnode_t **vpp);
45 extern int fsh_statfs(vfs_t *vfsp, statvfs64_t *sp);
46 extern int fsh_vget(vfs_t *vfsp, vnode_t **vpp, fid_t *fidp);
47
48 extern void fsh_exec_create_callbacks(vfs_t *vfsp);
49 extern void fsh_exec_destroy_callbacks(vfs_t *vfsp);
50
51 extern struct fsh_fsrecord * fsh_fsrec_create();
52 extern void fsh_fsrec_destroy(struct fsh_fsrecord *fsrecp);
53
54 #ifdef __cplusplus
55 }
56 #endif
57
58 #endif /* _FSH_IMPL_H */