xref: /titanic_52/usr/src/uts/common/fs/fs_subr.h (revision 56a424cca6b3f91f31bdab72a4626c48c779fe8b)
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 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
22 /*	  All Rights Reserved  	*/
23 
24 /*
25  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
26  * Use is subject to license terms.
27  */
28 
29 #ifndef	_SYS_FS_SUBR_H
30 #define	_SYS_FS_SUBR_H
31 
32 #pragma ident	"%Z%%M%	%I%	%E% SMI"
33 
34 #include <sys/types.h>
35 #include <sys/cred.h>
36 #include <sys/fcntl.h>
37 #include <sys/poll.h>
38 #include <sys/vfs.h>
39 #include <sys/vnode.h>
40 #include <vm/page.h>
41 #include <sys/acl.h>
42 #include <sys/share.h>
43 #include <sys/flock.h>
44 
45 #ifdef	__cplusplus
46 extern "C" {
47 #endif
48 
49 /*
50  * Utilities shared among file system implementations.
51  */
52 
53 #ifdef	_KERNEL
54 
55 extern int	fs_nosys();
56 extern int	fs_inval();
57 extern int	fs_notdir();
58 extern int	fs_nosys_map(struct vnode *, offset_t, struct as *, caddr_t *,
59 			size_t, uchar_t, uchar_t, uint_t, struct cred *);
60 extern int	fs_nosys_addmap(struct vnode *, offset_t, struct as *, caddr_t,
61 			size_t, uchar_t, uchar_t, uint_t, struct cred *);
62 extern int	fs_nosys_poll(struct vnode *, short, int, short *,
63 			struct pollhead **);
64 
65 extern int	fs_sync(struct vfs *, short, cred_t *);
66 extern int	fs_rwlock(vnode_t *, int, caller_context_t *);
67 extern void	fs_rwunlock(vnode_t *, int, caller_context_t *);
68 extern int	fs_cmp(vnode_t *, vnode_t *);
69 extern int	fs_seek(vnode_t *, offset_t, offset_t *);
70 extern int	fs_frlock(vnode_t *, int, struct flock64 *, int, offset_t,
71 			struct flk_callback *, cred_t *);
72 extern int	fs_setfl(vnode_t *, int, int, cred_t *);
73 extern int	fs_poll(vnode_t *, short, int, short *, struct pollhead **);
74 extern int	fs_pathconf(struct vnode *, int, ulong_t *, struct cred *);
75 extern void	clkset(time_t);
76 extern void	fs_dispose(struct vnode *, page_t *, int, int, struct cred *);
77 extern void	fs_nodispose(struct vnode *, page_t *, int, int, struct cred *);
78 extern int	fs_fab_acl(struct vnode *, vsecattr_t *, int flag, cred_t *);
79 extern int	fs_shrlock(struct vnode *, int, struct shrlock *, int,
80 			cred_t *);
81 extern int	fs_vnevent_nosupport(vnode_t *, vnevent_t);
82 extern int	fs_vnevent_support(vnode_t *, vnevent_t);
83 extern int	fs_acl_nontrivial(struct vnode *vp, struct cred *cr);
84 extern int	fs_need_estale_retry(int);
85 
86 #endif	/* _KERNEL */
87 
88 #ifdef	__cplusplus
89 }
90 #endif
91 
92 #endif /* _SYS_FS_SUBR_H */
93