FreeBSD kernel kern code
vfs_init.c
Go to the documentation of this file.
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1989, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This code is derived from software contributed
8 * to Berkeley by John Heidemann of the UCLA Ficus project.
9 *
10 * Source: * @(#)i405_init.c 2.10 92/04/27 UCLA Ficus project
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 * 3. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)vfs_init.c 8.3 (Berkeley) 1/4/94
37 */
38
39#include <sys/cdefs.h>
40__FBSDID("$FreeBSD$");
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/fnv_hash.h>
45#include <sys/jail.h>
46#include <sys/kernel.h>
47#include <sys/linker.h>
48#include <sys/mount.h>
49#include <sys/proc.h>
50#include <sys/sx.h>
51#include <sys/syscallsubr.h>
52#include <sys/sysctl.h>
53#include <sys/vnode.h>
54#include <sys/malloc.h>
55
56static int vfs_register(struct vfsconf *);
57static int vfs_unregister(struct vfsconf *);
58
59MALLOC_DEFINE(M_VNODE, "vnodes", "Dynamically allocated vnodes");
60
61/*
62 * The highest defined VFS number.
63 */
64int maxvfsconf = VFS_GENERIC + 1;
65
66/*
67 * Single-linked list of configured VFSes.
68 * New entries are added/deleted by vfs_register()/vfs_unregister()
69 */
70struct vfsconfhead vfsconf = TAILQ_HEAD_INITIALIZER(vfsconf);
71struct sx vfsconf_sx;
73
74/*
75 * Loader.conf variable vfs.typenumhash enables setting vfc_typenum using a hash
76 * calculation on vfc_name, so that it doesn't change when file systems are
77 * loaded in a different order. This will avoid the NFS server file handles from
78 * changing for file systems that use vfc_typenum in their fsid.
79 */
80static int vfs_typenumhash = 1;
81SYSCTL_INT(_vfs, OID_AUTO, typenumhash, CTLFLAG_RDTUN, &vfs_typenumhash, 0,
82 "Set vfc_typenum using a hash calculation on vfc_name, so that it does not"
83 "change when file systems are loaded in a different order.");
84
85/*
86 * A Zen vnode attribute structure.
87 *
88 * Initialized when the first filesystem registers by vfs_register().
89 */
90struct vattr va_null;
91
92/*
93 * vfs_init.c
94 *
95 * Allocate and fill in operations vectors.
96 *
97 * An undocumented feature of this approach to defining operations is that
98 * there can be multiple entries in vfs_opv_descs for the same operations
99 * vector. This allows third parties to extend the set of operations
100 * supported by another layer in a binary compatibile way. For example,
101 * assume that NFS needed to be modified to support Ficus. NFS has an entry
102 * (probably nfs_vnopdeop_decls) declaring all the operations NFS supports by
103 * default. Ficus could add another entry (ficus_nfs_vnodeop_decl_entensions)
104 * listing those new operations Ficus adds to NFS, all without modifying the
105 * NFS code. (Of couse, the OTW NFS protocol still needs to be munged, but
106 * that is a(whole)nother story.) This is a feature.
107 */
108
109/*
110 * Routines having to do with the management of the vnode table.
111 */
112
113static struct vfsconf *
115{
116 struct vfsconf *vfsp;
117
118 sx_assert(&vfsconf_sx, SA_LOCKED);
119 if (!strcmp(name, "ffs"))
120 name = "ufs";
121 TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) {
122 if (!strcmp(name, vfsp->vfc_name))
123 return (vfsp);
124 }
125 return (NULL);
126}
127
128struct vfsconf *
129vfs_byname(const char *name)
130{
131 struct vfsconf *vfsp;
132
133 vfsconf_slock();
134 vfsp = vfs_byname_locked(name);
135 vfsconf_sunlock();
136 return (vfsp);
137}
138
139struct vfsconf *
140vfs_byname_kld(const char *fstype, struct thread *td, int *error)
141{
142 struct vfsconf *vfsp;
143 int fileid, loaded;
144
145 vfsp = vfs_byname(fstype);
146 if (vfsp != NULL)
147 return (vfsp);
148
149 /* Try to load the respective module. */
150 *error = kern_kldload(td, fstype, &fileid);
151 loaded = (*error == 0);
152 if (*error == EEXIST)
153 *error = 0;
154 if (*error)
155 return (NULL);
156
157 /* Look up again to see if the VFS was loaded. */
158 vfsp = vfs_byname(fstype);
159 if (vfsp == NULL) {
160 if (loaded)
161 (void)kern_kldunload(td, fileid, LINKER_UNLOAD_FORCE);
162 *error = ENODEV;
163 return (NULL);
164 }
165 return (vfsp);
166}
167
168static int
169vfs_mount_sigdefer(struct mount *mp)
170{
171 int prev_stops, rc;
172
173 TSRAW(curthread, TS_ENTER, "VFS_MOUNT", mp->mnt_vfc->vfc_name);
174 prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT);
175 rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_mount)(mp);
176 sigallowstop(prev_stops);
177 TSRAW(curthread, TS_EXIT, "VFS_MOUNT", mp->mnt_vfc->vfc_name);
178 return (rc);
179}
180
181static int
182vfs_unmount_sigdefer(struct mount *mp, int mntflags)
183{
184 int prev_stops, rc;
185
186 prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT);
187 rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_unmount)(mp, mntflags);
188 sigallowstop(prev_stops);
189 return (rc);
190}
191
192static int
193vfs_root_sigdefer(struct mount *mp, int flags, struct vnode **vpp)
194{
195 int prev_stops, rc;
196
197 prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT);
198 rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_root)(mp, flags, vpp);
199 sigallowstop(prev_stops);
200 return (rc);
201}
202
203static int
204vfs_cachedroot_sigdefer(struct mount *mp, int flags, struct vnode **vpp)
205{
206 int prev_stops, rc;
207
208 prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT);
209 rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_cachedroot)(mp, flags, vpp);
210 sigallowstop(prev_stops);
211 return (rc);
212}
213
214static int
215vfs_quotactl_sigdefer(struct mount *mp, int cmd, uid_t uid, void *arg,
216 bool *mp_busy)
217{
218 int prev_stops, rc;
219
220 prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT);
221 rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_quotactl)(mp, cmd, uid, arg,
222 mp_busy);
223 sigallowstop(prev_stops);
224 return (rc);
225}
226
227static int
228vfs_statfs_sigdefer(struct mount *mp, struct statfs *sbp)
229{
230 int prev_stops, rc;
231
232 prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT);
233 rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_statfs)(mp, sbp);
234 sigallowstop(prev_stops);
235 return (rc);
236}
237
238static int
239vfs_sync_sigdefer(struct mount *mp, int waitfor)
240{
241 int prev_stops, rc;
242
243 prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT);
244 rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_sync)(mp, waitfor);
245 sigallowstop(prev_stops);
246 return (rc);
247}
248
249static int
250vfs_vget_sigdefer(struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
251{
252 int prev_stops, rc;
253
254 prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT);
255 rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_vget)(mp, ino, flags, vpp);
256 sigallowstop(prev_stops);
257 return (rc);
258}
259
260static int
261vfs_fhtovp_sigdefer(struct mount *mp, struct fid *fidp, int flags,
262 struct vnode **vpp)
263{
264 int prev_stops, rc;
265
266 prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT);
267 rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_fhtovp)(mp, fidp, flags, vpp);
268 sigallowstop(prev_stops);
269 return (rc);
270}
271
272static int
273vfs_checkexp_sigdefer(struct mount *mp, struct sockaddr *nam, uint64_t *exflg,
274 struct ucred **credp, int *numsecflavors, int *secflavors)
275{
276 int prev_stops, rc;
277
278 prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT);
279 rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_checkexp)(mp, nam, exflg, credp,
280 numsecflavors, secflavors);
281 sigallowstop(prev_stops);
282 return (rc);
283}
284
285static int
286vfs_extattrctl_sigdefer(struct mount *mp, int cmd, struct vnode *filename_vp,
287 int attrnamespace, const char *attrname)
288{
289 int prev_stops, rc;
290
291 prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT);
292 rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_extattrctl)(mp, cmd,
293 filename_vp, attrnamespace, attrname);
294 sigallowstop(prev_stops);
295 return (rc);
296}
297
298static int
299vfs_sysctl_sigdefer(struct mount *mp, fsctlop_t op, struct sysctl_req *req)
300{
301 int prev_stops, rc;
302
303 prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT);
304 rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_sysctl)(mp, op, req);
305 sigallowstop(prev_stops);
306 return (rc);
307}
308
309static void
310vfs_susp_clean_sigdefer(struct mount *mp)
311{
312 int prev_stops;
313
314 if (*mp->mnt_vfc->vfc_vfsops_sd->vfs_susp_clean == NULL)
315 return;
316 prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT);
317 (*mp->mnt_vfc->vfc_vfsops_sd->vfs_susp_clean)(mp);
318 sigallowstop(prev_stops);
319}
320
321static void
322vfs_reclaim_lowervp_sigdefer(struct mount *mp, struct vnode *vp)
323{
324 int prev_stops;
325
326 if (*mp->mnt_vfc->vfc_vfsops_sd->vfs_reclaim_lowervp == NULL)
327 return;
328 prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT);
329 (*mp->mnt_vfc->vfc_vfsops_sd->vfs_reclaim_lowervp)(mp, vp);
330 sigallowstop(prev_stops);
331}
332
333static void
334vfs_unlink_lowervp_sigdefer(struct mount *mp, struct vnode *vp)
335{
336 int prev_stops;
337
338 if (*mp->mnt_vfc->vfc_vfsops_sd->vfs_unlink_lowervp == NULL)
339 return;
340 prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT);
341 (*(mp)->mnt_vfc->vfc_vfsops_sd->vfs_unlink_lowervp)(mp, vp);
342 sigallowstop(prev_stops);
343}
344
345static void
346vfs_purge_sigdefer(struct mount *mp)
347{
348 int prev_stops;
349
350 prev_stops = sigdeferstop(SIGDEFERSTOP_SILENT);
351 (*mp->mnt_vfc->vfc_vfsops_sd->vfs_purge)(mp);
352 sigallowstop(prev_stops);
353}
354
355static struct vfsops vfsops_sigdefer = {
356 .vfs_mount = vfs_mount_sigdefer,
357 .vfs_unmount = vfs_unmount_sigdefer,
358 .vfs_root = vfs_root_sigdefer,
359 .vfs_cachedroot = vfs_cachedroot_sigdefer,
360 .vfs_quotactl = vfs_quotactl_sigdefer,
361 .vfs_statfs = vfs_statfs_sigdefer,
362 .vfs_sync = vfs_sync_sigdefer,
363 .vfs_vget = vfs_vget_sigdefer,
364 .vfs_fhtovp = vfs_fhtovp_sigdefer,
365 .vfs_checkexp = vfs_checkexp_sigdefer,
366 .vfs_extattrctl = vfs_extattrctl_sigdefer,
367 .vfs_sysctl = vfs_sysctl_sigdefer,
368 .vfs_susp_clean = vfs_susp_clean_sigdefer,
369 .vfs_reclaim_lowervp = vfs_reclaim_lowervp_sigdefer,
370 .vfs_unlink_lowervp = vfs_unlink_lowervp_sigdefer,
371 .vfs_purge = vfs_purge_sigdefer,
372
373};
374
375/* Register a new filesystem type in the global table */
376static int
378{
379 struct sysctl_oid *oidp;
380 struct vfsops *vfsops;
381 static int once;
382 struct vfsconf *tvfc;
383 uint32_t hashval;
384 int secondpass;
385
386 if (!once) {
388 once = 1;
389 }
390
391 if (vfc->vfc_version != VFS_VERSION) {
392 printf("ERROR: filesystem %s, unsupported ABI version %x\n",
393 vfc->vfc_name, vfc->vfc_version);
394 return (EINVAL);
395 }
396 vfsconf_lock();
397 if (vfs_byname_locked(vfc->vfc_name) != NULL) {
398 vfsconf_unlock();
399 return (EEXIST);
400 }
401
402 if (vfs_typenumhash != 0) {
403 /*
404 * Calculate a hash on vfc_name to use for vfc_typenum. Unless
405 * all of 1<->255 are assigned, it is limited to 8bits since
406 * that is what ZFS uses from vfc_typenum and is also the
407 * preferred range for vfs_getnewfsid().
408 */
409 hashval = fnv_32_str(vfc->vfc_name, FNV1_32_INIT);
410 hashval &= 0xff;
411 secondpass = 0;
412 do {
413 /* Look for and fix any collision. */
414 TAILQ_FOREACH(tvfc, &vfsconf, vfc_list) {
415 if (hashval == tvfc->vfc_typenum) {
416 if (hashval == 255 && secondpass == 0) {
417 hashval = 1;
418 secondpass = 1;
419 } else
420 hashval++;
421 break;
422 }
423 }
424 } while (tvfc != NULL);
425 vfc->vfc_typenum = hashval;
426 if (vfc->vfc_typenum >= maxvfsconf)
427 maxvfsconf = vfc->vfc_typenum + 1;
428 } else
429 vfc->vfc_typenum = maxvfsconf++;
430 TAILQ_INSERT_TAIL(&vfsconf, vfc, vfc_list);
431
432 /*
433 * Initialise unused ``struct vfsops'' fields, to use
434 * the vfs_std*() functions. Note, we need the mount
435 * and unmount operations, at the least. The check
436 * for vfsops available is just a debugging aid.
437 */
438 KASSERT(vfc->vfc_vfsops != NULL,
439 ("Filesystem %s has no vfsops", vfc->vfc_name));
440 /*
441 * Check the mount and unmount operations.
442 */
443 vfsops = vfc->vfc_vfsops;
444 KASSERT(vfsops->vfs_mount != NULL,
445 ("Filesystem %s has no mount op", vfc->vfc_name));
446 KASSERT(vfsops->vfs_unmount != NULL,
447 ("Filesystem %s has no unmount op", vfc->vfc_name));
448
449 if (vfsops->vfs_root == NULL)
450 /* return file system's root vnode */
451 vfsops->vfs_root = vfs_stdroot;
452 if (vfsops->vfs_quotactl == NULL)
453 /* quota control */
454 vfsops->vfs_quotactl = vfs_stdquotactl;
455 if (vfsops->vfs_statfs == NULL)
456 /* return file system's status */
457 vfsops->vfs_statfs = vfs_stdstatfs;
458 if (vfsops->vfs_sync == NULL)
459 /*
460 * flush unwritten data (nosync)
461 * file systems can use vfs_stdsync
462 * explicitly by setting it in the
463 * vfsop vector.
464 */
465 vfsops->vfs_sync = vfs_stdnosync;
466 if (vfsops->vfs_vget == NULL)
467 /* convert an inode number to a vnode */
468 vfsops->vfs_vget = vfs_stdvget;
469 if (vfsops->vfs_fhtovp == NULL)
470 /* turn an NFS file handle into a vnode */
471 vfsops->vfs_fhtovp = vfs_stdfhtovp;
472 if (vfsops->vfs_checkexp == NULL)
473 /* check if file system is exported */
474 vfsops->vfs_checkexp = vfs_stdcheckexp;
475 if (vfsops->vfs_init == NULL)
476 /* file system specific initialisation */
477 vfsops->vfs_init = vfs_stdinit;
478 if (vfsops->vfs_uninit == NULL)
479 /* file system specific uninitialisation */
480 vfsops->vfs_uninit = vfs_stduninit;
481 if (vfsops->vfs_extattrctl == NULL)
482 /* extended attribute control */
483 vfsops->vfs_extattrctl = vfs_stdextattrctl;
484 if (vfsops->vfs_sysctl == NULL)
485 vfsops->vfs_sysctl = vfs_stdsysctl;
486
487 if ((vfc->vfc_flags & VFCF_SBDRY) != 0) {
488 vfc->vfc_vfsops_sd = vfc->vfc_vfsops;
489 vfc->vfc_vfsops = &vfsops_sigdefer;
490 }
491
492 if (vfc->vfc_flags & VFCF_JAIL)
493 prison_add_vfs(vfc);
494
495 /*
496 * Call init function for this VFS...
497 */
498 if ((vfc->vfc_flags & VFCF_SBDRY) != 0)
499 vfc->vfc_vfsops_sd->vfs_init(vfc);
500 else
501 vfc->vfc_vfsops->vfs_init(vfc);
502 vfsconf_unlock();
503
504 /*
505 * If this filesystem has a sysctl node under vfs
506 * (i.e. vfs.xxfs), then change the oid number of that node to
507 * match the filesystem's type number. This allows user code
508 * which uses the type number to read sysctl variables defined
509 * by the filesystem to continue working. Since the oids are
510 * in a sorted list, we need to make sure the order is
511 * preserved by re-registering the oid after modifying its
512 * number.
513 */
514 sysctl_wlock();
515 SLIST_FOREACH(oidp, SYSCTL_CHILDREN(&sysctl___vfs), oid_link) {
516 if (strcmp(oidp->oid_name, vfc->vfc_name) == 0) {
518 oidp->oid_number = vfc->vfc_typenum;
520 break;
521 }
522 }
524
525 return (0);
526}
527
528/* Remove registration of a filesystem type */
529static int
531{
532 struct vfsconf *vfsp;
533 int error, maxtypenum;
534
535 vfsconf_lock();
536 vfsp = vfs_byname_locked(vfc->vfc_name);
537 if (vfsp == NULL) {
538 vfsconf_unlock();
539 return (EINVAL);
540 }
541 if (vfsp->vfc_refcount != 0) {
542 vfsconf_unlock();
543 return (EBUSY);
544 }
545 error = 0;
546 if ((vfc->vfc_flags & VFCF_SBDRY) != 0) {
547 if (vfc->vfc_vfsops_sd->vfs_uninit != NULL)
548 error = vfc->vfc_vfsops_sd->vfs_uninit(vfsp);
549 } else {
550 if (vfc->vfc_vfsops->vfs_uninit != NULL)
551 error = vfc->vfc_vfsops->vfs_uninit(vfsp);
552 }
553 if (error != 0) {
554 vfsconf_unlock();
555 return (error);
556 }
557 TAILQ_REMOVE(&vfsconf, vfsp, vfc_list);
558 maxtypenum = VFS_GENERIC;
559 TAILQ_FOREACH(vfsp, &vfsconf, vfc_list)
560 if (maxtypenum < vfsp->vfc_typenum)
561 maxtypenum = vfsp->vfc_typenum;
562 maxvfsconf = maxtypenum + 1;
563 vfsconf_unlock();
564 return (0);
565}
566
567/*
568 * Standard kernel module handling code for filesystem modules.
569 * Referenced from VFS_SET().
570 */
571int
572vfs_modevent(module_t mod, int type, void *data)
573{
574 struct vfsconf *vfc;
575 int error = 0;
576
577 vfc = (struct vfsconf *)data;
578
579 switch (type) {
580 case MOD_LOAD:
581 if (vfc)
582 error = vfs_register(vfc);
583 break;
584
585 case MOD_UNLOAD:
586 if (vfc)
587 error = vfs_unregister(vfc);
588 break;
589 default:
590 error = EOPNOTSUPP;
591 break;
592 }
593 return (error);
594}
device_property_type_t type
Definition: bus_if.m:941
const char * name
Definition: kern_fail.c:145
void prison_add_vfs(struct vfsconf *vfsp)
Definition: kern_jail.c:4518
int kern_kldload(struct thread *td, const char *file, int *fileid)
Definition: kern_linker.c:1128
int kern_kldunload(struct thread *td, int fileid, int flags)
Definition: kern_linker.c:1197
void sysctl_unregister_oid(struct sysctl_oid *oidp)
Definition: kern_sysctl.c:557
void sysctl_wunlock(void)
Definition: kern_sysctl.c:158
void sysctl_register_oid(struct sysctl_oid *oidp)
Definition: kern_sysctl.c:425
void sysctl_wlock(void)
Definition: kern_sysctl.c:151
uint32_t * data
Definition: msi_if.m:90
int printf(const char *fmt,...)
Definition: subr_prf.c:397
uint16_t flags
Definition: subr_stats.c:2
int vfs_stdsysctl(struct mount *mp, fsctlop_t op, struct sysctl_req *req)
Definition: vfs_default.c:1620
int vfs_stdextattrctl(struct mount *mp, int cmd, struct vnode *filename_vp, int attrnamespace, const char *attrname)
Definition: vfs_default.c:1606
int vfs_stdvget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
Definition: vfs_default.c:1568
int vfs_stdroot(struct mount *mp, int flags, struct vnode **vpp)
Definition: vfs_default.c:1481
int vfs_stdstatfs(struct mount *mp, struct statfs *sbp)
Definition: vfs_default.c:1491
int vfs_stdinit(struct vfsconf *vfsp)
Definition: vfs_default.c:1590
int vfs_stdquotactl(struct mount *mp, int cmds, uid_t uid, void *arg, bool *mp_busy)
Definition: vfs_default.c:1500
int vfs_stdfhtovp(struct mount *mp, struct fid *fhp, int flags, struct vnode **vpp)
Definition: vfs_default.c:1579
int vfs_stduninit(struct vfsconf *vfsp)
Definition: vfs_default.c:1598
int vfs_stdnosync(struct mount *mp, int waitfor)
Definition: vfs_default.c:1548
int vfs_stdcheckexp(struct mount *mp, struct sockaddr *nam, uint64_t *extflagsp, struct ucred **credanonp, int *numsecflavors, int *secflavors)
Definition: vfs_export.c:516
int attrnamespace
Definition: vfs_extattr.c:716
static int vfs_extattrctl_sigdefer(struct mount *mp, int cmd, struct vnode *filename_vp, int attrnamespace, const char *attrname)
Definition: vfs_init.c:286
struct vfsconfhead vfsconf
Definition: vfs_init.c:70
static int vfs_unregister(struct vfsconf *)
Definition: vfs_init.c:530
static int vfs_unmount_sigdefer(struct mount *mp, int mntflags)
Definition: vfs_init.c:182
MALLOC_DEFINE(M_VNODE, "vnodes", "Dynamically allocated vnodes")
static int vfs_register(struct vfsconf *)
Definition: vfs_init.c:377
static int vfs_sysctl_sigdefer(struct mount *mp, fsctlop_t op, struct sysctl_req *req)
Definition: vfs_init.c:299
int vfs_modevent(module_t mod, int type, void *data)
Definition: vfs_init.c:572
static int vfs_checkexp_sigdefer(struct mount *mp, struct sockaddr *nam, uint64_t *exflg, struct ucred **credp, int *numsecflavors, int *secflavors)
Definition: vfs_init.c:273
static int vfs_sync_sigdefer(struct mount *mp, int waitfor)
Definition: vfs_init.c:239
static void vfs_purge_sigdefer(struct mount *mp)
Definition: vfs_init.c:346
SYSCTL_INT(_vfs, OID_AUTO, typenumhash, CTLFLAG_RDTUN, &vfs_typenumhash, 0, "Set vfc_typenum using a hash calculation on vfc_name, so that it does not" "change when file systems are loaded in a different order.")
struct sx vfsconf_sx
Definition: vfs_init.c:71
static void vfs_unlink_lowervp_sigdefer(struct mount *mp, struct vnode *vp)
Definition: vfs_init.c:334
static void vfs_reclaim_lowervp_sigdefer(struct mount *mp, struct vnode *vp)
Definition: vfs_init.c:322
__FBSDID("$FreeBSD$")
static int vfs_typenumhash
Definition: vfs_init.c:80
struct vattr va_null
Definition: vfs_init.c:90
struct vfsconf * vfs_byname_kld(const char *fstype, struct thread *td, int *error)
Definition: vfs_init.c:140
static int vfs_statfs_sigdefer(struct mount *mp, struct statfs *sbp)
Definition: vfs_init.c:228
static int vfs_fhtovp_sigdefer(struct mount *mp, struct fid *fidp, int flags, struct vnode **vpp)
Definition: vfs_init.c:261
struct vfsconf * vfs_byname(const char *name)
Definition: vfs_init.c:129
static int vfs_quotactl_sigdefer(struct mount *mp, int cmd, uid_t uid, void *arg, bool *mp_busy)
Definition: vfs_init.c:215
static void vfs_susp_clean_sigdefer(struct mount *mp)
Definition: vfs_init.c:310
static int vfs_mount_sigdefer(struct mount *mp)
Definition: vfs_init.c:169
static struct vfsconf * vfs_byname_locked(const char *name)
Definition: vfs_init.c:114
SX_SYSINIT(vfsconf, &vfsconf_sx, "vfsconf")
static int vfs_root_sigdefer(struct mount *mp, int flags, struct vnode **vpp)
Definition: vfs_init.c:193
static struct vfsops vfsops_sigdefer
Definition: vfs_init.c:355
static int vfs_cachedroot_sigdefer(struct mount *mp, int flags, struct vnode **vpp)
Definition: vfs_init.c:204
int maxvfsconf
Definition: vfs_init.c:64
static int vfs_vget_sigdefer(struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
Definition: vfs_init.c:250
void vattr_null(struct vattr *vap)
Definition: vfs_subr.c:1085