summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_default.c
Commit message (Collapse)AuthorAgeFilesLines
* Make MAXPHYS tunable. Bump MAXPHYS to 1M.Konstantin Belousov2020-11-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace MAXPHYS by runtime variable maxphys. It is initialized from MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys. Make b_pages[] array in struct buf flexible. Size b_pages[] for buffer cache buffers exactly to atop(maxbcachebuf) (currently it is sized to atop(MAXPHYS)), and b_pages[] for pbufs is sized to atop(maxphys) + 1. The +1 for pbufs allow several pbuf consumers, among them vmapbuf(), to use unaligned buffers still sized to maxphys, esp. when such buffers come from userspace (*). Overall, we save significant amount of otherwise wasted memory in b_pages[] for buffer cache buffers, while bumping MAXPHYS to desired high value. Eliminate all direct uses of the MAXPHYS constant in kernel and driver sources, except a place which initialize maxphys. Some random (and arguably weird) uses of MAXPHYS, e.g. in linuxolator, are converted straight. Some drivers, which use MAXPHYS to size embeded structures, get private MAXPHYS-like constant; their convertion is out of scope for this work. Changes to cam/, dev/ahci, dev/ata, dev/mpr, dev/mpt, dev/mvs, dev/siis, where either submitted by, or based on changes by mav. Suggested by: mav (*) Reviewed by: imp, mav, imp, mckusick, scottl (intermediate versions) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27225 Notes: svn path=/head/; revision=368124
* vfs: group mount per-cpu vars into one structMateusz Guzik2020-11-091-4/+5
| | | | | | | | | | | 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
* vfs: drop spurious cred argument from VOP_VPTOCNPMateusz Guzik2020-10-201-1/+2
| | | | Notes: svn path=/head/; revision=366869
* vfs: add VOP_EAGAINMateusz Guzik2020-10-151-0/+7
| | | | | | | Can be used to stub fplookup for example. Notes: svn path=/head/; revision=366716
* Convert page cache read to VOP.Konstantin Belousov2020-09-151-0/+8
| | | | | | | | | | | | | | | | | | | | | There are several negative side-effects of not calling into VOP layer at all for page cache reads. The biggest is the missed activation of EVFILT_READ knotes. Also, it allows filesystem to make more fine grained decision to refuse read from page cache. Keep VIRF_PGREAD flag around, it is still useful for nullfs, and for asserts. Reviewed by: markj Tested by: pho Discussed with: mjg Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D26346 Notes: svn path=/head/; revision=365785
* vfs: assert that VI_TEXT_REF is not already setMateusz Guzik2020-08-161-0/+1
| | | | Notes: svn path=/head/; revision=364282
* vfs: remove the thread argument from vgetMateusz Guzik2020-08-161-1/+1
| | | | | | | | | | | | | | | | | | It was already asserted to be curthread. Semantic patch: @@ expression arg1, arg2, arg3; @@ - vget(arg1, arg2, arg3) + vget(arg1, arg2) Notes: svn path=/head/; revision=364271
* vfs: add VOP_STATMateusz Guzik2020-08-071-0/+113
| | | | | | | | | | | | | | The current scheme of calling VOP_GETATTR adds avoidable overhead. An example with tmpfs doing fstat (ops/s): before: 7488958 after: 7913833 Reviewed by: kib (previous version) Differential Revision: https://reviews.freebsd.org/D25910 Notes: svn path=/head/; revision=364044
* vfs: fold poll_no_poll into vop_nopollMateusz Guzik2020-07-301-1/+3
| | | | | | | The logic was almost completely present in vop_stdpoll anyway. Notes: svn path=/head/; revision=363707
* VOP_GETPAGES_ASYNC(): consistently call iodone() callback in case of error.Konstantin Belousov2020-03-301-1/+2
| | | | | | | | | | | Reviewed by: glebius, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24038 Notes: svn path=/head/; revision=359466
* lockmgr: add a change missed in r357907Mateusz Guzik2020-02-141-1/+1
| | | | Notes: svn path=/head/; revision=357909
* lockmgr: rename lock_fast_path to lock_flagsMateusz Guzik2020-02-141-1/+1
| | | | | | | | The routine is not much of a fast path and the flags name better describes its purpose. Notes: svn path=/head/; revision=357907
* vfs: consistently use size_t for buflen around VOP_VPTOCNPMateusz Guzik2020-02-011-1/+1
| | | | Notes: svn path=/head/; revision=357383
* vfs: remove vop loop from vop_sigdeferMateusz Guzik2020-01-261-14/+1
| | | | | | | All ops are guaranteed to be present since r357131. Notes: svn path=/head/; revision=357135
* vfs: switch vop_stdunlock to call lockmgr_unlockMateusz Guzik2020-01-191-1/+1
| | | | | | | | Since the flags argument is now alawys 0 the new call provides the same behavior. Notes: svn path=/head/; revision=356898
* vfs: in vop_stdadd_writecount only vlazy vnodes on mounts using msyncMateusz Guzik2020-01-151-2/+6
| | | | | | | | | | | | The only reason to vlazy there is to (overzealously) ensure all vnodes which need to be visited by msync scan can be found there. In particluar this is of no use zfs and tmpfs. While here depessimize the check. Notes: svn path=/head/; revision=356745
* vfs: add per-mount vnode lazy list and use it for deferred inactive + msyncMateusz Guzik2020-01-131-0/+2
| | | | | | | | | | | | | | | | | | | | | 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: drop the mostly unused flags argument from VOP_UNLOCKMateusz Guzik2020-01-031-19/+13
| | | | | | | | | | | Filesystems which want to use it in limited capacity can employ the VOP_UNLOCK_FLAGS macro. Reviewed by: kib (previous version) Differential Revision: https://reviews.freebsd.org/D21427 Notes: svn path=/head/; revision=356337
* vfs: flatten vop vectorsMateusz Guzik2019-12-161-0/+1
| | | | | | | | | | | | | | | This eliminates the following loop from all VOP calls: while(vop != NULL && \ vop->vop_spare2 == NULL && vop->vop_bypass == NULL) vop = vop->vop_default; Reviewed by: jeff Tesetd by: pho Differential Revision: https://reviews.freebsd.org/D22738 Notes: svn path=/head/; revision=355790
* r355677 requires that vop_stdioctl() be global so it can be called from NFS.Rick Macklem2019-12-131-2/+1
| | | | | | | | | | | r355677 modified the NFS client so that it does lseek(SEEK_DATA/SEEK_HOLE) for NFSv4.2, but calls vop_stdioctl() otherwise. As such, vop_stdioctl() needs to be a global function. Missed during the code merge for r355677. Notes: svn path=/head/; revision=355681
* vfs: locking primitives which elide ->v_vnlock and shared locking disablementMateusz Guzik2019-12-111-0/+65
| | | | | | | | | | | | | | | | | | | Both of these features are not needed by many consumers and result in avoidable reads which in turn puts them on profiles due to cache-line ping ponging. On top of that the current lockgmr entry point is slower than necessary single-threaded. As an attempted clean up preparing for other changes, provide new routines which don't support any of the aforementioned features. With these patches in place vop_stdlock and vop_stdunlock disappear from flamegraphs during -j 104 buildkernel. Reviewed by: jeff (previous version) Tested by: pho Differential Revision: https://reviews.freebsd.org/D22665 Notes: svn path=/head/; revision=355633
* vfs: introduce v_irflag and make v_type smallerMateusz Guzik2019-12-081-2/+2
| | | | | | | | | | | | | | | | | | The current vnode layout is not smp-friendly by having frequently read data avoidably sharing cachelines with very frequently modified fields. In particular v_iflag inspected for VI_DOOMED can be found in the same line with v_usecount. Instead make it available in the same cacheline as the v_op, v_data and v_type which all get read all the time. v_type is avoidably 4 bytes while the necessary data will easily fit in 1. Shrinking it frees up 3 bytes, 2 of which get used here to introduce a new flag field with a new value: VIRF_DOOMED. Reviewed by: kib, jeff Differential Revision: https://reviews.freebsd.org/D22715 Notes: svn path=/head/; revision=355537
* vfs: apply r352437 to the fast path as wellMateusz Guzik2019-09-171-3/+5
| | | | | | | | | | | | This one is very hard to run into. If the filesystem is being unmounted or the mount point is freed the vfs_op_thread_enter will fail. For it to succeed the mount point itself would have to be reallocated in the time window between the initial read and the attempt to enter. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=352450
* vfs: fix braino resulting in NULL pointer deref in r352424Mateusz Guzik2019-09-171-3/+5
| | | | | | | | | | | The breakage was added after all the testing and the testing which followed was not sufficient to find it. Reported by: pho Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=352437
* vfs: convert struct mount counters to per-cpuMateusz Guzik2019-09-161-1/+1
| | | | | | | | | | | | | | | | | | | | | 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-9/+16
| | | | | | | | | | | | | | | | | | 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
* vfs: restore mp null check in vop_stdgetwritemountMateusz Guzik2019-09-021-0/+2
| | | | | | | | | | | The initially read mount point can already be NULL. Reported by: markj Fixes: r351656 ("vfs: stop refing freed mount points in vop_stdgetwritemount") Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=351702
* vfs: stop refing freed mount points in vop_stdgetwritemountMateusz Guzik2019-09-011-12/+18
| | | | | | | | | | | | | | The code used blindly ref based on an unsafely red address and then would backpedal if necessary. This was safe in terms of memory access since mounts are type-stable, but made for a potential a bug where the mount was reused and had the count reset to 0 before this code decreased it. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21411 Notes: svn path=/head/; revision=351656
* vfs: add VOP_NEED_INACTIVEMateusz Guzik2019-08-281-0/+8
| | | | | | | | | | | | | | | | | | | | | vnode usecount drops to 0 all the time (e.g. for directories during path lookup). When that happens the kernel would always lock the exclusive lock for the vnode in order to call vinactive(). This blocks other threads who want to use the vnode for looukp. vinactive is very rarely needed and can be tested for without the vnode lock held. This patch gives filesytems an opportunity to do it, sample total wait time for tmpfs over 500 minutes of poudriere -j 104: before: 557563641706 (lockmgr:tmpfs) after: 46309603301 (lockmgr:tmpfs) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21371 Notes: svn path=/head/; revision=351584
* Add a vop_stdioctl() that performs a trivial FIOSEEKDATA/FIOSEEKHOLE.Rick Macklem2019-08-191-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this patch, when an application performed lseek(SEEK_DATA/SEEK_HOLE) on a file in a file system that does not have its own VOP_IOCTL(), the lseek(2) fails with errno ENOTTY. This didn't seem appropriate, since ENOTTY is not listed as an error return by either the lseek(2) man page nor the POSIX draft for lseek(2). A discussion on freebsd-current@ seemed to indicate that implementing a trivial algorithm that returns the offset argument for FIOSEEKDATA and returns the file's size for FIOSEEKHOLE was the preferred fix. http://docs.FreeBSD.org/cgi/mid.cgi?CAOtMX2iiQdv1+15e1N_r7V6aCx_VqAJCTP1AW+qs3Yg7sPg9wA The Linux kernel appears to implement this trivial algorithm as well. This patch adds a vop_stdioctl() that implements this trivial algorithm. It returns errors consistent with vn_bmap_seekhole() and, as such, will still return ENOTTY for non-regular files. I have proposed a separate patch that maps errors not described by the lseek(2) man page nor POSIX draft to EINVAL. This patch is under separate review. Reviewed by: kib Relnotes: yes Differential Revision: https://reviews.freebsd.org/D21299 Notes: svn path=/head/; revision=351201
* Fix an issue with executing tmpfs binary.Konstantin Belousov2019-08-181-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 kernel support for a Linux compatible copy_file_range(2) syscall.Rick Macklem2019-07-251-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support to the kernel for a Linux compatible copy_file_range(2) syscall and the related VOP_COPY_FILE_RANGE(9). This syscall/VOP can be used by the NFSv4.2 client to implement the Copy operation against an NFSv4.2 server to do file copies locally on the server. The vn_generic_copy_file_range() function in this patch can be used by the NFSv4.2 server to implement the Copy operation. Fuse may also me able to use the VOP_COPY_FILE_RANGE() method. vn_generic_copy_file_range() attempts to maintain holes in the output file in the range to be copied, but may fail to do so if the input and output files are on different file systems with different _PC_MIN_HOLE_SIZE values. Separate commits will be done for the generated syscall files and userland changes. A commit for a compat32 syscall will be done later. Reviewed by: kib, asomers (plus comments by brooks, jilles) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D20584 Notes: svn path=/head/; revision=350315
* Add a VOP_BMAP(9) man pageAlan Somers2019-06-201-1/+7
| | | | | | | | | | Reviewed by: mckusick MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20704 Notes: svn path=/head/; revision=349230
* Silence witness warning about duplicated mutex type.Konstantin Belousov2019-05-301-1/+1
| | | | | | | | | | | | | The order is correct, it is nullfs vnode interlock -> lower vnode interlock. vop_stdadd_writecount() is called from nullfs VOP_ADD_WRITECOUNT() and both take interlocks. Requested by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=348421
* Switch to use shared vnode locks for text files during image activation.Konstantin Belousov2019-05-051-19/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kern_execve() locks text vnode exclusive to be able to set and clear VV_TEXT flag. VV_TEXT is mutually exclusive with the v_writecount > 0 condition. The change removes VV_TEXT, replacing it with the condition v_writecount <= -1, and puts v_writecount under the vnode interlock. Each text reference decrements v_writecount. To clear the text reference when the segment is unmapped, it is recorded in the vm_map_entry backed by the text file as MAP_ENTRY_VN_TEXT flag, and v_writecount is incremented on the map entry removal The operations like VOP_ADD_WRITECOUNT() and VOP_SET_TEXT() check that v_writecount does not contradict the desired change. vn_writecheck() is now racy and its use was eliminated everywhere except access. Atomic check for writeability and increment of v_writecount is performed by the VOP. vn_truncate() now increments v_writecount around VOP_SETATTR() call, lack of which is arguably a bug on its own. nullfs bypasses v_writecount to the lower vnode always, so nullfs vnode has its own v_writecount correct, and lower vnode gets all references, since object->handle is always lower vnode. On the text vnode' vm object dealloc, the v_writecount value is reset to zero, and deadfs vop_unset_text short-circuit the operation. Reclamation of lowervp always reclaims all nullfs vnodes referencing lowervp first, so no stray references are left. Reviewed by: markj, trasz Tested by: mjg, pho Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D19923 Notes: svn path=/head/; revision=347151
* Add vn_fsync_buf().Konstantin Belousov2019-04-091-96/+2
| | | | | | | | | | | Provide a convenience function to avoid the hack with filling fake struct vop_fsync_args and then calling vop_stdfsync(). Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=346065
* Add _PC_ACL_* to vop_stdpathconfSimon J. Gerraty2019-03-111-0/+7
| | | | | | | | | | This avoid EINVAL from tmpfs etc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D19512 Notes: svn path=/head/; revision=345024
* Oops, rounddown() for the start was misspelled roundup() in r342295,Bruce Evans2018-12-221-1/+1
| | | | | | | | so only aligned starts worked. This broke releasing caches in most cases where the i/o size is smaller than the fs block size. Notes: svn path=/head/; revision=342364
* Fix rounding in vop_stdadvise() for POSIX_FADV_NOREUSE (reallyBruce Evans2018-12-211-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | POSIX_FADV_DONTNEED). The most broken case was for applications that advise for the whole file and then do block-aligned i/o's 1 block at a time. Then advice is sent to VOP_ADVISE() 1 block at a time, but in vop_stdadvise() the 1-block advice was turned into 0-block advice for the buffer cache part. The bugs were caused partly by callers representing the region as (a_start, a_end), where a_end is actually the maximum, and everything else representing the region as (start, end) where 'end' is actually the end (1 after the maximum). The maximum a_end must be rounded up, but was rounded down. Also, rounding to page boundaries was inconsistent. The bugs and fixes have no effect for zfs and other file systems that don't use the buffer cache or the page cache. Most or all file systems currently use the default VOP_FADVISE(), but it finds a null buffer cache and a null page cache for file systems that don't use normal methods. Reviewed by: kib Notes: svn path=/head/; revision=342295
* Only call sigdeferstop() for NFS.Konstantin Belousov2018-10-231-1/+34
| | | | | | | | | | | | | | | | | | | | 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
* vfs: simplify vop_stdlock/unlockMateusz Guzik2018-05-201-2/+2
| | | | | | | | | | | The interlock pointer is non-NULL by definition and the compiler see through that and eliminates the NULL checks. Just remove them from the code as they play no role. No difference in generated assembly. Notes: svn path=/head/; revision=333916
* Include error number in the "fsync: giving up on dirty" messageKirk McKusick2018-02-231-3/+4
| | | | | | | | | (in case it ever starts happening again in spite of 328444). Submitted by: Andreas Longwitz <longwitz at incore.de> Notes: svn path=/head/; revision=329880
* For many years the message "fsync: giving up on dirty" has occationallyKirk McKusick2018-01-261-6/+17
| | | | | | | | | | | | | | | appeared on UFS/FFS filesystems. In some cases it was promptly followed by a panic of "softdep_deallocate_dependencies: dangling deps". This fix should eliminate both of these occurences. Submitted by: Andreas Longwitz <longwitz at incore.de> Reviewed by: kib Tested by: Peter Holm (pho) PR: 225423 MFC after: 1 week Notes: svn path=/head/; revision=328444
* Rework pathconf handling for FIFOs.John Baldwin2017-12-191-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On the one hand, FIFOs should respect other variables not supported by the fifofs vnode operation (such as _PC_NAME_MAX, _PC_LINK_MAX, etc.). These values are fs-specific and must come from a fs-specific method. On the other hand, filesystems that support FIFOs are required to support _PC_PIPE_BUF on directory vnodes that can contain FIFOs. Given this latter requirement, once the fs-specific VOP_PATHCONF method supports _PC_PIPE_BUF for directories, it is also suitable for FIFOs permitting a single VOP_PATHCONF method to be used for both FIFOs and non-FIFOs. To that end, retire all of the FIFO-specific pathconf methods from filesystems and change FIFO-specific vnode operation switches to use the existing fs-specific VOP_PATHCONF method. For fifofs, set it's VOP_PATHCONF to VOP_PANIC since it should no longer be used. While here, move _PC_PIPE_BUF handling out of vop_stdpathconf() so that only filesystems supporting FIFOs will report a value. In addition, only report a valid _PC_PIPE_BUF for directories and FIFOs. Discussed with: bde Reviewed by: kib (part of a larger patch) MFC after: 1 month Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D12572 Notes: svn path=/head/; revision=327004
* Move NAME_MAX, LINK_MAX, and CHOWN_RESTRICTED out of vop_stdpathconf().John Baldwin2017-12-191-9/+0
| | | | | | | | | | | | | | | | | | | Having all filesystems fall through to default values isn't always correct and these values can vary for different filesystem implementations. Most of these changes just use the existing default values with a few exceptions: - Don't report CHOWN_RESTRICTED for ZFS since it doesn't do the exact permissions check this claims for chown(). - Use NANDFS_NAME_LEN for NAME_MAX for nandfs. - Don't report a LINK_MAX of 0 on smbfs. Now fail with EINVAL to indicate hard links aren't supported. Requested by: bde (though perhaps not this exact implementation) Reviewed by: kib (earlier version) MFC after: 1 month Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=326993
* 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
* Only handle _PC_MAX_CANON, _PC_MAX_INPUT, and _PC_VDISABLE for TTY devices.John Baldwin2017-09-211-9/+0
| | | | | | | | | | | | | Move handling of these three pathconf() variables out of vop_stdpathconf() and into devfs_pathconf() as TTY devices can only be devfs files. In addition, only return settings for these three variables for devfs devices whose device switch has the D_TTY flag set. Discussed with: bde, kib Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=323882
* For UNIX sockets make vnode point not to the socket, but to the UNIX PCB,Gleb Smirnoff2017-06-021-3/+3
| | | | | | | | | since the latter is the thing that links together VFS and sockets. While here, make the union in the struct vnode anonymous. Notes: svn path=/head/; revision=319502
* Relax the locking requirements for vm_object_page_noreuse(). WhileAlan Cox2017-03-151-2/+2
| | | | | | | | | | | | | reviewing all uses of OFF_TO_IDX(), I observed that vm_object_page_noreuse() is requiring an exclusive lock on the object when, in fact, a shared lock suffices. Reviewed by: kib, markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D10011 Notes: svn path=/head/; revision=315318
* Make the code match the comments: If we have ANY buf's that failedWarner Losh2017-02-211-2/+2
| | | | | | | | | | | then return EAGAIN. The current code just returns that if the LAST buf failed. Reviewed by: kib@, trasz@ Differential Revision: https://reviews.freebsd.org/D9677 Notes: svn path=/head/; revision=314053