xref: /titanic_41/usr/src/uts/common/sys/fs/hsfs_impl.h (revision 35a5a3587fd94b666239c157d3722745250ccbd7)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * High Sierra filesystem internal routine definitions.
23  */
24 /*
25  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
26  * Use is subject to license terms.
27  */
28 
29 #ifndef	_SYS_FS_HSFS_IMPL_H
30 #define	_SYS_FS_HSFS_IMPL_H
31 
32 #include <sys/vfs_opreg.h>
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 /*
39  * global routines.
40  */
41 
42 extern int hsfs_putapage(vnode_t *, page_t *, u_offset_t *, size_t *, int,
43 	cred_t *);
44 /* read a sector */
45 extern int hs_readsector(struct vnode *vp, uint_t secno, uchar_t *ptr);
46 /* lookup/construct an hsnode/vnode */
47 extern struct vnode *hs_makenode(struct hs_direntry *dp,
48 	uint_t lbn, uint_t off, struct vfs *vfsp);
49 /* make hsnode from directory lbn/off */
50 extern int hs_remakenode(uint_t lbn, uint_t off, struct vfs *vfsp,
51 	struct vnode **vpp);
52 /* lookup name in directory */
53 extern int hs_dirlook(struct vnode *dvp, char *name, int namlen,
54 	struct vnode **vpp, struct cred *cred);
55 /* find an hsnode in the hash list */
56 extern struct vnode *hs_findhash(ino64_t nodeid, uint_t lbn, uint_t off,
57 	struct vfs *vfsp);
58 /* destroy an hsnode */
59 extern void hs_freenode(vnode_t *vp, struct hsfs *fsp, int nopage);
60 /* parse a directory entry */
61 extern int hs_parsedir(struct hsfs *fsp, uchar_t *dirp,
62 	struct hs_direntry *hdp, char *dnp, int *dnlen, int last_offset);
63 /* convert d-characters */
64 extern int hs_namecopy(char *from, char *to, int size, ulong_t flags);
65 extern int hs_jnamecopy(char *from, char *to, int size, int maxsize,
66 	ulong_t flags);
67 extern int hs_joliet_cp(char *from, char *to, int size);
68 /* destroy the incore hnode table */
69 extern void hs_filldirent(struct vnode *vp, struct hs_direntry *hdp);
70 /* check vnode protection */
71 extern int hs_access(struct vnode *vp, mode_t m, struct cred *cred);
72 
73 extern int hs_synchash(struct vfs *vfsp);
74 
75 extern void hs_parse_dirdate(uchar_t *dp, struct timeval *tvp);
76 extern void hs_parse_longdate(uchar_t *dp, struct timeval *tvp);
77 extern int hs_uppercase_copy(char *from, char *to, int size);
78 extern void hs_log_bogus_disk_warning(struct hsfs *fsp, int errtype,
79 	uint_t data);
80 extern int hsfs_valid_dir(struct hs_direntry *hd);
81 extern void hs_init_hsnode_cache(void);
82 extern void hs_fini_hsnode_cache(void);
83 
84 /*
85  * Global data structures
86  */
87 extern const struct fs_operation_def hsfs_vnodeops_template[];
88 extern struct vnodeops *hsfs_vnodeops;
89 extern kmutex_t hs_mounttab_lock;
90 extern struct hsfs *hs_mounttab;
91 
92 #ifdef	__cplusplus
93 }
94 #endif
95 
96 #endif	/* _SYS_FS_HSFS_IMPL_H */
97