summaryrefslogtreecommitdiffstats
path: root/sys/ufs
Commit message (Collapse)AuthorAgeFilesLines
* Check return value from vmapbuf instead of the function address.tegge2003-03-271-2/+1
|
* Eliminate a buffer sleep/wakeup race.tegge2003-03-271-7/+3
|
* Add support for reading directly from file to userland buffer when thetegge2003-03-262-0/+511
| | | | | O_DIRECT descriptor status flag is set and both offset and length is a multiple of the physical media sector size.
* Use td->td_ucred instead of td->td_proc->p_ucred.jhb2003-03-202-2/+2
|
* Minor fixes to ffs_fserr():jhb2003-03-201-3/+3
| | | | | - Assume that curthread is not NULL. It never is in -current. - Use td_ucred instead of p_ucred.
* Including <sys/stdint.h> is (almost?) universally only to be able to usephk2003-03-186-6/+0
| | | | | %j in printfs, so put a newsted include in <sys/systm.h> where the printf prototype lives and save everybody else the trouble.
* - Remove a race between fsync like functions and flushbufqueues() byjeff2003-03-131-4/+2
| | | | | | | | | | | requiring locked bufs in vfs_bio_awrite(). Previously the buf could have been written out by fsync before we acquired the buf lock if it weren't for giant. The cluster_wbuild() handles this race properly but the single write at the end of vfs_bio_awrite() would not. - Modify flushbufqueues() so there is only one copy of the loop. Pass a parameter in that says whether or not we should sync bufs with deps. - Call flushbufqueues() a second time and then break if we couldn't find any bufs without deps.
* Use the appropriate size when zeroing out the unused portionmckusick2003-03-071-3/+3
| | | | | | | | of a snapshot's copy of a superblock. This patch fixes a panic when taking a snapshot of a 4096/512 filesystem. Reported by: Ian Freislich <ianf@za.uu.net> Sponsored by: DARPA & NAI Labs.
* Remove ENABLE_VFS_IOOPT. It is a long unfinished work-in-progress.alc2003-03-061-108/+0
| | | | Discussed on: arch@
* - Add a new 'flags' parameter to getblk().jeff2003-03-047-19/+19
| | | | | | | | | | - Define one flag GB_LOCK_NOWAIT that tells getblk() to pass the LK_NOWAIT flag to the initial BUF_LOCK(). This will eventually be used in cases were we want to use a buffer only if it is not currently in use. - Convert all consumers of the getblk() api to use this extra parameter. Reviwed by: arch Not objected to by: mckusick
* Finish cleanup of vprint() which was begun with changing v_tag to a string.njl2003-03-031-1/+1
| | | | | | Remove extraneous uses of vop_null, instead defering to the default op. Rename vnode type "vfs" to the more descriptive "syncer". Fix formatting for various filesystems that use vop_print.
* More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9).des2003-03-022-10/+10
|
* Change the field used to test whether the superblock has been updatedmckusick2003-02-251-1/+5
| | | | | | | | | | | | | | | from the filesystem size field to the filesystem maximum blocksize field. The problem is that older versions of growfs updated only the new size field and not the old size field. This resulted in the old (smaller) size field being copied up to the new size field which caused the filesystem to appear to fsck to be badly trashed. This also adds a sanity check to ensure that the superblock is not being updated when the filesystem is mounted read-only. Obviously such an update should never happen. Reported by: Nate Lawson <nate@root.org> Sponsored by: DARPA & NAI Labs.
* - Add an interlock argument to BUF_LOCK and BUF_TIMELOCK.jeff2003-02-252-5/+6
| | | | | | | | | | - Remove the buftimelock mutex and acquire the buf's interlock to protect these fields instead. - Hold the vnode interlock while locking bufs on the clean/dirty queues. This reduces some cases from one BUF_LOCK with a LK_NOWAIT and another BUF_LOCK with a LK_TIMEFAIL to a single lock. Reviewed by: arch, mckusick
* Expand the reference count on struct dquot to 32 bits.das2003-02-241-2/+1
| | | | | | | | This fixes a panic on large systems where a single user may have more than 64K active or inactive vnodes. PR: 48234 Reviewed by: mike (mentor)
* When removing the last item from a non-empty worklist, the worklistmckusick2003-02-241-2/+15
| | | | | | | tail pointer must be updated. Reported by: Kris Kennaway <kris@obsecurity.org> Sponsored by: DARPA & NAI Labs.
* This patch fixes a deadlock between the bufdaemon and a process takingmckusick2003-02-221-7/+43
| | | | | | | | | | | | | | | | | | a snapshot. As part of taking a snapshot of a filesystem, the kernel builds up a list of the filesystem metadata (such as the cylinder group bitmaps) that are contained in the snapshot. When doing a copy-on-write check, the list is first consulted. If the block being written is found on the list, then the full snapshot lookup can be avoided. Besides providing an important performance speedup this check also avoids a potential deadlock between the code creating the snapshot and the bufdaemon trying to cleanup snapshot related buffers. This fix creates a temporary list containing the key metadata blocks that can cause the deadlock. This temporary list is used between the time that the snapshot is first enabled and the time that the fully complete list is built. Reported by: Attila Nagy <bra@fsn.hu> Sponsored by: DARPA & NAI Labs.
* This patch fixes a bug on an active filesystem on which a snapshotmckusick2003-02-223-1/+47
| | | | | | | | | | | | | | is being taken from panicing with either "freeing free block" or "freeing free inode". The problem arises when the snapshot code is scanning the filesystem looking for inodes with a reference count of zero (e.g., unlinked but still open) so that it can expunge them from its view. If it encounters a reclaimed vnode and has to restart its scan, then it will panic if it encounters and tries to free an inode that it has already processed. The fix is to check each candidate inode to see if it has already been processed before trying to delete it from the snapshot image. Sponsored by: DARPA & NAI Labs.
* This patch fixes a bug in the logical block calculation macros somckusick2003-02-222-7/+7
| | | | | | | that they convert to 64-bit values before shifting rather than afterwards. Once fixed, they can be used rather than inline expanded. Sponsored by: DARPA & NAI Labs.
* Back out M_* changes, per decision of the TRB.imp2003-02-199-29/+29
| | | | Approved by: trb
* Replace use of random() with arc4random() to provide less guessablemckusick2003-02-142-3/+3
| | | | | | | | values for the initial inode generation numbers in newfs and for newly allocated inode generation numbers in the kernel. Submitted by: Theo de Raadt <deraadt@cvs.openbsd.org> Sponsored by: DARPA & NAI Labs.
* Correct lines incorrectly added to the copyright message.mckusick2003-02-142-6/+0
| | | | | Submitted by: Frank van der Linden <fvdl@wasabisystems.com> Sponsored by: DARPA & NAI Labs.
* - Cleanup unlocked accesses to buf flags by introducing a new b_vflag memberjeff2003-02-091-7/+6
| | | | | | | | | | that is protected by the vnode lock. - Move B_SCANNED into b_vflags and call it BV_SCANNED. - Create a vop_stdfsync() modeled after spec's sync. - Replace spec_fsync, msdos_fsync, and hpfs_fsync with the stdfsync and some fs specific processing. This gives all of these filesystems proper behavior wrt MNT_WAIT/NOWAIT and the use of the B_SCANNED flag. - Annotate the locking in buf.h
* Catch more uses of MIN().alfred2003-02-021-2/+0
|
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-219-29/+29
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Bow to the whining masses and change a union back into void *. Retaindillon2003-01-131-1/+1
| | | | | removal of unnecessary casts and throw in some minor cleanups to see if anyone complains, just for the hell of it.
* Change struct file f_data to un_data, a union of the correct structdillon2003-01-121-1/+1
| | | | | | | | | | pointer types, and remove a huge number of casts from code using it. Change struct xfile xf_data to xun_data (ABI is still compatible). If we need to add a #define for f_data and xf_data we can, but I don't think it will be necessary. There are no operational changes in this commit.
* o Improve wording of the comment that accompanies fs_pad. Themarcel2003-01-101-1/+6
| | | | | | | | | | | padding is not specific to non-i386 architectures. It is caused by non-i386 specific alignment requirements of fs_swuid, o Add a CTASSERT to catch a change in the size of struct fs at compile-time rather than run-time. Ok'd: gordon Tested on: i386 ia64
* Fix superblock alignment problems on non-i386 platforms. Also change fs_uuidgordon2003-01-091-2/+3
| | | | | | | | to fs_swuid, making it more descriptive. Submitted by: marcel Reviewed by: peter Pointy hat to: gordon
* Steal some space from fs_fsmnt to create fs_volname and fs_uuid. The volnamegordon2003-01-081-1/+9
| | | | | | | | will be used to support volume names with the help of a GEOM module (to be committed). uuid will be used to deal with conflicting volume names (which doesn't work just yet). Approved by: mckusick@
* This patch fixes a problem caused by applications that rapidly andmckusick2003-01-072-5/+13
| | | | | | | | | | | | | | | | | | repeatedly truncate the same file. Each time the file is truncated, a buffer is grabbed to store the indirect block numbers that need to be freed. Those blocks cannot be freed until the inode claiming them is written to disk. Thus, the number of buffers being held by soft updates explodes and in extreme cases can run the kernel out of buffers. The problem can be avoided by doing an fsync on the file every debug.maxindirdep truncates (currently defaulted to 50). The fsync causes the inode to be written so that the held buffers can be freed. The check for excessive buffers is checked as part of the existing hook for excessive dependencies (softdep_slowdown) in the truncate code. Reported by: David Schultz <dschultz@uclink.Berkeley.EDU> Sponsored by: DARPA & NAI Labs. MFC after: 3 weeks
* Temporarily introduce a new VOP_SPECSTRATEGY operation while I tryphk2003-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | to sort out disk-io from file-io in the vm/buffer/filesystem space. The intent is to sort VOP_STRATEGY calls into those which operate on "real" vnodes and those which operate on VCHR vnodes. For the latter kind, the call will be changed to VOP_SPECSTRATEGY, possibly conditionally for those places where dual-use happens. Add a default VOP_SPECSTRATEGY method which will call the normal VOP_STRATEGY. First time it is called it will print debugging information. This will only happen if a normal vnode is passed to VOP_SPECSTRATEGY by mistake. Add a real VOP_SPECSTRATEGY in specfs, which does what VOP_STRATEGY does on a VCHR vnode today. Add a new VOP_STRATEGY method in specfs to catch instances where the conversion to VOP_SPECSTRATEGY has not yet happened. Handle the request just like we always did, but first time called print debugging information. Apart up to two instances of console messages per boot, this amounts to a glorified no-op commit. If you get any of the messages on your console I would very much like a copy of them mailed to phk@freebsd.org
* Since Jeffr made the std* functions the default in rev 1.63 ofphk2003-01-041-9/+0
| | | | | | | kern/vfs_defaults.c it is wrong for the individual filesystems to use the std* functions as that prevents override of the default. Found by: src/tools/tools/vop_table
* Convert calls to BUF_STRATEGY to VOP_STRATEGY calls. This is a no-op sincephk2003-01-032-2/+2
| | | | all BUF_STRATEGY did in the first place was call VOP_STRATEGY.
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,schweikh2003-01-012-2/+2
| | | | especially in troff files.
* When compiling the kernel do not implicitly include filedesc.h from proc.h,alfred2003-01-011-0/+1
| | | | | | this was causing filedesc work to be very painful. In order to make this work split out sigio definitions to thier own header (sigio.h) which is included from proc.h for the time being.
* Use three UMA zones for FFS/UFS inodes instead of malloc space.phk2002-12-271-11/+20
| | | | | Since inodes are currently 144 bytes, this will save 112 bytes per inode. This can amount to up to 10MByte on large systems.
* Move the allocation of the inode contents into ffs_vfsops.c rather thanphk2002-12-273-12/+10
| | | | passing malloc types around.
* Make ffs_mountfs() static.phk2002-12-274-17/+24
| | | | | | | | | Remove the malloctype from the ufs mount structure, instead add a callback to the storage method for freeing inodes: UFS_IFREE(). Add vfs_ifree() method function which frees an inode. Unvariablelize the malloc type used for allocating inodes.
* Fix corruption introduced in previous delta.mckusick2002-12-181-4/+12
| | | | | Reported by: Aurelien Nephtali <aurelien.nephtali@wanadoo.fr> Sponsored by: DARPA & NAI Labs.
* Keep comments consistent with the code. Minor optimization.mckusick2002-12-181-14/+4
| | | | Sponsored by: DARPA & NAI Labs.
* Cosmetic cleanup of unsigned buglets.mckusick2002-12-181-5/+5
| | | | | Submitted by: Bruce Evans <bde@zeta.org.au> Sponsored by: DARPA & NAI Labs.
* Remove unused lockcnt variable.phk2002-12-171-3/+0
| | | | Approved by: mckusick
* Update to previous change (1.54) to use an approperly wide inode fieldmckusick2002-12-152-9/+12
| | | | | | | | so as to work correctly on 64-bit platforms. Reported-by: Jake Burkholder <jake@locore.ca> Sponsored by: DARPA & NAI Labs. Approved by: Ian Dowse <iedowse@maths.tcd.ie>
* Undo the adjustment of the total memory used by dirhash in the caseiedowse2002-12-141-6/+10
| | | | | | | where allocating the dirhash structure fails. Fix a few typos in comments and update copyright. MFC after: 1 week
* Only the most recent snapshot contains the complete list of blocksmckusick2002-12-142-140/+188
| | | | | | | | | | | that were copied in all of the earlier snapshots, thus its precomputed list must be used in the copyonwrite test. Using incomplete lists may lead to deadlock. Also do not include the blocks used for the indirect pointers in the indirect pointers as this may lead to inconsistent snapshots. Sponsored by: DARPA & NAI Labs. Approved by: re
* Remove the comment about dump(8) not working properly with snapshots.trhodes2002-12-121-3/+1
| | | | | Discussed with: mckusick Approved by: re (rwatson)
* More tightly verify the preference returned for the new inode.mckusick2002-12-061-1/+1
| | | | | | Submitted by: Kris Kennaway <kris@obsecurity.org> Sponsored by: DARPA & NAI Labs. Approved by: re
* Have to use bread() rather than UFS_BALLOC() when obtaining amckusick2002-12-031-24/+30
| | | | | | | | | | | previously allocated block as the previous use of the block may have fallen out of the cache. Failure to reread its contents cause zeroed results to be written instead of the proper contents. Conversely, when the block is going to be entirely filled in, it is not necessary reread the old contents. Sponsored by: DARPA & NAI Labs. Approved by: re
* Add a check to disable the previous patch so that future filesystemsmckusick2002-11-301-2/+4
| | | | | | | that choose to place their superblocks in non-standard locations will not get them smashed. Sponsored by: DARPA & NAI Labs.
OpenPOWER on IntegriCloud