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