hsfs_impl.h revision d10b670251155449ab8d25790cb23de3995cca8e
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
bcd6185e1c81586e6929dc444ef32123263dd51cMilos Muzik * High Sierra filesystem internal routine definitions.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef _SYS_FS_HSFS_IMPL_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _SYS_FS_HSFS_IMPL_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#pragma ident "%Z%%M% %I% %E% SMI"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern "C" {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * global routines.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int hsfs_putapage(vnode_t *, page_t *, u_offset_t *, size_t *, int,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cred_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* read a sector */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int hs_readsector(struct vnode *vp, uint_t secno, uchar_t *ptr);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* lookup/construct an hsnode/vnode */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern struct vnode *hs_makenode(struct hs_direntry *dp,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t lbn, uint_t off, struct vfs *vfsp);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* make hsnode from directory lbn/off */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int hs_remakenode(uint_t lbn, uint_t off, struct vfs *vfsp,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct vnode **vpp);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* lookup name in directory */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int hs_dirlook(struct vnode *dvp, char *name, int namlen,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct vnode **vpp, struct cred *cred);
6e0414acac7fe81ff262fb9d3d83c0700fe9b695Reed/* find an hsnode in the hash list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern struct vnode *hs_findhash(ino64_t nodeid, uint_t lbn, uint_t off,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct vfs *vfsp);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* destroy an hsnode */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern void hs_freenode(vnode_t *vp, struct hsfs *fsp, int nopage);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* parse a directory entry */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int hs_parsedir(struct hsfs *fsp, uchar_t *dirp,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct hs_direntry *hdp, char *dnp, int *dnlen, int last_offset);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* convert d-characters */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int hs_namecopy(char *from, char *to, int size, ulong_t flags);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int hs_jnamecopy(char *from, char *to, int size, int maxsize,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ulong_t flags);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int hs_joliet_cp(char *from, char *to, int size);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* destroy the incore hnode table */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern void hs_filldirent(struct vnode *vp, struct hs_direntry *hdp);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* check vnode protection */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int hs_access(struct vnode *vp, mode_t m, struct cred *cred);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int hs_synchash(struct vfs *vfsp);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern void hs_parse_dirdate(uchar_t *dp, struct timeval *tvp);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern void hs_parse_longdate(uchar_t *dp, struct timeval *tvp);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int hs_uppercase_copy(char *from, char *to, int size);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern void hs_log_bogus_disk_warning(struct hsfs *fsp, int errtype,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t data);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int hsfs_valid_dir(struct hs_direntry *hd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern void hs_init_hsnode_cache(void);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern void hs_fini_hsnode_cache(void);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Global data structures
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern const struct fs_operation_def hsfs_vnodeops_template[];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern struct vnodeops *hsfs_vnodeops;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern kmutex_t hs_mounttab_lock;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern struct hsfs *hs_mounttab;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
6e0414acac7fe81ff262fb9d3d83c0700fe9b695Reed#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SYS_FS_HSFS_IMPL_H */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte