aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs
Commit message (Collapse)AuthorAgeFilesLines
...
* Replace the POLLEXTEND extensions with the kqueue() mechanism.Jonathan Lemon2000-04-162-25/+29
| | | | Notes: svn path=/head/; revision=59289
* Fix two bugs in extended attribute support for UFS/FFS:Robert Watson2000-04-161-2/+5
| | | | | | | | | | | | | o Put back in {} removed during over-zealous cleanup of gratuitous debugging output during preparation for the commit. Due to the missing {}, writes on extended attributes always silently failed. Doh. o Don't unlock the target vnode if it's the backing vnode, as we don't lock the target vnode if it's the backing vnode. Notes: svn path=/head/; revision=59268
* Complete the bio/buf divorce for all code below devfs::strategyPoul-Henning Kamp2000-04-153-17/+17
| | | | | | | | | | | | | Exceptions: Vinum untouched. This means that it cannot be compiled. Greg Lehey is on the case. CCD not converted yet, casts to struct buf (still safe) atapi-cd casts to struct buf to examine B_PHYS Notes: svn path=/head/; revision=59249
* Introduce extended attribute support for FFS, allowing arbitraryRobert Watson2000-04-1515-0/+924
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (name, value) pairs to be associated with inodes. This support is used for ACLs, MAC labels, and Capabilities in the TrustedBSD security extensions, which are currently under development. In this implementation, attributes are backed to data vnodes in the style of the quota support in FFS. Support for FFS extended attributes may be enabled using the FFS_EXTATTR kernel option (disabled by default). Userland utilities and man pages will be committed in the next batch. VFS interfaces and man pages have been in the repo since 4.0-RELEASE and are unchanged. o ufs/ufs/extattr.h: UFS-specific extattr defines o ufs/ufs/ufs_extattr.c: bulk of support routines o ufs/{ufs,ffs,mfs}/*.[ch]: hooks and extattr.h includes o contrib/softupdates/ffs_softdep.c: extattr.h includes o conf/options, conf/files, i386/conf/LINT: added FFS_EXTATTR o coda/coda_vfsops.c: XXX required extattr.h due to ufsmount.h (This should not be the case, and will be fixed in a future commit) Currently attributes are not supported in MFS. This will be fixed. Reviewed by: adrian, bp, freebsd-fs, other unthanked souls Obtained from: TrustedBSD Project Notes: svn path=/head/; revision=59241
* Clone bio versions of certain bits of infrastructure:Poul-Henning Kamp2000-04-021-0/+98
| | | | | | | | | | | | | | | | devstat_end_transaction_bio() bioq_* versions of bufq_* incl bioqdisksort() the corresponding "buf" versions will disappear when no longer used. Move b_offset, b_data and b_bcount to struct bio. Add BIO_FORMAT as a hack for fd.c etc. We are now largely ready to start converting drivers to use struct bio instead of struct buf. Notes: svn path=/head/; revision=58942
* Move B_ERROR flag to b_ioflags and call it BIO_ERROR.Poul-Henning Kamp2000-04-026-6/+8
| | | | | | | | | | | | | | | | (Much of this done by script) Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED. Move b_pblkno and b_iodone_chain to struct bio while we transition, they will be obsoleted once bio structs chain/stack. Add bio_queue field for struct bio aware disksort. Address a lot of stylistic issues brought up by bde. Notes: svn path=/head/; revision=58934
* Change the write-behind code to take more care when startingMatthew Dillon2000-04-021-1/+3
| | | | | | | | | | | | | | | | | async I/O's. The sequential read heuristic has been extended to cover writes as well. We continue to call cluster_write() normally, thus blocks in the file will still be reallocated for large (but still random) I/O's, but I/O will only be initiated for truely sequential writes. This solves a number of annoying situations, especially with DBM (hash method) writes, and also has the side effect of fixing a number of (stupid) benchmarks. Reviewed-by: mckusick Notes: svn path=/head/; revision=58909
* diff, patch and cvs didn't like these three last time around, try again.Poul-Henning Kamp2000-03-201-3/+3
| | | | Notes: svn path=/head/; revision=58365
* Rename the existing BUF_STRATEGY() to DEV_STRATEGY()Poul-Henning Kamp2000-03-206-19/+18
| | | | | | | | | | | substitute BUF_WRITE(foo) for VOP_BWRITE(foo->b_vp, foo) substitute BUF_STRATEGY(foo) for VOP_STRATEGY(foo->b_vp, foo) This patch is machine generated except for the ccd.c and buf.h parts. Notes: svn path=/head/; revision=58349
* Remove B_READ, B_WRITE and B_FREEBUF and replace them with a newPoul-Henning Kamp2000-03-205-18/+19
| | | | | | | | | | | | | | | | | | | | | | | | field in struct buf: b_iocmd. The b_iocmd is enforced to have exactly one bit set. B_WRITE was bogusly defined as zero giving rise to obvious coding mistakes. Also eliminate the redundant struct buf flag B_CALL, it can just as efficiently be done by comparing b_iodone to NULL. Should you get a panic or drop into the debugger, complaining about "b_iocmd", don't continue. It is likely to write on your disk where it should have been reading. This change is a step in the direction towards a stackable BIO capability. A lot of this patch were machine generated (Thanks to style(9) compliance!) Vinum users: Greg has not had time to test this yet, be careful. Notes: svn path=/head/; revision=58345
* Use 64-bit math to calculate if we have hit our freespace limit.Kirk McKusick2000-03-171-1/+2
| | | | | | | Necessary for coherent results on filesystems bigger than 0.5Tb. Notes: svn path=/head/; revision=58155
* Bug fixes for currently harmless bugs that could rise to biteKirk McKusick2000-03-152-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | the unwary if the code were called in slightly different ways. 1) In ufs_bmaparray() the code for calculating 'runb' will stop one block short of the first entry in an indirect block. i.e. if an indirect block contains N block numbers b[0]..b[N-1] then the code will never check if b[0] and b[1] are sequential. For reference, compare with the equivalent code that deals with direct blocks. 2) In ufs_lookup() there is an off-by-one error in the test that checks if dp->i_diroff is outside the range of the the current directory size. This is completely harmless, since the following while-loop condition 'dp->i_offset < endsearch' is never met, so the code immediately does a second pass starting at dp->i_offset = 0. 3) Again in ufs_lookup(), the condition in a sanity check is wrong for directories that are longer than one block. This bug means that the sanity check is only effective for small directories. Submitted by: Ian Dowse <iedowse@maths.tcd.ie> Notes: svn path=/head/; revision=58088
* Use 64-bit math to decide if optimization needs to be changed.Kirk McKusick2000-03-151-30/+48
| | | | | | | | | Necessary for coherent results on filesystems bigger than 0.5Tb. Submitted by: Paul Saab <ps@yahoo-inc.com> Notes: svn path=/head/; revision=58087
* In the 'found' case for ufs_lookup() the underlying bp's data wasMatthew Dillon2000-03-091-1/+1
| | | | | | | | | | | being accessed after the bp had been releaed. A simple move of the brelse() solves the problem. Approved by: jkh Submitted by: Ian Dowse <iedowse@maths.tcd.ie> Notes: svn path=/head/; revision=57869
* Fix a 'freeing free block' panic in UFS. The problem occurs when theMatthew Dillon2000-02-241-1/+24
| | | | | | | | | | | | | | | | | filesystem fills up. If the first indirect block exists and FFS is able to allocate deeper indirect blocks, but is not able to allocate the data block, FFS improperly unwinds the indirect blocks and leaves a block pointer hanging to a freed block. This will cause a panic later when the file is removed. The solution is to properly account for the first block-pointer-to-an-indirect-block we had to create in a balloc operation and then unwind it if a failure occurs. Detective work by: Ian Dowse <iedowse@maths.tcd.ie> Reviewed by: mckusick, Ian Dowse <iedowse@maths.tcd.ie> Approved by: jkh Notes: svn path=/head/; revision=57446
* After much consulting with bde, concluded that this fix was the best fixRobert Watson2000-02-221-2/+2
| | | | | | | | | | | | | to the current jail/chflags interactions. This fix conditionalizes ``root behavior'' in the chflags() case on not being in jail, so attempts to perform a chflags in a jail are limited to what a normal user could do. For example, this does allow setting of user flags as appropriate, but prohibits changing of system flags. Reviewed by: bde Notes: svn path=/head/; revision=57387
* Disable chflags() from within jail() so that root within jail can't makeRobert Watson2000-02-201-1/+1
| | | | | | | | | | a mess in securelevel environments. Results in one warning during /etc/rc as it attempts to remove file flags, but this is harmless. Approved by: High Lord Hubbard Notes: svn path=/head/; revision=57347
* When writing out bitmap buffers, need to skip over ones that alreadyKirk McKusick2000-01-301-1/+2
| | | | | | | | | | have a write in progress. Otherwise one can get in an infinite loop trying to get them all flushed. Submitted by: Matthew Dillon <dillon@apollo.backplane.com> Notes: svn path=/head/; revision=56908
* During fastpath processing for removal of a short-lived inode, theKirk McKusick2000-01-181-48/+56
| | | | | | | | | | | | | set of restrictions for cancelling an inode dependency (inodedep) is somewhat stronger than originally coded. Since this check appears in two places, we codify it into the function check_inode_unwritten which we then call from the two sites, one freeing blocks and the other freeing directory entries. Submitted by: Steinar Haug via Matthew Dillon Notes: svn path=/head/; revision=56209
* Need to reorganize the flushing of directory entry (pagedep) dependenciesKirk McKusick2000-01-181-63/+62
| | | | | | | | | | | | | | | | | so that they never try to lock an inode corresponding to ".." as this can lead to deadlock. We observe that any inode with an updated link count is always pushed into its buffer at the time of the link count change, so we do not need to do a VOP_UPDATE, but merely find its buffer and write it. The only time we need to get the inode itself is from the result of a mkdir whose name will never be ".." and hence locking such an inode will never request a lock above us in the filesystem tree. Thanks to Brian Fundakowski Feldman for providing the test program that tickled soft updates into hanging in "inode" sleep. Submitted by: Brian Fundakowski Feldman <green@FreeBSD.org> Notes: svn path=/head/; revision=56208
* Better bounding on softdep_flushfiles; other minor tweeks to checks.Kirk McKusick2000-01-171-7/+9
| | | | Notes: svn path=/head/; revision=56150
* Must track multiple uncommitted renames until one ultimately getsKirk McKusick2000-01-171-22/+65
| | | | | | | committed to disk or is removed. Notes: svn path=/head/; revision=56149
* Non-operational change, fix compiler warning.Matthew Dillon2000-01-141-1/+1
| | | | | | | Reviewed by: mckusick Notes: svn path=/head/; revision=55947
* Confirming Peter's fix (locking 101: release the lock before you goKirk McKusick2000-01-131-2/+0
| | | | | | | | | to sleep). Locking 101, part 2: do not look at buffer contents after you have been asleep. There is no telling what wonderous changes may have occurred. Notes: svn path=/head/; revision=55931
* Free the global softupdates lock prior to tsleep() in getdirtybuf().Peter Wemm2000-01-131-0/+2
| | | | | | | | | | | This seems to be responsible for a bunch of panics where the process sleeps and something else finds softupdates "locked" when it shouldn't be. This commit is unreviewed, but has been a big help here. Previously my boxes would panic pretty much on the first fsync() that wrote something to disk. Notes: svn path=/head/; revision=55928
* Because cylinder group blocks are now written in background,Kirk McKusick2000-01-131-3/+13
| | | | | | | | | | | | | it is no longer sufficient to get a lock on a buffer to know that its write has been completed. We have to first get the lock on the buffer, then check to see if it is doing a background write. If it is doing background write, we have to wait for the background write to finish, then check to see if that fullfilled our dependency, and if not to start another write. Luckily the explanation is longer than the fix. Notes: svn path=/head/; revision=55886
* A panic occurs during an fsync when a dirty block associated withKirk McKusick2000-01-131-4/+7
| | | | | | | | | | | | | | a vnode has not been written (which would clear certain of its dependencies). The problems arises because fsync with MNT_NOWAIT no longer pushes all the dirty blocks associated with a vnode. It skips those that require rollbacks, since they will just get instantly dirty again. Such skipped blocks are marked so that they will not be skipped a second time (otherwise circular dependencies would never clear). So, we fsync twice to ensure that everything will be written at least once. Notes: svn path=/head/; revision=55885
* The only known cause of this panic is running out of disk space.Kirk McKusick2000-01-111-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | The problem occurs when an indirect block and a data block are being allocated at the same time. For example when the 13th block of the file is written, the filesystem needs to allocate the first indirect block and a data block. If the indirect block allocation succeeds, but the data block allocation fails, the error code dellocates the indirect block as it has nothing at which to point. Unfortunately, it does not deallocate the indirect block's associated dependencies which then fail when they find the block unexpectedly gone (ptr == 0 instead of its expected value). The fix is to fsync the file before doing the block rollback, as the fsync will flush out all of the dependencies. Once the rollback is done the file must be fsync'ed again so that the soft updates code does not find unexpected changes. This approach is much slower than writing the code to back out the extraneous dependencies, but running out of disk space is not expected to be a common occurence, so just getting it right is the main criterion. PR: kern/15063 Submitted by: Assar Westerlund <assar@stacken.kth.se> Notes: svn path=/head/; revision=55799
* We cannot proceed to free the blocks of the file until the dependenciesKirk McKusick2000-01-111-29/+32
| | | | | | | | | have been cleaned up by deallocte_dependencies(). Once that is done, it is safe to post the request to free the blocks. A similar change is also needed for the freefile case. Notes: svn path=/head/; revision=55794
* Give vn_isdisk() a second argument where it can return a suitable errno.Poul-Henning Kamp2000-01-103-11/+9
| | | | | | | Suggested by: bde Notes: svn path=/head/; revision=55756
* Missing FREE_LOCK call before handle_workitem_freeblocks.Kirk McKusick2000-01-101-3/+5
| | | | | | | Submitted by: "Kenneth D. Merry" <ken@kdm.org> Notes: svn path=/head/; revision=55726
* Several performance improvements for soft updates have been added:Kirk McKusick2000-01-108-115/+285
| | | | | | | | | | | | | | | | | | 1) Fastpath deletions. When a file is being deleted, check to see if it was so recently created that its inode has not yet been written to disk. If so, the delete can proceed to immediately free the inode. 2) Background writes: No file or block allocations can be done while the bitmap is being written to disk. To avoid these stalls, the bitmap is copied to another buffer which is written thus leaving the original available for futher allocations. 3) Link count tracking. Constantly track the difference in i_effnlink and i_nlink so that inodes that have had no change other than i_effnlink need not be written. 4) Identify buffers with rollback dependencies so that the buffer flushing daemon can choose to skip over them. Notes: svn path=/head/; revision=55697
* Keep tighter control of removal dependencies by limiting the numberKirk McKusick2000-01-091-20/+22
| | | | | | | | | of dirrem structure rather than the collaterally created freeblks and freefile structures. Limit the rate of buffer dirtying by the syncer process during periods of intense file removal. Notes: svn path=/head/; revision=55694
* Reorganize softdep_fsync so that it only does the inode-is-flushedKirk McKusick2000-01-091-26/+22
| | | | | | | | | | | | check before the inode is unlocked while grabbing its parent directory. Once it is unlocked, other operations may slip in that could make the inode-is-flushed check fail. Allowing other writes to the inode before returning from fsync does not break the semantics of fsync since we have flushed everything that was dirty at the time of the fsync call. Notes: svn path=/head/; revision=55692
* Get rid of unreferenced function.Kirk McKusick2000-01-091-9/+0
| | | | Notes: svn path=/head/; revision=55691
* Make static non-exported functions from soft updates.Kirk McKusick2000-01-092-11/+12
| | | | Notes: svn path=/head/; revision=55690
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"Peter Wemm1999-12-294-8/+8
| | | | | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come. Notes: svn path=/head/; revision=55206
* Update the unclean flag for mount -u. I forgot to handle this caseBruce Evans1999-12-231-0/+2
| | | | | | | | | | | when I made the absence of the clean flag sticky in rev.1.88. This was a problem main for "mount /". There is no way to mount "/" for writing without using mount -u (normally implicitly), so after "mount -f /" of an unclean filesystem, the absence of the clean flag was sticky forever. Notes: svn path=/head/; revision=55029
* Change incorrect NULLs to 0sEivind Eklund1999-12-211-1/+1
| | | | Notes: svn path=/head/; revision=54952
* Second pass commit to introduce new ACL and Extended Attribute systemRobert Watson1999-12-192-0/+4
| | | | | | | | | | calls, vnops, vfsops, both in /kern, and to individual file systems that require a vfsop_ array entry. Reviewed by: eivind Notes: svn path=/head/; revision=54803
* The function request_cleanup() had a tsleep() with PCATCH. It isKirk McKusick1999-12-161-1/+1
| | | | | | | | | | | | | | | quite dangerous, since the process may hold locks at the point, and if it is stopped in that tsleep the machine may hang. Because the sleep is so short, the PCATCH is not required here, so it has been removed. For the future, the FreeBSD team needs to decide whether it is still reasonable to stop a process in tsleep, as that may affect any other code that uses PCATCH while holding kernel locks. Submitted by: Dmitrij Tejblum <tejblum@arc.hq.cti.ru> Reviewed by: Kirk McKusick <mckusick@mckusick.com> Notes: svn path=/head/; revision=54700
* Introduce NDFREE (and remove VOP_ABORTOP)Eivind Eklund1999-12-153-43/+5
| | | | Notes: svn path=/head/; revision=54655
* Lock reporting and assertion changes.Eivind Eklund1999-12-111-1/+1
| | | | | | | | | | | | | | | | | | * lockstatus() and VOP_ISLOCKED() gets a new process argument and a new return value: LK_EXCLOTHER, when the lock is held exclusively by another process. * The ASSERT_VOP_(UN)LOCKED family is extended to use what this gives them * Extend the vnode_if.src format to allow more exact specification than locked/unlocked. This commit should not do any semantic changes unless you are using DEBUG_VFS_LOCKS. Discussed with: grog, mch, peter, phk Reviewed by: peter Notes: svn path=/head/; revision=54444
* Remove the 'alpha, use at your own risk' death-statement.Bill Fumerola1999-12-031-4/+1
| | | | | | | Reviewed by: mckusick (verbally at FreeBSDcon) Notes: svn path=/head/; revision=54049
* Fix typo, add $FreeBSD$Bill Fumerola1999-12-031-1/+3
| | | | Notes: svn path=/head/; revision=54048
* Preferentially allocate the first indirect block in the sameKirk McKusick1999-12-011-1/+1
| | | | | | | | cylinder group as the inode. This makes a 15% difference in read speed for files in the 96K to 500K size range. Notes: svn path=/head/; revision=53996
* Retire MFS_ROOT and MFS_ROOT_SIZE options from the MFS implementation.Poul-Henning Kamp1999-11-261-121/+0
| | | | | | | | | | | | | | | | | | | | Add MD_ROOT and MD_ROOT_SIZE options to the md driver. Make the md driver handle MFS_ROOT and MFS_ROOT_SIZE options for compatibility. Add md driver to GENERIC, PCCARD and LINT. This is a cleanup which removes the need for some of the worse hacks in MFS: We really want to have a rootvnode but MFS on a preloaded image doesn't really have one. md is a true device, so it is less trouble. This has been tested with make release, and if people remember to add the "md" pseudo-device to their kernels, PicoBSD should be just fine as well. If people have no other use for MFS, it can be removed from the kernel. Notes: svn path=/head/; revision=53722
* Convert various pieces of code to use vn_isdisk() rather than checkingPoul-Henning Kamp1999-11-223-8/+8
| | | | | | | | | | | for vp->v_type == VBLK. In ccd: we don't need to call VOP_GETATTR to find the type of a vnode. Reviewed by: sos Notes: svn path=/head/; revision=53577
* We do not have ffs_checkexp, so remove the prototypeEivind Eklund1999-11-201-2/+0
| | | | Notes: svn path=/head/; revision=53464
* struct mountlist and struct mount.mnt_list have no business beingPoul-Henning Kamp1999-11-201-2/+1
| | | | | | | | | | | | | a CIRCLEQ. Change them to TAILQ_HEAD and TAILQ_ENTRY respectively. This removes ugly mp != (void*)&mountlist comparisons. Requested by: phk Submitted by: Jake Burkholder jake@checker.org PR: 14967 Notes: svn path=/head/; revision=53452