xref: /minix/sys/ufs/lfs/ulfs_extern.h (revision 0a6a1f1d)
1 /*	$NetBSD: ulfs_extern.h,v 1.20 2015/09/21 01:24:23 dholland Exp $	*/
2 /*  from NetBSD: ufs_extern.h,v 1.72 2012/05/09 00:21:18 riastradh Exp  */
3 
4 /*-
5  * Copyright (c) 1991, 1993, 1994
6  *	The Regents of the University of California.  All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  * 3. Neither the name of the University nor the names of its contributors
17  *    may be used to endorse or promote products derived from this software
18  *    without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30  * SUCH DAMAGE.
31  *
32  *	@(#)ufs_extern.h	8.10 (Berkeley) 5/14/95
33  */
34 
35 #ifndef _UFS_LFS_ULFS_EXTERN_H_
36 #define _UFS_LFS_ULFS_EXTERN_H_
37 
38 #include <sys/mutex.h>
39 
40 struct buf;
41 struct componentname;
42 struct disklabel;
43 struct dquot;
44 struct fid;
45 struct flock;
46 struct indir;
47 struct inode;
48 struct mbuf;
49 struct mount;
50 struct nameidata;
51 struct lfs_direct;
52 struct lwp;
53 struct ulfs_args;
54 struct ulfs_lookup_results;
55 struct ulfs_ufid;
56 struct ulfsmount;
57 struct uio;
58 struct vattr;
59 struct vnode;
60 
61 __BEGIN_DECLS
62 #define	ulfs_abortop	genfs_abortop
63 int	ulfs_access(void *);
64 int	ulfs_advlock(void *);
65 int	ulfs_bmap(void *);
66 int	ulfs_close(void *);
67 int	ulfs_create(void *);
68 int	ulfs_getattr(void *);
69 int	ulfs_inactive(void *);
70 #define	ulfs_fcntl	genfs_fcntl
71 #define	ulfs_ioctl	genfs_enoioctl
72 #define	ulfs_islocked	genfs_islocked
73 int	ulfs_link(void *);
74 #define	ulfs_lock	genfs_lock
75 int	ulfs_lookup(void *);
76 #define	ulfs_mmap	genfs_mmap
77 #define	ulfs_revoke	genfs_revoke
78 int	ulfs_open(void *);
79 int	ulfs_pathconf(void *);
80 int	ulfs_print(void *);
81 int	ulfs_readdir(void *);
82 int	ulfs_readlink(void *);
83 int	ulfs_remove(void *);
84 int	ulfs_rmdir(void *);
85 #define	ulfs_seek	genfs_seek
86 #define	ulfs_poll	genfs_poll
87 int	ulfs_setattr(void *);
88 int	ulfs_strategy(void *);
89 #define	ulfs_unlock	genfs_unlock
90 int	ulfs_whiteout(void *);
91 int	ulfsspec_close(void *);
92 int	ulfsspec_read(void *);
93 int	ulfsspec_write(void *);
94 
95 int	ulfsfifo_read(void *);
96 int	ulfsfifo_write(void *);
97 int	ulfsfifo_close(void *);
98 
99 /* ulfs_bmap.c */
100 typedef	bool (*ulfs_issequential_callback_t)(const struct lfs *,
101 						 daddr_t, daddr_t);
102 int	ulfs_bmaparray(struct vnode *, daddr_t, daddr_t *, struct indir *,
103 		      int *, int *, ulfs_issequential_callback_t);
104 int	ulfs_getlbns(struct vnode *, daddr_t, struct indir *, int *);
105 
106 /* ulfs_inode.c */
107 int	ulfs_reclaim(struct vnode *);
108 int	ulfs_balloc_range(struct vnode *, off_t, off_t, kauth_cred_t, int);
109 
110 /* ulfs_lookup.c */
111 void	ulfs_dirbad(struct inode *, doff_t, const char *);
112 int	ulfs_dirbadentry(struct vnode *, LFS_DIRHEADER *, int);
113 int	ulfs_direnter(struct vnode *, const struct ulfs_lookup_results *,
114 		     struct vnode *,
115 		     struct componentname *, ino_t, unsigned,
116 		     struct buf *);
117 int	ulfs_dirremove(struct vnode *, const struct ulfs_lookup_results *,
118 		      struct inode *, int, int);
119 int	ulfs_dirrewrite(struct inode *, off_t,
120 		       struct inode *, ino_t, int, int, int);
121 int	ulfs_dirempty(struct inode *, ino_t, kauth_cred_t);
122 int	ulfs_blkatoff(struct vnode *, off_t, char **, struct buf **, bool);
123 
124 /* ulfs_quota.c */
125 /*
126  * Flags to lfs_chkdq() and lfs_chkiq()
127  */
128 #define	FORCE	0x01	/* force usage changes independent of limits */
129 void	ulfsquota_init(struct inode *);
130 void	ulfsquota_free(struct inode *);
131 int	lfs_chkdq(struct inode *, int64_t, kauth_cred_t, int);
132 int	lfs_chkiq(struct inode *, int32_t, kauth_cred_t, int);
133 int	lfsquota_handle_cmd(struct mount *, struct lwp *,
134 			 struct quotactl_args *);
135 
136 int	lfs_qsync(struct mount *);
137 
138 /* ulfs_quota1.c */
139 int	lfsquota1_umount(struct mount *, int);
140 
141 /* ulfs_quota2.c */
142 int	lfsquota2_umount(struct mount *, int);
143 int	lfs_quota2_mount(struct mount *);
144 
145 /* ulfs_vfsops.c */
146 void	ulfs_init(void);
147 void	ulfs_reinit(void);
148 void	ulfs_done(void);
149 int	ulfs_start(struct mount *, int);
150 int	ulfs_root(struct mount *, struct vnode **);
151 int	ulfs_quotactl(struct mount *, struct quotactl_args *);
152 int	ulfs_fhtovp(struct mount *, struct ulfs_ufid *, struct vnode **);
153 
154 /* ulfs_vnops.c */
155 void	ulfs_vinit(struct mount *, int (**)(void *),
156 		  int (**)(void *), struct vnode **);
157 int	ulfs_makeinode(struct vattr *vap, struct vnode *,
158 		      const struct ulfs_lookup_results *,
159 		      struct vnode **, struct componentname *);
160 int	ulfs_gop_alloc(struct vnode *, off_t, off_t, int, kauth_cred_t);
161 void	ulfs_gop_markupdate(struct vnode *, int);
162 int	ulfs_bufio(enum uio_rw, struct vnode *, void *, size_t, off_t, int,
163 	    kauth_cred_t, size_t *, struct lwp *);
164 
165 /*
166  * Snapshot function prototypes.
167  */
168 
169 void	ulfs_snapgone(struct inode *);
170 
171 __END_DECLS
172 
173 #endif /* !_UFS_LFS_ULFS_EXTERN_H_ */
174