xref: /titanic_51/usr/src/uts/common/sys/fs/hsfs_impl.h (revision bb25c06cca41ca78e5fb87fbb8e81d55beb18c95)
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 2006 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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
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, struct vfs *vfsp);
57 /* destroy an hsnode */
58 extern void hs_freenode(vnode_t *vp, struct hsfs *fsp, int nopage);
59 /* parse a directory entry */
60 extern int hs_parsedir(struct hsfs *fsp, uchar_t *dirp,
61 	struct hs_direntry *hdp, char *dnp, int *dnlen, int last_offset);
62 /* convert d-characters */
63 extern int hs_namecopy(char *from, char *to, int size, ulong_t flags);
64 extern int hs_jnamecopy(char *from, char *to, int size, int maxsize,
65 	ulong_t flags);
66 extern int hs_joliet_cp(char *from, char *to, int size);
67 /* destroy the incore hnode table */
68 extern void hs_filldirent(struct vnode *vp, struct hs_direntry *hdp);
69 /* check vnode protection */
70 extern int hs_access(struct vnode *vp, mode_t m, struct cred *cred);
71 
72 extern int hs_synchash(struct vfs *vfsp);
73 
74 extern void hs_parse_dirdate(uchar_t *dp, struct timeval *tvp);
75 extern void hs_parse_longdate(uchar_t *dp, struct timeval *tvp);
76 extern int hs_uppercase_copy(char *from, char *to, int size);
77 extern void hs_log_bogus_disk_warning(struct hsfs *fsp, int errtype,
78 	uint_t data);
79 extern int hsfs_valid_dir(struct hs_direntry *hd);
80 extern void hs_init_hsnode_cache(void);
81 extern void hs_fini_hsnode_cache(void);
82 
83 /*
84  * Global data structures
85  */
86 extern const struct fs_operation_def hsfs_vnodeops_template[];
87 extern struct vnodeops *hsfs_vnodeops;
88 extern kmutex_t hs_mounttab_lock;
89 extern struct hsfs *hs_mounttab;
90 
91 #ifdef	__cplusplus
92 }
93 #endif
94 
95 #endif	/* _SYS_FS_HSFS_IMPL_H */
96