1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 #define FFS_CLUSTERREAD 1
36 #define FFS_CLUSTERWRITE 2
37 #define FFS_REALLOCBLKS 3
38 #define FFS_ASYNCFREE 4
39 #define FFS_MAX_SOFTDEPS 5
40 #define FFS_SD_TICKDELAY 6
41 #define FFS_SD_WORKLIST_PUSH 7
42 #define FFS_SD_BLK_LIMIT_PUSH 8
43 #define FFS_SD_INO_LIMIT_PUSH 9
44 #define FFS_SD_BLK_LIMIT_HIT 10
45 #define FFS_SD_INO_LIMIT_HIT 11
46 #define FFS_SD_SYNC_LIMIT_HIT 12
47 #define FFS_SD_INDIR_BLK_PTRS 13
48 #define FFS_SD_INODE_BITMAP 14
49 #define FFS_SD_DIRECT_BLK_PTRS 15
50 #define FFS_SD_DIR_ENTRY 16
51 #define FFS_DIRHASH_DIRSIZE 17
52 #define FFS_DIRHASH_MAXMEM 18
53 #define FFS_DIRHASH_MEM 19
54 #define FFS_MAXID 20
55
56 #define FFS_NAMES { \
57 { 0, 0 }, \
58 { "doclusterread", CTLTYPE_INT }, \
59 { "doclusterwrite", CTLTYPE_INT }, \
60 { "doreallocblks", CTLTYPE_INT }, \
61 { "doasyncfree", CTLTYPE_INT }, \
62 { "max_softdeps", CTLTYPE_INT }, \
63 { "sd_tickdelay", CTLTYPE_INT }, \
64 { "sd_worklist_push", CTLTYPE_INT }, \
65 { "sd_blk_limit_push", CTLTYPE_INT }, \
66 { "sd_ino_limit_push", CTLTYPE_INT }, \
67 { "sd_blk_limit_hit", CTLTYPE_INT }, \
68 { "sd_ino_limit_hit", CTLTYPE_INT }, \
69 { "sd_sync_limit_hit", CTLTYPE_INT }, \
70 { "sd_indir_blk_ptrs", CTLTYPE_INT }, \
71 { "sd_inode_bitmap", CTLTYPE_INT }, \
72 { "sd_direct_blk_ptrs", CTLTYPE_INT }, \
73 { "sd_dir_entry", CTLTYPE_INT }, \
74 { "dirhash_dirsize", CTLTYPE_INT }, \
75 { "dirhash_maxmem", CTLTYPE_INT }, \
76 { "dirhash_mem", CTLTYPE_INT }, \
77 }
78
79 struct buf;
80 struct fid;
81 struct fs;
82 struct inode;
83 struct mount;
84 struct nameidata;
85 struct proc;
86 struct statfs;
87 struct timeval;
88 struct ucred;
89 struct ufsmount;
90 struct vfsconf;
91 struct uio;
92 struct vnode;
93 struct mbuf;
94 struct cg;
95 struct vop_vfree_args;
96
97 __BEGIN_DECLS
98
99
100 int ffs_alloc(struct inode *, daddr_t, daddr_t , int, struct ucred *,
101 daddr_t *);
102 int ffs_realloccg(struct inode *, daddr_t, daddr_t, int, int ,
103 struct ucred *, struct buf **, daddr_t *);
104 int ffs_reallocblks(void *);
105 int ffs_inode_alloc(struct inode *, mode_t, struct ucred *, struct vnode **);
106 int ffs_inode_free(struct inode *, ino_t, mode_t);
107 int ffs_freefile(struct inode *, ino_t, mode_t);
108
109 int32_t ffs1_blkpref(struct inode *, daddr_t, int, int32_t *);
110 #ifdef FFS2
111 int64_t ffs2_blkpref(struct inode *, daddr_t, int, int64_t *);
112 #endif
113 void ffs_blkfree(struct inode *, daddr64_t, long);
114 void ffs_clusteracct(struct fs *, struct cg *, daddr_t, int);
115
116
117 int ffs_balloc(struct inode *, off_t, int, struct ucred *, int, struct buf **);
118
119
120 int ffs_init(struct vfsconf *);
121 int ffs_update(struct inode *, struct timespec *, struct timespec *, int);
122 int ffs_truncate(struct inode *, off_t, int, struct ucred *);
123
124
125 int ffs_bufatoff(struct inode *, off_t, char **, struct buf **);
126 void ffs_fragacct(struct fs *, int, int32_t[], int);
127 #ifdef DIAGNOSTIC
128 void ffs_checkoverlap(struct buf *, struct inode *);
129 #endif
130 int ffs_isfreeblock(struct fs *, unsigned char *, daddr_t);
131 int ffs_isblock(struct fs *, unsigned char *, daddr_t);
132 void ffs_clrblock(struct fs *, u_char *, daddr_t);
133 void ffs_setblock(struct fs *, unsigned char *, daddr_t);
134
135
136 int ffs_mountroot(void);
137 int ffs_mount(struct mount *, const char *, void *, struct nameidata *,
138 struct proc *);
139 int ffs_reload(struct mount *, struct ucred *, struct proc *);
140 int ffs_mountfs(struct vnode *, struct mount *, struct proc *);
141 int ffs_oldfscompat(struct fs *);
142 int ffs_unmount(struct mount *, int, struct proc *);
143 int ffs_flushfiles(struct mount *, int, struct proc *);
144 int ffs_statfs(struct mount *, struct statfs *, struct proc *);
145 int ffs_sync(struct mount *, int, struct ucred *, struct proc *);
146 int ffs_vget(struct mount *, ino_t, struct vnode **);
147 int ffs_fhtovp(struct mount *, struct fid *, struct vnode **);
148 int ffs_vptofh(struct vnode *, struct fid *);
149 int ffs_sysctl(int *, u_int, void *, size_t *, void *, size_t,
150 struct proc *);
151 int ffs_sbupdate(struct ufsmount *, int);
152 int ffs_cgupdate(struct ufsmount *, int);
153
154
155 int ffs_read(void *);
156 int ffs_write(void *);
157 int ffs_fsync(void *);
158 int ffs_reclaim(void *);
159 int ffsfifo_reclaim(void *);
160
161
162
163
164
165 struct vop_vfree_args;
166 struct vop_fsync_args;
167
168 void softdep_initialize(void);
169 int softdep_process_worklist(struct mount *);
170 int softdep_mount(struct vnode *, struct mount *, struct fs *,
171 struct ucred *);
172 int softdep_flushworklist(struct mount *, int *, struct proc *);
173 int softdep_flushfiles(struct mount *, int, struct proc *);
174 void softdep_update_inodeblock(struct inode *, struct buf *, int);
175 void softdep_load_inodeblock(struct inode *);
176 void softdep_freefile(struct vnode *, ino_t, mode_t);
177 void softdep_setup_freeblocks(struct inode *, off_t);
178 void softdep_setup_inomapdep(struct buf *, struct inode *, ino_t);
179 void softdep_setup_blkmapdep(struct buf *, struct fs *, daddr_t);
180 void softdep_setup_allocdirect(struct inode *, daddr64_t, daddr_t,
181 daddr_t, long, long, struct buf *);
182 void softdep_setup_allocindir_meta(struct buf *, struct inode *,
183 struct buf *, int, daddr_t);
184 void softdep_setup_allocindir_page(struct inode *, daddr64_t,
185 struct buf *, int, daddr_t, daddr_t, struct buf *);
186 void softdep_fsync_mountdev(struct vnode *, int);
187 int softdep_sync_metadata(struct vop_fsync_args *);
188 int softdep_fsync(struct vnode *);
189 __END_DECLS
190
191 extern int (**ffs_vnodeop_p)(void *);
192 extern int (**ffs_specop_p)(void *);
193 #ifdef FIFO
194 extern int (**ffs_fifoop_p)(void *);
195 #define FFS_FIFOOPS ffs_fifoop_p
196 #else
197 #define FFS_FIFOOPS NULL
198 #endif
199
200 extern struct pool ffs_ino_pool;
201 extern struct pool ffs_dinode1_pool;
202 #ifdef FFS2
203 extern struct pool ffs_dinode2_pool;
204 #endif