xref: /illumos-gate/usr/src/uts/common/sys/fs/hsfs_impl.h (revision d67944fb)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5fc1c62b8Sfrankho  * Common Development and Distribution License (the "License").
6fc1c62b8Sfrankho  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
227c478bd9Sstevel@tonic-gate  * High Sierra filesystem internal routine definitions.
23fc1c62b8Sfrankho  */
24fc1c62b8Sfrankho /*
25*d67944fbSScott Rotondo  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
26fc1c62b8Sfrankho  * Use is subject to license terms.
277c478bd9Sstevel@tonic-gate  */
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #ifndef	_SYS_FS_HSFS_IMPL_H
307c478bd9Sstevel@tonic-gate #define	_SYS_FS_HSFS_IMPL_H
317c478bd9Sstevel@tonic-gate 
32*d67944fbSScott Rotondo #include <sys/vfs_opreg.h>
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
357c478bd9Sstevel@tonic-gate extern "C" {
367c478bd9Sstevel@tonic-gate #endif
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate /*
397c478bd9Sstevel@tonic-gate  * global routines.
407c478bd9Sstevel@tonic-gate  */
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate extern int hsfs_putapage(vnode_t *, page_t *, u_offset_t *, size_t *, int,
437c478bd9Sstevel@tonic-gate 	cred_t *);
447c478bd9Sstevel@tonic-gate /* read a sector */
457c478bd9Sstevel@tonic-gate extern int hs_readsector(struct vnode *vp, uint_t secno, uchar_t *ptr);
467c478bd9Sstevel@tonic-gate /* lookup/construct an hsnode/vnode */
477c478bd9Sstevel@tonic-gate extern struct vnode *hs_makenode(struct hs_direntry *dp,
487c478bd9Sstevel@tonic-gate 	uint_t lbn, uint_t off, struct vfs *vfsp);
497c478bd9Sstevel@tonic-gate /* make hsnode from directory lbn/off */
507c478bd9Sstevel@tonic-gate extern int hs_remakenode(uint_t lbn, uint_t off, struct vfs *vfsp,
517c478bd9Sstevel@tonic-gate 	struct vnode **vpp);
527c478bd9Sstevel@tonic-gate /* lookup name in directory */
537c478bd9Sstevel@tonic-gate extern int hs_dirlook(struct vnode *dvp, char *name, int namlen,
547c478bd9Sstevel@tonic-gate 	struct vnode **vpp, struct cred *cred);
557c478bd9Sstevel@tonic-gate /* find an hsnode in the hash list */
56d10b6702Sfrankho extern struct vnode *hs_findhash(ino64_t nodeid, uint_t lbn, uint_t off,
57d10b6702Sfrankho 	struct vfs *vfsp);
587c478bd9Sstevel@tonic-gate /* destroy an hsnode */
597c478bd9Sstevel@tonic-gate extern void hs_freenode(vnode_t *vp, struct hsfs *fsp, int nopage);
607c478bd9Sstevel@tonic-gate /* parse a directory entry */
617c478bd9Sstevel@tonic-gate extern int hs_parsedir(struct hsfs *fsp, uchar_t *dirp,
62fc1c62b8Sfrankho 	struct hs_direntry *hdp, char *dnp, int *dnlen, int last_offset);
637c478bd9Sstevel@tonic-gate /* convert d-characters */
647c478bd9Sstevel@tonic-gate extern int hs_namecopy(char *from, char *to, int size, ulong_t flags);
65fc1c62b8Sfrankho extern int hs_jnamecopy(char *from, char *to, int size, int maxsize,
66fc1c62b8Sfrankho 	ulong_t flags);
67fc1c62b8Sfrankho extern int hs_joliet_cp(char *from, char *to, int size);
687c478bd9Sstevel@tonic-gate /* destroy the incore hnode table */
697c478bd9Sstevel@tonic-gate extern void hs_filldirent(struct vnode *vp, struct hs_direntry *hdp);
707c478bd9Sstevel@tonic-gate /* check vnode protection */
717c478bd9Sstevel@tonic-gate extern int hs_access(struct vnode *vp, mode_t m, struct cred *cred);
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate extern int hs_synchash(struct vfs *vfsp);
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate extern void hs_parse_dirdate(uchar_t *dp, struct timeval *tvp);
767c478bd9Sstevel@tonic-gate extern void hs_parse_longdate(uchar_t *dp, struct timeval *tvp);
777c478bd9Sstevel@tonic-gate extern int hs_uppercase_copy(char *from, char *to, int size);
787c478bd9Sstevel@tonic-gate extern void hs_log_bogus_disk_warning(struct hsfs *fsp, int errtype,
797c478bd9Sstevel@tonic-gate 	uint_t data);
807c478bd9Sstevel@tonic-gate extern int hsfs_valid_dir(struct hs_direntry *hd);
817c478bd9Sstevel@tonic-gate extern void hs_init_hsnode_cache(void);
82fc1c62b8Sfrankho extern void hs_fini_hsnode_cache(void);
837c478bd9Sstevel@tonic-gate 
847c478bd9Sstevel@tonic-gate /*
857c478bd9Sstevel@tonic-gate  * Global data structures
867c478bd9Sstevel@tonic-gate  */
877c478bd9Sstevel@tonic-gate extern const struct fs_operation_def hsfs_vnodeops_template[];
887c478bd9Sstevel@tonic-gate extern struct vnodeops *hsfs_vnodeops;
897c478bd9Sstevel@tonic-gate extern kmutex_t hs_mounttab_lock;
907c478bd9Sstevel@tonic-gate extern struct hsfs *hs_mounttab;
917c478bd9Sstevel@tonic-gate 
927c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
937c478bd9Sstevel@tonic-gate }
947c478bd9Sstevel@tonic-gate #endif
957c478bd9Sstevel@tonic-gate 
967c478bd9Sstevel@tonic-gate #endif	/* _SYS_FS_HSFS_IMPL_H */
97