xref: /titanic_50/usr/src/uts/common/fs/fs_subr.h (revision da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0)
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
5dd29fa4aSprabahar  * Common Development and Distribution License (the "License").
6dd29fa4aSprabahar  * 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 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
227c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
237c478bd9Sstevel@tonic-gate 
247c478bd9Sstevel@tonic-gate /*
25df2381bfSpraks  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
267c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
277c478bd9Sstevel@tonic-gate  */
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #ifndef	_SYS_FS_SUBR_H
307c478bd9Sstevel@tonic-gate #define	_SYS_FS_SUBR_H
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate #include <sys/types.h>
357c478bd9Sstevel@tonic-gate #include <sys/cred.h>
367c478bd9Sstevel@tonic-gate #include <sys/fcntl.h>
377c478bd9Sstevel@tonic-gate #include <sys/poll.h>
387c478bd9Sstevel@tonic-gate #include <sys/vfs.h>
397c478bd9Sstevel@tonic-gate #include <sys/vnode.h>
407c478bd9Sstevel@tonic-gate #include <vm/page.h>
417c478bd9Sstevel@tonic-gate #include <sys/acl.h>
427c478bd9Sstevel@tonic-gate #include <sys/share.h>
437c478bd9Sstevel@tonic-gate #include <sys/flock.h>
447c478bd9Sstevel@tonic-gate 
457c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
467c478bd9Sstevel@tonic-gate extern "C" {
477c478bd9Sstevel@tonic-gate #endif
487c478bd9Sstevel@tonic-gate 
497c478bd9Sstevel@tonic-gate /*
507c478bd9Sstevel@tonic-gate  * Utilities shared among file system implementations.
517c478bd9Sstevel@tonic-gate  */
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate extern int	fs_nosys();
567c478bd9Sstevel@tonic-gate extern int	fs_inval();
577c478bd9Sstevel@tonic-gate extern int	fs_notdir();
587c478bd9Sstevel@tonic-gate extern int	fs_nosys_map(struct vnode *, offset_t, struct as *, caddr_t *,
59*da6c28aaSamw 			size_t, uchar_t, uchar_t, uint_t, struct cred *,
60*da6c28aaSamw 			caller_context_t *);
617c478bd9Sstevel@tonic-gate extern int	fs_nosys_addmap(struct vnode *, offset_t, struct as *, caddr_t,
62*da6c28aaSamw 			size_t, uchar_t, uchar_t, uint_t, struct cred *,
63*da6c28aaSamw 			caller_context_t *);
647c478bd9Sstevel@tonic-gate extern int	fs_nosys_poll(struct vnode *, short, int, short *,
65*da6c28aaSamw 			struct pollhead **, caller_context_t *);
66*da6c28aaSamw extern int	fs_ioctl(vnode_t *, int, intptr_t, int, cred_t *, int *);
67*da6c28aaSamw extern int	fs_putpage(vnode_t *, offset_t, size_t, int, cred_t *,
68*da6c28aaSamw 			caller_context_t *);
69*da6c28aaSamw extern int	fs_fsync(vnode_t *, int, cred_t *, caller_context_t *);
707c478bd9Sstevel@tonic-gate extern int	fs_sync(struct vfs *, short, cred_t *);
717c478bd9Sstevel@tonic-gate extern int	fs_rwlock(vnode_t *, int, caller_context_t *);
727c478bd9Sstevel@tonic-gate extern void	fs_rwunlock(vnode_t *, int, caller_context_t *);
73*da6c28aaSamw extern int	fs_cmp(vnode_t *, vnode_t *, caller_context_t *);
74*da6c28aaSamw extern int	fs_seek(vnode_t *, offset_t, offset_t *, caller_context_t *);
757c478bd9Sstevel@tonic-gate extern int	fs_frlock(vnode_t *, int, struct flock64 *, int, offset_t,
76*da6c28aaSamw 			struct flk_callback *, cred_t *, caller_context_t *);
77*da6c28aaSamw extern int	fs_setfl(vnode_t *, int, int, cred_t *, caller_context_t *);
78*da6c28aaSamw extern int	fs_poll(vnode_t *, short, int, short *, struct pollhead **,
79*da6c28aaSamw 			caller_context_t *);
80*da6c28aaSamw extern int	fs_pathconf(struct vnode *, int, ulong_t *, struct cred *,
81*da6c28aaSamw 			caller_context_t *);
827c478bd9Sstevel@tonic-gate extern void	clkset(time_t);
83*da6c28aaSamw extern void	fs_dispose(struct vnode *, page_t *, int, int, struct cred *,
84*da6c28aaSamw 			caller_context_t *);
85*da6c28aaSamw extern void	fs_nodispose(struct vnode *, page_t *, int, int, struct cred *,
86*da6c28aaSamw 			caller_context_t *);
87*da6c28aaSamw extern int	fs_fab_acl(struct vnode *, vsecattr_t *, int flag, cred_t *,
88*da6c28aaSamw 			caller_context_t *);
897c478bd9Sstevel@tonic-gate extern int	fs_shrlock(struct vnode *, int, struct shrlock *, int,
90*da6c28aaSamw 			cred_t *, caller_context_t *);
91*da6c28aaSamw extern int	fs_vnevent_nosupport(vnode_t *, vnevent_t, vnode_t *dvp,
92*da6c28aaSamw 			char *fnm, caller_context_t *);
93*da6c28aaSamw extern int	fs_vnevent_support(vnode_t *, vnevent_t, vnode_t *dvp,
94*da6c28aaSamw 			char *fnm, caller_context_t *);
95fa9e4066Sahrens extern int	fs_acl_nontrivial(struct vnode *vp, struct cred *cr);
96dd29fa4aSprabahar extern int	fs_need_estale_retry(int);
97*da6c28aaSamw extern void	fs_vscan_register(int (*av_scan)(vnode_t *, cred_t *, int));
98*da6c28aaSamw extern int	fs_vscan(vnode_t *, cred_t *, int);
997c478bd9Sstevel@tonic-gate 
1007c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
1017c478bd9Sstevel@tonic-gate 
1027c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1037c478bd9Sstevel@tonic-gate }
1047c478bd9Sstevel@tonic-gate #endif
1057c478bd9Sstevel@tonic-gate 
1067c478bd9Sstevel@tonic-gate #endif /* _SYS_FS_SUBR_H */
107