]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/ufs/ufs/ufs_extern.h
ident(1): Normalizing date format
[FreeBSD/FreeBSD.git] / sys / ufs / ufs / ufs_extern.h
1 /*-
2  * SPDX-License-Identifier: BSD-3-Clause
3  *
4  * Copyright (c) 1991, 1993, 1994
5  *      The Regents of the University of California.  All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  * 3. Neither the name of the University nor the names of its contributors
16  *    may be used to endorse or promote products derived from this software
17  *    without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29  * SUCH DAMAGE.
30  *
31  *      @(#)ufs_extern.h        8.10 (Berkeley) 5/14/95
32  * $FreeBSD$
33  */
34
35 #ifndef _UFS_UFS_EXTERN_H_
36 #define _UFS_UFS_EXTERN_H_
37
38 struct componentname;
39 struct direct;
40 struct indir;
41 struct inode;
42 struct mount;
43 struct thread;
44 struct sockaddr;
45 struct ucred;
46 struct ufid;
47 struct vfsconf;
48 struct vnode;
49 struct vop_bmap_args;
50 struct vop_cachedlookup_args;
51 struct vop_generic_args;
52 struct vop_inactive_args;
53 struct vop_reclaim_args;
54
55 extern struct vop_vector ufs_fifoops;
56 extern struct vop_vector ufs_vnodeops;
57
58 int      ufs_bmap(struct vop_bmap_args *);
59 int      ufs_bmaparray(struct vnode *, ufs2_daddr_t, ufs2_daddr_t *,
60             struct buf *, int *, int *);
61 int      ufs_bmap_seekdata(struct vnode *, off_t *);
62 int      ufs_fhtovp(struct mount *, struct ufid *, int, struct vnode **);
63 int      ufs_checkpath(ino_t, ino_t, struct inode *, struct ucred *, ino_t *);
64 void     ufs_dirbad(struct inode *, doff_t, char *);
65 int      ufs_dirbadentry(struct vnode *, struct direct *, int);
66 int      ufs_dirempty(struct inode *, ino_t, struct ucred *);
67 int      ufs_extread(struct vop_read_args *);
68 int      ufs_extwrite(struct vop_write_args *);
69 void     ufs_makedirentry(struct inode *, struct componentname *,
70             struct direct *);
71 int      ufs_direnter(struct vnode *, struct vnode *, struct direct *,
72             struct componentname *, struct buf *, int);
73 int      ufs_dirremove(struct vnode *, struct inode *, int, int);
74 int      ufs_dirrewrite(struct inode *, struct inode *, ino_t, int, int);
75 int      ufs_lookup_ino(struct vnode *, struct vnode **, struct componentname *,
76             ino_t *);
77 int      ufs_getlbns(struct vnode *, ufs2_daddr_t, struct indir *, int *);
78 int      ufs_inactive(struct vop_inactive_args *);
79 int      ufs_init(struct vfsconf *);
80 void     ufs_itimes(struct vnode *vp);
81 int      ufs_lookup(struct vop_cachedlookup_args *);
82 int      ufs_need_inactive(struct vop_need_inactive_args *);
83 int      ufs_readdir(struct vop_readdir_args *);
84 int      ufs_reclaim(struct vop_reclaim_args *);
85 void     ffs_snapgone(struct inode *);
86 vfs_root_t ufs_root;
87 int      ufs_uninit(struct vfsconf *);
88 int      ufs_vinit(struct mount *, struct vop_vector *, struct vnode **);
89
90 #include <sys/sysctl.h>
91 SYSCTL_DECL(_vfs_ufs);
92
93 /*
94  * Soft update function prototypes.
95  */
96 int     softdep_setup_directory_add(struct buf *, struct inode *, off_t,
97             ino_t, struct buf *, int);
98 void    softdep_change_directoryentry_offset(struct buf *, struct inode *,
99             caddr_t, caddr_t, caddr_t, int);
100 void    softdep_setup_remove(struct buf *,struct inode *, struct inode *, int);
101 void    softdep_setup_directory_change(struct buf *, struct inode *,
102             struct inode *, ino_t, int);
103 void    softdep_change_linkcnt(struct inode *);
104 int     softdep_slowdown(struct vnode *);
105 void    softdep_setup_create(struct inode *, struct inode *);
106 void    softdep_setup_dotdot_link(struct inode *, struct inode *);
107 void    softdep_setup_link(struct inode *, struct inode *);
108 void    softdep_setup_mkdir(struct inode *, struct inode *);
109 void    softdep_setup_rmdir(struct inode *, struct inode *);
110 void    softdep_setup_unlink(struct inode *, struct inode *);
111 void    softdep_revert_create(struct inode *, struct inode *);
112 void    softdep_revert_link(struct inode *, struct inode *);
113 void    softdep_revert_mkdir(struct inode *, struct inode *);
114 void    softdep_revert_rmdir(struct inode *, struct inode *);
115
116 /*
117  * Flags to low-level allocation routines.  The low 16-bits are reserved
118  * for IO_ flags from vnode.h.
119  *
120  * Note: The general vfs code typically limits the sequential heuristic
121  * count to 127.  See sequential_heuristic() in kern/vfs_vnops.c
122  *
123  * The BA_CLRBUF flag specifies that the existing content of the block
124  * will not be completely overwritten by the caller, so buffers for new
125  * blocks must be cleared and buffers for existing blocks must be read.
126  * When BA_CLRBUF is not set the buffer will be completely overwritten
127  * and there is no reason to clear them or to spend I/O fetching existing
128  * data. The BA_CLRBUF flag is handled in the UFS_BALLOC() functions.
129  */
130 #define BA_CLRBUF       0x00010000      /* Clear invalid areas of buffer. */
131 #define BA_METAONLY     0x00020000      /* Return indirect block buffer. */
132 #define BA_UNMAPPED     0x00040000      /* Do not mmap resulted buffer. */
133 #define BA_SEQMASK      0x7F000000      /* Bits holding seq heuristic. */
134 #define BA_SEQSHIFT     24
135 #define BA_SEQMAX       0x7F
136
137 #endif /* !_UFS_UFS_EXTERN_H_ */