aboutsummaryrefslogtreecommitdiff
path: root/sys/gnu
Commit message (Collapse)AuthorAgeFilesLines
* MFC r193923:Konstantin Belousov2009-06-241-1/+1
| | | | | | | | | | | s/a_fdidx/a_fp/ for VOP_OPEN comments that inline struct vop_open_args definition. MFC r193924: Fix r193923 by noting that type of a_fp is struct file *, not int. Notes: svn path=/stable/7/; revision=194817
* MFC r194296:Konstantin Belousov2009-06-232-8/+6
| | | | | | | | Do not use casts (int *)0 and (struct thread *)0 for the arguments of vn_rdwr, use NULL. Notes: svn path=/stable/7/; revision=194696
* - MFC r187395-187397,193377,193382,193390,193628.Stanislav Sedov2009-06-198-585/+279
| | | | | | | | Add support for inode sizes other than 128 bytes. Cleanup. Notes: svn path=/stable/7/; revision=194495
* MFC r189878:Konstantin Belousov2009-05-051-2/+2
| | | | | | | | | | | | | | | | | | Fix two issues with bufdaemon, often causing the processes to hang in the "nbufkv" sleep. Do not retry request for the new block from ffs_bufwrite() when write is done from bufdaemon and there is a buffer shortage. In getnewbuf(), help bufdaemon to flush dirty buffers owned by the vnode locked by curthread. For MFC, default value for sysctl vfs.flushbufqtarget is set to -1, disabling the helpers. The TDP_BUFNEED flag value from HEAD conflicts with TDP_UPCALLING KSE bit, so it is moved to the end of allocated bits. Notes: svn path=/stable/7/; revision=191813
* MFC r186194:Edward Tomasz Napierala2009-03-013-3/+8
| | | | | | | | | | | | | | | | | According to phk@, VOP_STRATEGY should never, _ever_, return anything other than 0. Make it so. This fixes "panic: VOP_STRATEGY failed bp=0xc320dd90 vp=0xc3b9f648", encountered when writing to an orphaned filesystem. Reason for the panic was the following assert: KASSERT(i == 0, ("VOP_STRATEGY failed bp=%p vp=%p", bp, bp->b_vp)); at vfs_bio:bufstrategy(). Reviewed by: scottl, phk Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Notes: svn path=/stable/7/; revision=189226
* MFC r183071:Konstantin Belousov2009-01-291-10/+2
| | | | | | | Garbage-collect vn_write_suspend_wait(). Notes: svn path=/stable/7/; revision=187892
* MFC r183211:Konstantin Belousov2009-01-211-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initialize birthtime fields in vn_stat() to prevent stat(2) from returning uninitialized birthtime. Most file systems don't initialize birthtime properly in their VOP_GETTATTR(). MFC r183212: Initialize va_flags and va_filerev properly in VOP_GETATTR(). Don't initialize va_vaflags and va_spare because they are not part of the VOP_GETATTR() API. Also don't initialize birthtime to ctime or zero. MFC rr183213: Initialize va_rdev to NODEV and va_fsid to VNOVAL before the VOP_GETATTR() call in vn_stat(). Thus if a file system doesn't initialize those fields in VOP_GETATTR() they will have a sane default value. MFC r183214: Initialize va_rdev to NODEV instead of 0 or VNOVAL in VOP_GETATTR(). NODEV is more appropriate when va_rdev doesn't have a meaningful value. MFC r183215: fdescfs, devfs, mqueuefs, nfs, portalfs, pseudofs, tmpfs and xfs initialize the vattr structure in VOP_GETATTR() with VATTR_NULL(), vattr_null() or by zeroing it. Remove these to allow preinitialization of fields work in vn_stat(). This is needed to get birthtime initialized correctly. Notes: svn path=/stable/7/; revision=187534
* MFC r186740:Konstantin Belousov2009-01-181-1/+1
| | | | | | | | Do not incorrectly add the low 5 bits of the offset to the resulting position of the found zero bit. Notes: svn path=/stable/7/; revision=187386
* MFC r178243:Konstantin Belousov2008-08-013-24/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Move the head of byte-level advisory lock list from the filesystem-specific vnode data to the struct vnode. Provide the default implementation for the vop_advlock and vop_advlockasync. Purge the locks on the vnode reclaim by using the lf_purgelocks(). The default implementation is augmented for the nfs and smbfs. In the nfs_advlock, push the Giant inside the nfs_dolock. Before the change, the vop_advlock and vop_advlockasync have taken the unlocked vnode and dereferenced the fs-private inode data, racing with with the vnode reclamation due to forced unmount. Now, the vop_getattr under the shared vnode lock is used to obtain the inode size, and later, in the lf_advlockasync, after locking the vnode interlock, the VI_DOOMED flag is checked to prevent an operation on the doomed vnode. MFC r178247: Fix compilation with LOCKF_DEBUG. As was announced on the stable@, the MFC changes the VFS KBI on RELENG_7. Approved by: re (kensmith) Notes: svn path=/stable/7/; revision=181119
* MFC: Fix a nit with the 'nofoo' options where 'foo' is mapped to 'nonofoo'John Baldwin2008-04-031-1/+1
| | | | | | | so that filesystems will consider 'nonofoo' a valid option. Notes: svn path=/stable/7/; revision=177891
* Some times ago, vfs_getopts() was changed, so that it would set error toOlivier Houchard2007-08-201-5/+5
| | | | | | | | | | | | | | | ENOENT if the option wasn't provided, instead of setting it to 0. xfs however didn't catch up on this, so it assumed something went bad if vfs_getopts() sets the error to non-zero, and just returns the error. Unbreak xfs mount by just ignoring the error if vfs_getopts() sets the error to ENOENT, as we should have sane defaults. Reviewed by: kan Approved by: re (rwatson) Tested by: rpaulo Notes: svn path=/head/; revision=171905
* On 6.x this works:John Baldwin2007-08-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | % mount | grep home /dev/ad4s1e on /home (ufs, local, noatime, soft-updates) % mount -u -o atime /home % mount | grep home /dev/ad4s1e on /home (ufs, local, soft-updates) Restore this behavior for on 7.x for the following mount options: noatime, noclusterr, noclusterw, noexec, nosuid, nosymfollow In addition, on 7.x, the following are equivalent: mount -u -o atime /home mount -u -o nonoatime /home Ideally, when we introduce new mount options, we should avoid options starting with "no". :) Requested by: jhb Reported by: Karol Kwiat <karol.kwiat gmail com>, Scott Hetzel <swhetzel gmail com> Approved by: re (bmah) Proxy commit for: rodrigc Notes: svn path=/head/; revision=171852
* The last entry in the ext2_opts array must be NULL,Craig Rodrigues2007-07-141-1/+1
| | | | | | | | | | otherwise the kernel with crash in vfs_filteropt() if an invalid mount option is passed to ext2fs. Approved by: re (kensmith) Notes: svn path=/head/; revision=171450
* Eliminate now-unused SUSER_ALLOWJAIL arguments to priv_check_cred(); inRobert Watson2007-06-121-12/+6
| | | | | | | | | | | | | | | | | | some cases, move to priv_check() if it was an operation on a thread and no other flags were present. Eliminate caller-side jail exception checking (also now-unused); jail privilege exception code now goes solely in kern_jail.c. We can't yet eliminate suser() due to some cases in the KAME code where a privilege check is performed and then used in many different deferred paths. Do, however, move those prototypes to priv.h. Reviewed by: csjp Obtained from: TrustedBSD Project Notes: svn path=/head/; revision=170587
* Remove 'inline' qualifiers from functions which are not, in fact, inlines.Matt Jacob2007-06-102-7/+7
| | | | Notes: svn path=/head/; revision=170491
* Change the VOP_OPEN(), vn_open() vnode operation and d_fdopen() cdev operationKonstantin Belousov2007-06-011-1/+1
| | | | | | | | | | | argument from being file descriptor index into the pointer to struct file: part 2. Convert calls missed in the first big commit. Noted by: rwatson Pointy hat to: kib Notes: svn path=/head/; revision=170183
* - Move rusage from being per-process in struct pstats to per-thread inJeff Roberson2007-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | td_ru. This removes the requirement for per-process synchronization in statclock() and mi_switch(). This was previously supported by sched_lock which is going away. All modifications to rusage are now done in the context of the owning thread. reads proceed without locks. - Aggregate exiting threads rusage in thread_exit() such that the exiting thread's rusage is not lost. - Provide a new routine, rufetch() to fetch an aggregate of all rusage structures from all threads in a process. This routine must be used in any place requiring a rusage from a process prior to it's exit. The exited process's rusage is still available via p_ru. - Aggregate tick statistics only on demand via rufetch() or when a thread exits. Tick statistics are kept in the thread and protected by sched_lock until it exits. Initial patch by: attilio Reviewed by: attilio, bde (some objections), arch (mostly silent) Notes: svn path=/head/; revision=170174
* Bow to incomplete GCC 4. constant propagation optimizations andAlexander Kabaev2007-05-3013-13/+17
| | | | | | | | initialize some of the local variables GCC claims are being used uninitialized. Notes: svn path=/head/; revision=170124
* Change #include <machine/pcpu.h> to #include <sys/pcpu.h>Craig Rodrigues2007-04-011-1/+1
| | | | | | | to get definition of curthread, required by <sys/sx.h>. Notes: svn path=/head/; revision=168206
* Optimize sx locks to use simple atomic operations for the common cases ofJohn Baldwin2007-03-312-79/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | obtaining and releasing shared and exclusive locks. The algorithms for manipulating the lock cookie are very similar to that rwlocks. This patch also adds support for exclusive locks using the same algorithm as mutexes. A new sx_init_flags() function has been added so that optional flags can be specified to alter a given locks behavior. The flags include SX_DUPOK, SX_NOWITNESS, SX_NOPROFILE, and SX_QUITE which are all identical in nature to the similar flags for mutexes. Adaptive spinning on select locks may be enabled by enabling the ADAPTIVE_SX kernel option. Only locks initialized with the SX_ADAPTIVESPIN flag via sx_init_flags() will adaptively spin. The common cases for sx_slock(), sx_sunlock(), sx_xlock(), and sx_xunlock() are now performed inline in non-debug kernels. As a result, <sys/sx.h> now requires <sys/lock.h> to be included prior to <sys/sx.h>. The new kernel option SX_NOINLINE can be used to disable the aforementioned inlining in non-debug kernels. The size of struct sx has changed, so the kernel ABI is probably greatly disturbed. MFC after: 1 month Submitted by: attilio Tested by: kris, pjd Notes: svn path=/head/; revision=168191
* Add "force" to ext2_ops, to match what was in the old mount_ext2fs binary.Craig Rodrigues2007-03-151-1/+1
| | | | | | | Reported by: Ivan Voras <ivoras fer hr> Notes: svn path=/head/; revision=167580
* Make insmntque() externally visibile and allow it to fail (e.g. duringTor Egge2007-03-133-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | late stages of unmount). On failure, the vnode is recycled. Add insmntque1(), to allow for file system specific cleanup when recycling vnode on failure. Change getnewvnode() to no longer call insmntque(). Previously, embryonic vnodes were put onto the list of vnode belonging to a file system, which is unsafe for a file system marked MPSAFE. Change vfs_hash_insert() to no longer lock the vnode. The caller now has that responsibility. Change most file systems to lock the vnode and call insmntque() or insmntque1() after a new vnode has been sufficiently setup. Handle failed insmntque*() calls by propagating errors to callers, possibly after some file system specific cleanup. Approved by: re (kensmith) Reviewed by: kib In collaboration with: kib Notes: svn path=/head/; revision=167497
* Rename PRIV_VFS_CLEARSUGID to PRIV_VFS_RETAINSUGID, which seems to betterPawel Jakub Dawidek2007-03-011-2/+2
| | | | | | | | | describe the privilege. OK'ed by: rwatson Notes: svn path=/head/; revision=167152
* Avoid checking for privileges if there is no need to.Pawel Jakub Dawidek2007-03-011-1/+1
| | | | | | | Discussed with: rwatson Notes: svn path=/head/; revision=167151
* Move vnode-to-file-handle translation from vfs_vptofh to vop_vptofh method.Pawel Jakub Dawidek2007-02-156-59/+70
| | | | | | | | | | | | | | | | | | | This way we may support multiple structures in v_data vnode field within one file system without using black magic. Vnode-to-file-handle should be VOP in the first place, but was made VFS operation to keep interface as compatible as possible with SUN's VFS. BTW. Now Solaris also implements vnode-to-file-handle as VOP operation. VFS_VPTOFH() was left for API backward compatibility, but is marked for removal before 8.0-RELEASE. Approved by: mckusick Discussed with: many (on IRC) Tested with: ufs, msdosfs, cd9660, nullfs and zfs Notes: svn path=/head/; revision=166774
* Cylinder group bitmaps and blocks containing inode for a snapshotKonstantin Belousov2007-01-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | file are after snaplock, while other ffs device buffers are before snaplock in global lock order. By itself, this could cause deadlock when bdwrite() tries to flush dirty buffers on snapshotted ffs. If, during the flush, COW activity for snapshot needs to allocate block and ffs_alloccg() selects the cylinder group that is being written by bdwrite(), then kernel would panic due to recursive buffer lock acquision. Avoid dealing with buffers in bdwrite() that are from other side of snaplock divisor in the lock order then the buffer being written. Add new BOP, bop_bdwrite(), to do dirty buffer flushing for same vnode in the bdwrite(). Default implementation, bufbdflush(), refactors the code from bdwrite(). For ffs device buffers, specialized implementation is used. Reviewed by: tegge, jeff, Russell Cattelan (cattelan xfs org, xfs changes) Tested by: Peter Holm X-MFC after: 3 weeks (if ever: it changes ABI) Notes: svn path=/head/; revision=166193
* Previously, the mount_ext2fs binary listed the acceptable mountCraig Rodrigues2006-11-181-1/+4
| | | | | | | | | | | | | | options for ext2fs. Now that we use nmount() directly from the mount binary to access ext2fs filesystems, add the list of acceptable mount options to ext2_ops, so that vfs_filteropts() will accept options like "noatime" for ext2fs. PR: 105483 Noticed by: Dr. Markus Waldeck <waldeck gmx de> MFC after: 1 month Notes: svn path=/head/; revision=164385
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningRobert Watson2006-11-065-46/+71
| | | | | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net> Notes: svn path=/head/; revision=164033
* Add mnt_noasync counter to better handle interleaved calls to nmount(),Tor Egge2006-09-261-1/+1
| | | | | | | | | sync() and sync_fsync() without losing MNT_ASYNC. Add MNTK_ASYNC flag which is set only when MNT_ASYNC is set and mnt_noasync is zero, and check that flag instead of MNT_ASYNC before initiating async io. Notes: svn path=/head/; revision=162649
* Use mount interlock to protect all changes to mnt_flag and mnt_kern_flag.Tor Egge2006-09-262-0/+10
| | | | | | | | This eliminates a race where MNT_UPDATE flag could be lost when nmount() raced against sync(), sync_fsync() or quotactl(). Notes: svn path=/head/; revision=162647
* Add snd_emu10kx driver for Creative SoundBlaster Live! and Audigy seriesAlexander Leidinger2006-07-152-0/+414
| | | | | | | | | | | | | | | | | | sound cards with optional pseudo-multichannel playback. It's based on snd_emu10k1 sound driver. Single channel version is available from audio/emu10kx port since some time. The two new ALSA header files (GPLed), which contain Audigy 2 ("p16v") and Audigy 2 Value ("p17v") specific interfaces, are latest versions from ALSA Mercurial repository. This is not connected to the build yet. Submitted by: Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru> Notes: svn path=/head/; revision=160383
* - Update ALSA emu10k1.h (it was imported as emu10k1-alsa.h) header file toAlexander Leidinger2006-07-153-1244/+440
| | | | | | | | | | | | | | | latest version from Mercurial repository. It brings definition of some additional Audigy 2 / Audigy 2 Value registers. - Use new #defines from ALSA emu10k1.h - Remove unused include files: + emu10k1-ac97.h was imported from ALSA and never used, + emu10k1.h was imported from Creative Linux emu10k1 driver, but only AUDIGY_CODEBASE was used from it. Submitted by: Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru> Notes: svn path=/head/; revision=160382
* Implement vnode operations for setting and removing extended attributes.Craig Rodrigues2006-06-111-1/+95
| | | | Notes: svn path=/head/; revision=159498
* Restore routines for getting and listing extended attributes whichCraig Rodrigues2006-06-111-0/+124
| | | | | | | were lost in the last merge. Notes: svn path=/head/; revision=159497
* Restore changes to spinlock macros before merge.Craig Rodrigues2006-06-111-10/+8
| | | | Notes: svn path=/head/; revision=159496
* Remove debugging printfCraig Rodrigues2006-06-111-1/+0
| | | | Notes: svn path=/head/; revision=159495
* Temporarily disable log recovery until we fix panics.Craig Rodrigues2006-06-101-0/+5
| | | | Notes: svn path=/head/; revision=159493
* Logical OR the following flags into the va_mode field:Craig Rodrigues2006-06-101-9/+3
| | | | | | | | | | | | S_IFDIR when making a directory S_IFLNK when making a symbolic link S_IFIFO when making a pipe xfs_ialloc() checks this field for these flags when figuring out whether to make a directory, make a symbolic link or make a pipe. Notes: svn path=/head/; revision=159492
* Call g_vfs_close() if:Craig Rodrigues2006-06-101-2/+35
| | | | | | | | (1) _xfs_mount() fails (2) at the end of _xfs_unmount() Notes: svn path=/head/; revision=159489
* Do not call vput() after we call VOP_UNLOCK().Craig Rodrigues2006-06-101-1/+1
| | | | Notes: svn path=/head/; revision=159488
* Change %llx to %jx in printf() to eliminate warnings on 64-bit platforms.Craig Rodrigues2006-06-091-1/+1
| | | | Notes: svn path=/head/; revision=159456
* Bring back changes in version 1.3 lost in previous commit.Craig Rodrigues2006-06-091-13/+1
| | | | Notes: svn path=/head/; revision=159455
* More changes due to latest XFS import.Craig Rodrigues2006-06-091-188/+267
| | | | | | | Work done by: Russell Cattelan <cattelan at xfs dot org> Notes: svn path=/head/; revision=159452
* Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree.Craig Rodrigues2006-06-09138-17885/+14784
| | | | | | | | | Improve support for writing to XFS partitions. Work done by: Russell Cattelan <cattelan at xfs dot org> Notes: svn path=/head/; revision=159451
* Include "xfs_macros.h" to fix tinderbox build breakage.Craig Rodrigues2006-06-011-0/+1
| | | | Notes: svn path=/head/; revision=159153
* Cope with -Wundef. This means including xfs_macros.h early in a few moreWarner Losh2006-06-0113-19/+24
| | | | | | | | | files and changing #if XXXKAN -> #ifdef XXXKAN. # this is just compile tested, since I don't have xfs partitions. Notes: svn path=/head/; revision=159147
* Add support for "export" option, to allow NFS exportingCraig Rodrigues2006-05-261-5/+11
| | | | | | | of XFS filesystems. Notes: svn path=/head/; revision=158953
* Remove calls to vfs_export() for exporting a filesystem for NFS mountingCraig Rodrigues2006-05-261-4/+2
| | | | | | | | | | from individual filesystems. Call it instead in vfs_mount.c, after we call VFS_MOUNT() for a specific filesystem. Approved by: dumbbell Notes: svn path=/head/; revision=158951
* Remove calls to vfs_export() for exporting a filesystem for NFS mountingCraig Rodrigues2006-05-261-8/+3
| | | | | | | | from individual filesystems. Call it instead in vfs_mount.c, after we call VFS_MOUNT() for a specific filesystem. Notes: svn path=/head/; revision=158924
* Check for VFS_STATFS() failure in _xfs_mount() and abort the mountGiorgos Keramidas2006-05-051-2/+1
| | | | | | | | | | | on errors. Found by: Coverity Prevent Approved by: rodrigc, Russell Cattelan MFC after: 4 weeks Notes: svn path=/head/; revision=158317