path: root/sys/sys/mount.h
Commit message (Collapse)AuthorAgeFilesLines
* vfs: group mount per-cpu vars into one structMateusz Guzik2020-11-091-31/+44
| | | | | | | | | | | While here move frequently read stuff into the same cacheline. This shrinks struct mount by 64 bytes. Tested by: pho Notes: svn path=/head/; revision=367535
* Suspend all writeable local filesystems on power suspend.Konstantin Belousov2020-11-051-0/+4
| | | | | | | | | | | | | | | | | | | | | This ensures that no writes are pending in memory, either metadata or user data, but not including dirty pages not yet converted to fs writes. Only filesystems declared local are suspended. Note that this does not guarantee absence of the metadata errors or leaks if resume is not done: for instance, on UFS unlinked but opened inodes are leaked and require fsck to gc. Reviewed by: markj Discussed with: imp Tested by: imp (previous version), pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D27054 Notes: svn path=/head/; revision=367398
* vfs: annotate mountlist_mtx with __exclusive_cache_lineMateusz Guzik2020-10-171-1/+1
| | | | Notes: svn path=/head/; revision=366783
* Add MNT_EXTLSxxx flags that will be used for NFS over TLS exports.Rick Macklem2020-08-261-0/+3
| | | | | | | | | | | These flags are not currently used, but will be used by future commits to implement export(5) requirements for the use of NFS over TLS by clients. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D26180 Notes: svn path=/head/; revision=364836
* Move the mount name to bit mapping into sys/mount.h so it can be shared with theWarner Losh2020-08-191-0/+39
| | | | | | | | | | | | kernel. Discussed with: kib@ Reviewed by: kirk@ (prior version) Sponsored by: Netflix Diffential Revision: https://reviews.freebsd.org/D25969 Notes: svn path=/head/; revision=364401
* vfs: add vfs_op_thread_enter/exit _crit variantsMateusz Guzik2020-08-041-6/+19
| | | | | | | and employ them in the namecache. Eliminates all spurious checks for preemption. Notes: svn path=/head/; revision=363856
* vfs: add the infrastructure for lockless lookupMateusz Guzik2020-07-251-0/+1
| | | | | | | | | Reviewed by: kib Tested by: pho (in a patchset) Differential Revision: https://reviews.freebsd.org/D25577 Notes: svn path=/head/; revision=363518
* Oops, r362158 committed a duplicate definition of MAXSECFLAVORS.Rick Macklem2020-06-141-1/+0
| | | | | | | This patch gets rid of the duplicate. Notes: svn path=/head/; revision=362164
* Fix export_args ex_flags field so that is 64bits, the same as mnt_flags.Rick Macklem2020-06-141-6/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since mnt_flags was upgraded to 64bits there has been a quirk in "struct export_args", since it hold a copy of mnt_flags in ex_flags, which is an "int" (32bits). This happens to currently work, since all the flag bits used in ex_flags are defined in the low order 32bits. However, new export flags cannot be defined. Also, ex_anon is a "struct xucred", which limits it to 16 additional groups. This patch revises "struct export_args" to make ex_flags 64bits and replaces ex_anon with ex_uid, ex_ngroups and ex_groups (which points to a groups list, so it can be malloc'd up to NGROUPS in size. This requires that the VFS_CHECKEXP() arguments change, so I also modified the last "secflavors" argument to be an array pointer, so that the secflavors could be copied in VFS_CHECKEXP() while the export entry is locked. (Without this patch VFS_CHECKEXP() returns a pointer to the secflavors array and then it is used after being unlocked, which is potentially a problem if the exports entry is changed. In practice this does not occur when mountd is run with "-S", but I think it is worth fixing.) This patch also deleted the vfs_oexport_conv() function, since do_mount_update() does the conversion, as required by the old vfs_cmount() calls. Reviewed by: kib, freqlabs Relnotes: yes Differential Revision: https://reviews.freebsd.org/D25088 Notes: svn path=/head/; revision=362158
* tmpfs: Preserve alignment of struct fid fieldsRyan Moeller2020-06-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | On 64-bit platforms, the two short fields in `struct tmpfs_fid` are padded to the 64-bit alignment of the long field. This pushes the offsets of the subsequent fields by 4 bytes and makes `struct tmpfs_fid` bigger than `struct fid`. `tmpfs_vptofh()` casts a `struct fid *` to `struct tmpfs_fid *`, causing 4 bytes of adjacent memory to be overwritten when the struct fields are set. Through several layers of indirection and embedded structs, the adjacent memory for one particular call to `tmpfs_vptofh()` happens to be the stack canary for `nfsrvd_compound()`. Half of the canary ends up being clobbered, going unnoticed until eventually the stack check fails when `nfsrvd_compound()` returns and a panic is triggered. Instead of duplicating fields of `struct fid` in `struct tmpfs_fid`, narrow the struct to cover only the unique fields for tmpfs and assert at compile time that the struct fits in the allotted space. This way we don't have to replicate the offsets of `struct fid` fields, we just use them directly. Reviewed by: kib, mav, rmacklem Approved by: mav (mentor) MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25077 Notes: svn path=/head/; revision=361748
* Deduplicate fsid comparisonsRyan Moeller2020-05-211-0/+2
| | | | | | | | | | | | | | | | Comparing fsid_t objects requires internal knowledge of the fsid structure and yet this is duplicated across a number of places in the code. Simplify by creating a fsidcmp function (macro). Reviewed by: mjg, rmacklem Approved by: mav (mentor) MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24749 Notes: svn path=/head/; revision=361313
* Add a new "mntfs" pseudo file system which provides private device vnodes forChuck Silvers2020-03-061-0/+2
| | | | | | | | | | | | | | file systems to safely access their disk devices, and adapt FFS to use it. Also add a new BO_NOBUFS flag to allow enforcing that file systems using mntfs vnodes do not accidentally use the original devfs vnode to create buffers. Reviewed by: kib, mckusick Approved by: imp (mentor) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D23787 Notes: svn path=/head/; revision=358714
* vfs: switch to smp_rendezvous_cpus_retry for vfs_op_thread_enter/exitMateusz Guzik2020-02-121-9/+4
| | | | | | | | | In particular on amd64 this eliminates an atomic op in the common case, trading it for IPIs in the uncommon case of catching CPUs executing the code while the filesystem is getting suspended or unmounted. Notes: svn path=/head/; revision=357810
* vfs: use newly added zpcpu routines instead of direct access where appropriateMateusz Guzik2020-02-071-5/+5
| | | | Notes: svn path=/head/; revision=357674
* vfs: provide F_ISUNIONSTACK as a kludge for libcMateusz Guzik2020-01-171-0/+1
| | | | | | | | | | | | Prior to introduction of this op libc's readdir would call fstatfs(2), in effect unnecessarily copying kilobytes of data just to check fs name and a mount flag. Reviewed by: kib (previous version) Differential Revision: https://reviews.freebsd.org/D23162 Notes: svn path=/head/; revision=356830
* vfs: rework vnode list managementMateusz Guzik2020-01-131-18/+0
| | | | | | | | | | | | | | | | | | | | | | | The current notion of an active vnode is eliminated. Vnodes transition between 0<->1 hold counts all the time and the associated traversal between different lists induces significant scalability problems in certain workloads. Introduce a global list containing all allocated vnodes. They get unlinked only when UMA reclaims memory and are only requeued when hold count reaches 0. Sample result from an incremental make -s -j 104 bzImage on tmpfs: stock: 118.55s user 3649.73s system 7479% cpu 50.382 total patched: 122.38s user 1780.45s system 6242% cpu 30.480 total Reviewed by: jeff Tested by: pho (in a larger patch, previous version) Differential Revision: https://reviews.freebsd.org/D22997 Notes: svn path=/head/; revision=356672
* vfs: add per-mount vnode lazy list and use it for deferred inactive + msyncMateusz Guzik2020-01-131-0/+20
| | | | | | | | | | | | | | | | | | | | | This obviates the need to scan the entire active list looking for vnodes of interest. msync is handled by adding all vnodes with write count to the lazy list. deferred inactive directly adds vnodes as it sets the VI_DEFINACT flag. Vnodes get dequeued from the list when their hold count reaches 0. Newly added MNT_VNODE_FOREACH_LAZY* macros support filtering so that spurious locking is avoided in the common case. Reviewed by: jeff Tested by: pho (in a larger patch, previous version) Differential Revision: https://reviews.freebsd.org/D22995 Notes: svn path=/head/; revision=356670
* vfs: reimplement deferred inactive to use a dedicated flag (VI_DEFINACT)Mateusz Guzik2020-01-071-2/+2
| | | | | | | | | | | | | | The previous behavior of leaving VI_OWEINACT vnodes on the active list without a hold count is eliminated. Hold count is kept and inactive processing gets explicitly deferred by setting the VI_DEFINACT flag. The syncer is then responsible for vdrop. Reviewed by: kib (previous version) Tested by: pho (in a larger patch, previous version) Differential Revision: https://reviews.freebsd.org/D23036 Notes: svn path=/head/; revision=356441
* Assert that vnode_pager_setsize() is called with the vnode exclusively lockedKonstantin Belousov2019-10-221-0/+1
| | | | | | | | | | | | except for filesystems that set the MNTK_VMSETSIZE_BUG, Set the flag for ZFS. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D21883 Notes: svn path=/head/; revision=353892
* vfs: add MNTK_NOMSYNCMateusz Guzik2019-10-131-0/+1
| | | | | | | | | | | | On many filesystems the traversal is effectively a no-op. Add a way to avoid the overhead. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22009 Notes: svn path=/head/; revision=353469
* vfs: add optional root vnode cachingMateusz Guzik2019-10-061-0/+11
| | | | | | | | | | | | | Root vnodes looekd up all the time, e.g. when crossing a mount point. Currently used routines always perform a costly lookup which can be trivially avoided. Reviewed by: jeff (previous version), kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21646 Notes: svn path=/head/; revision=353150
* Add two options to allow mount to avoid covering up existing mount points.Sean Eric Fagan2019-09-231-1/+3
| | | | | | | | | | | | | | | | | | | The two options are * nocover/cover: Prevent/allow mounting over an existing root mountpoint. E.g., "mount -t ufs -o nocover /dev/sd1a /usr/local" will fail if /usr/local is already a mountpoint. * emptydir/noemptydir: Prevent/allow mounting on a non-empty directory. E.g., "mount -t ufs -o emptydir /dev/sd1a /usr" will fail. Neither of these options is intended to be a default, for historical and compatibility reasons. Reviewed by: allanjude, kib Differential Revision: https://reviews.freebsd.org/D21458 Notes: svn path=/head/; revision=352614
* vfs: group fields used for per-cpu ops in one cachelineMateusz Guzik2019-09-191-1/+1
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=352543
* vfs: convert struct mount counters to per-cpuMateusz Guzik2019-09-161-18/+38
| | | | | | | | | | | | | | | | | | | | | There are 3 counters modified all the time in this structure - one for keeping the structure alive, one for preventing unmount and one for tracking active writers. Exact values of these counters are very rarely needed, which makes them a prime candidate for conversion to a per-cpu scheme, resulting in much better performance. Sample benchmark performing fstatfs (modifying 2 out of 3 counters) on a 104-way 2 socket Skylake system: before: 852393 ops/s after: 76682077 ops/s Reviewed by: kib, jeff Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21637 Notes: svn path=/head/; revision=352427
* vfs: manage mnt_ref with atomicsMateusz Guzik2019-09-161-4/+59
| | | | | | | | | | | | | | | | | | New primitive is introduced to denote sections can operate locklessly on aspects of struct mount, but which can also be disabled if necessary. This provides an opportunity to start scaling common case modifications while providing stable state of the struct when facing unmount, write suspendion or other events. mnt_ref is the first counter to start being managed in this manner with the intent to make it per-cpu. Reviewed by: kib, jeff Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21425 Notes: svn path=/head/; revision=352424
* sys/mount.h: Comment on distinction between vfs_{c,}mountConrad Meyer2019-09-051-0/+12
| | | | | | | | | Hope to save someone else a little future effort in ugly duplicated code. No functional change. Notes: svn path=/head/; revision=351835
* vfs: assert the lock held in MNT_REF/MNT_RELMateusz Guzik2019-08-231-1/+5
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=351438
* De-commision the MNTK_NOINSMNTQ kernel mount flag.Konstantin Belousov2019-08-231-8/+5
| | | | | | | | | | | | | | After all the changes, its dynamic scope is same as for MNTK_UNMOUNT, but to allow the syncer vnode to be re-installed on unmount failure. But the case of syncer was already handled by using the VV_FORCEINSMQ flag for quite some time. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=351435
* Fix an issue with executing tmpfs binary.Konstantin Belousov2019-08-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suppose that a binary was executed from tmpfs mount, and the text vnode was reclaimed while the binary was still running. It is possible during even the normal operations since tmpfs vnode' vm_object has swap type, and no references on the vnode is held. Also assume that the text vnode was revived for some reason. Then, on the process exit or exec, unmapping of the text mapping tries to remove the text reference from the vnode, but since it went from recycle/instantiation cycle, there is no reference kept, and assertion in VOP_UNSET_TEXT_CHECKED() triggers. Fix this by keeping a use reference on the tmpfs vnode for each exec reference. This prevents the vnode reclamation while executable map entry is active. Do it by adding per-mount flag MNTK_TEXT_REFS that directs vop_stdset_text() to add use ref on first vnode text use, and per-vnode VI_TEXT_REF flag, to record the need on unref in vop_stdunset_text() on last vnode text use going away. Set MNTK_TEXT_REFS for tmpfs mounts. Reported by: bdrewery Tested by: sbruno, pho (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=351195
* Add a new "untrusted" option to the mount command. Its purposeKirk McKusick2019-07-011-2/+4
| | | | | | | | | | | | | | | | | | | is to notify the kernel that the file system is untrusted and it should use more extensive checks on the file-system's metadata before using it. This option is intended to be used when mounting file systems from untrusted media such as USB memory sticks or other externally-provided media. It will initially be used by the UFS/FFS file system, but should likely be expanded to be used by other file systems that may appear on external media like msdosfs, exfat, and ext2fs. Reviewed by: kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20786 Notes: svn path=/head/; revision=349589
* Add new file handle system calls.Konstantin Belousov2018-12-071-0/+4
| | | | | | | | | | | | | | | Namely, getfhat(2), fhlink(2), fhlinkat(2), fhreadlink(2). The syscalls are provided for a NFS userspace server (nfs-ganesha). Submitted by: Jack Halford <jack@gandi.net> Sponsored by: Gandi.net Tested by: pho Feedback from: brooks, markj MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18359 Notes: svn path=/head/; revision=341689
* Clarify explanation of VFCF_SBDRY.Konstantin Belousov2018-10-291-1/+2
| | | | | | | | | Requested by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 3 days Notes: svn path=/head/; revision=339892
* Only call sigdeferstop() for NFS.Konstantin Belousov2018-10-231-43/+1
| | | | | | | | | | | | | | | | | | | | Use bypass to catch any NFS VOP dispatch and route it through the wrapper which does sigdeferstop() and then dispatches original VOP. NFS does not need a bypass below it, which is not supported. The vop offset in the vop_vector is added since otherwise it is impossible to get vop_op_t from the internal table, and I did not wanted to create the layered fs only to wrap NFS VOPs. VFS_OP()s wrap is straightforward. Requested and reviewed by: mjg (previous version) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D17658 Notes: svn path=/head/; revision=339672
* Make it easier for filesystems to count themselves as jail-enabled,Jamie Gritton2018-05-041-1/+3
| | | | | | | | | | | | | | | by doing most of the work in a new function prison_add_vfs in kern_jail.c Now a jail-enabled filesystem need only mark itself with VFCF_JAIL, and the rest is taken care of. This includes adding a jail parameter like allow.mount.foofs, and a sysctl like security.jail.mount_foofs_allowed. Both of these used to be a static list of known filesystems, with predefined permission bits. Reviewed by: kib Differential Revision: D14681 Notes: svn path=/head/; revision=333263
* Use the TSLOG framework to record entry/exit timestamps for VFS_MOUNT calls.Colin Percival2017-12-311-0/+3
| | | | Notes: svn path=/head/; revision=327429
* sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326023
* Add MD_VERIFY option to enable O_VERIFY in open for vnode type.Stephen J. Kiernan2017-05-311-1/+2
| | | | | | | | | | | | | | | | Add -o [no]verify option to mdconfig (and document in man page.) Implement GEOM attribute MNT::verified to ask md if the backing vnode is verified. Check for MNT::verified in cd9660 mount to flag the mount as MNT_VERIFIED if the underlying device has been verified. Reviewed by: rwatson Approved by: sjg (mentor) Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D2902 Notes: svn path=/head/; revision=319358
* Commit the 64-bit inode project.Konstantin Belousov2017-05-231-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend the ino_t, dev_t, nlink_t types to 64-bit ints. Modify struct dirent layout to add d_off, increase the size of d_fileno to 64-bits, increase the size of d_namlen to 16-bits, and change the required alignment. Increase struct statfs f_mntfromname[] and f_mntonname[] array length MNAMELEN to 1024. ABI breakage is mitigated by providing compatibility using versioned symbols, ingenious use of the existing padding in structures, and by employing other tricks. Unfortunately, not everything can be fixed, especially outside the base system. For instance, third-party APIs which pass struct stat around are broken in backward and forward incompatible ways. Kinfo sysctl MIBs ABI is changed in backward-compatible way, but there is no general mechanism to handle other sysctl MIBS which return structures where the layout has changed. It was considered that the breakage is either in the management interfaces, where we usually allow ABI slip, or is not important. Struct xvnode changed layout, no compat shims are provided. For struct xtty, dev_t tty device member was reduced to uint32_t. It was decided that keeping ABI compat in this case is more useful than reporting 64-bit dev_t, for the sake of pstat. Update note: strictly follow the instructions in UPDATING. Build and install the new kernel with COMPAT_FREEBSD11 option enabled, then reboot, and only then install new world. Credits: The 64-bit inode project, also known as ino64, started life many years ago as a project by Gleb Kurtsou (gleb). Kirk McKusick (mckusick) then picked up and updated the patch, and acted as a flag-waver. Feedback, suggestions, and discussions were carried by Ed Maste (emaste), John Baldwin (jhb), Jilles Tjoelker (jilles), and Rick Macklem (rmacklem). Kris Moore (kris) performed an initial ports investigation followed by an exp-run by Antoine Brodin (antoine). Essential and all-embracing testing was done by Peter Holm (pho). The heavy lifting of coordinating all these efforts and bringing the project to completion were done by Konstantin Belousov (kib). Sponsored by: The FreeBSD Foundation (emaste, kib) Differential revision: https://reviews.freebsd.org/D10439 Notes: svn path=/head/; revision=318736
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Do not allocate struct statfs on kernel stack.Konstantin Belousov2017-01-051-0/+1
| | | | | | | | | | | | | | | | Right now size of the structure is 472 bytes on amd64, which is already large and stack allocations are indesirable. With the ino64 work, MNAMELEN is increased to 1024, which will make it impossible to have struct statfs on the stack. Extracted from: ino64 work by gleb Discussed with: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=311452
* NFSv4 client tracks opens, and the track records are only dropped whenKonstantin Belousov2016-11-271-1/+2
| | | | | | | | | | | | | | | | | | the vnode is inactivated. This contradicts with the nullfs caching which keeps upper vnode around, as consequence keeping the use reference to lower vnode. Add a filesystem flag to request nullfs to not cache when mounted over that filesystem, and set the flag for nfs v4 mounts. Reported by: asomers Reviewed by: rmacklem Tested by: asomers, rmacklem Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=309209
* vfs: batch free vnodes in per-mnt listsMateusz Guzik2016-09-301-2/+6
| | | | | | | | | | | | | | | | | Previously free vnodes would always by directly returned to the global LRU list. With this change up to mnt_free_list_batch vnodes are collected first. syncer runs always return the batch regardless of its size. While vnodes on per-mnt lists are not counted as free, they can be returned in case of vnode shortage. Reviewed by: kib Tested by: pho Notes: svn path=/head/; revision=306512
* Add new unmount(2) flag, MNT_NONBUSY, to check whether there areEdward Tomasz Napierala2016-07-071-3/+7
| | | | | | | | | | | | | | any open vnodes before proceeding. Make autounmound(8) use this flag. Without it, even an unsuccessfull unmount causes filesystem flush, which interferes with normal operation. Reviewed by: kib@ Approved by: re (gjb@) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D7047 Notes: svn path=/head/; revision=302388
* Rewrite sigdeferstop(9) and sigallowstop(9) into more flexibleKonstantin Belousov2016-06-261-5/+5
| | | | | | | | | | | | | | | | framework allowing to set the suspension policy for the dynamic block. Extend the currently possible policies of stopping on interruptible sleeps and ignoring such sleeps by two more: do not suspend at interruptible sleeps, but interrupt them with either EINTR or ERESTART. Reviewed by: jilles Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Approved by: re (gjb) Notes: svn path=/head/; revision=302215
* Remove remnants of the old NFS from vnode pager.Gleb Smirnoff2015-11-201-1/+0
| | | | | | | | Reviewed by: kib Sponsored by: Netflix Notes: svn path=/head/; revision=291116
* Check suspendability on the mountpoint returned by VOP_GETWRITEMOUNT.Mark Johnston2015-07-051-1/+1
| | | | | | | | | | | | | | This obviates the need for a MNTK_SUSPENDABLE flag, since passthrough filesystems like nullfs and unionfs no longer need to inherit this information from their lower layer(s). This change also restores the pre-r273336 behaviour of using the presence of a susp_clean VFS method to request suspension support. Reviewed by: kib, mjg Differential Revision: https://reviews.freebsd.org/D2937 Notes: svn path=/head/; revision=285182
* File systems that do not use the buffer cache (such as ZFS) mustRick Macklem2015-04-151-0/+1
| | | | | | | | | | | | | | | | use VOP_FSYNC() to perform the NFS server's Commit operation. This patch adds a mnt_kern_flag called MNTK_USES_BCACHE which is set by file systems that use the buffer cache. If this flag is not set, the NFS server always does a VOP_FSYNC(). This should be ok for old file system modules that do not set MNTK_USES_BCACHE, since calling VOP_FSYNC() is correct, although it might not be optimal for file systems that use the buffer cache. Reviewed by: kib MFC after: 2 weeks Notes: svn path=/head/; revision=281562
* Add functions syncer_suspend() and syncer_resume(), which are supposedKonstantin Belousov2014-12-081-0/+3
| | | | | | | | | | | | | | | | | | to be called before suspension and after resume, correspondingly. The syncer_suspend() ensures that all filesystems dirty data and metadata are saved to the permanent storage, and stops kernel threads which might modify filesystems. The syncer_resume() restores stopped threads. For now, only syncer is stopped. This is needed, because each sync loop causes superblock updates for UFS. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=275620
* Provide vfs suspension support only for filesystems which need it, takeMateusz Guzik2014-10-201-5/+6
| | | | | | | | | | | | | | | | two. nullfs and unionfs need to request suspension if underlying filesystem(s) use it. Utilize mnt_kern_flag for this purpose. This is a fixup for 273271. No strong objections from: kib Pointy hat to: mjg MFC after: 2 weeks Notes: svn path=/head/; revision=273336
* Provide vfs suspension support only for filesystems which need it.Mateusz Guzik2014-10-191-5/+4
| | | | | | | | | | | Need is expressed by providing vfs_susp_clean function in vfsops. Differential Revision: D952 Reviewed by: kib (previous version) MFC after: 2 weeks Notes: svn path=/head/; revision=273271