summaryrefslogtreecommitdiffstats
path: root/sys/ufs
Commit message (Collapse)AuthorAgeFilesLines
* Don't peak into the malloc_type structure for limits. The desired vnodesjeff2002-04-151-2/+1
| | | | | check should be sufficient. This is required for the pending removal of malloc_type limits.
* Move generic disk ioctls from <sys/disklabel.h> to <sys/disk.h>.phk2002-04-081-1/+1
| | | | Sponsored by: DARPA & NAI Labs
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-044-5/+5
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Move the FFS parameter MAXFRAG from <sys/param.h> to <ufs/ffs/fs.h>phk2002-04-032-0/+3
| | | | Sponsored by: DARPA & NAI Labs.
* Use DIOCGSECTORSIZE instead of the bogus DIOCGPART ioctl.phk2002-04-021-6/+8
|
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-018-16/+16
| | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
* In ffs_mountffs(), set mnt_iosize_max to si_iosize_max unconditionallybde2002-03-301-1/+1
| | | | | | | | | | | | | | | | provided the latter is nonzero. At this point, the former is a fairly arbitrary default value (DFTPHYS), so changing it to any reasonable value specified by the device driver is safe. Using the maximum of these limits broke ffs clustered i/o for devices whose si_iosize_max is < DFLTPHYS. Using the minimum would break device drivers' ability to increase the active limit from DFTLPHYS up to MAXPHYS. Copied the code for this and the associated (unnecessary?) fixup of mp_iosize_max to all other filesystems that use clustering (ext2fs and msdosfs). It was completely missing. PR: 36309 MFC-after: 1 week
* Two minor changes to dirhash, which result in some marginal benchmarkdwmalone2002-03-201-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | improvements. 1) If deleting an entry results in a chain of deleted slots ending in an empty slot, then we can be a bit more aggressive about marking slots as empty. 2) The last stage of the FNV hash is to xor the last byte of data into the hash. This means that filenames which differ only in the last byte will be placed close to one another in the hash table, which forms longer chains. To work around this common case, we also hash in the address of the dirhash structure. news/cancel = news/articles/control/cancel for a tradspool inn server squid2 = squid level 2 directory (dirs called 00->FF) squid3 = squid level 3 directory (files called 00001F00->00001FFF) mean #probes for home dir mh inbox news/cancel tmp squid2 squid3 old successful 1.02 3.19 4.07 1.10 7.85 2.06 new successful 1.04 1.32 1.27 1.04 1.93 1.17 old unsuccessful 1.08 4.50 5.37 1.17 10.76 2.69 new unsuccessful 1.08 1.73 1.64 1.17 2.89 1.37 Reviewed by: iedowse MFC after: 2 weeks
* Remove references to vm_zone.h and switch over to the new uma API.jeff2002-03-204-15/+15
|
* Remove __P.alfred2002-03-1914-280/+271
|
* Fixed some printf format errors (hopefully all of the remaining daddr64_tbde2002-03-191-5/+6
| | | | | | ones for GENERIC, and all others on the same line as those). Reformat the printfs if necessary to avoid new long lones or old format printf errors.
* Add a flags parameter to VFS_VGET to pass through the desiredmckusick2002-03-1713-81/+96
| | | | | | | | | | | | locking flags when acquiring a vnode. The immediate purpose is to allow polling lock requests (LK_NOWAIT) needed by soft updates to avoid deadlock when enlisting other processes to help with the background cleanup. For the future it will allow the use of shared locks for read access to vnodes. This change touches a lot of files as it affects most filesystems within the system. It has been well tested on FFS, loopback, and CD-ROM filesystems. only lightly on the others, so if you find a problem there, please let me (mckusick@mckusick.com) know.
* Introduce the new 64-bit size disk block, daddr64_t. Changemckusick2002-03-154-11/+21
| | | | | | | | | | | | the bio and buffer structures to have daddr64_t bio_pblkno, b_blkno, and b_lblkno fields which allows access to disks larger than a Terabyte in size. This change also requires that the VOP_BMAP vnode operation accept and return daddr64_t blocks. This delta should not affect system operation in any way. It merely sets up the necessary interfaces to allow the development of disk drivers that work with these larger disk block addresses. It also allows for the development of UFS2 which will use 64-bit block addresses.
* Quiet a warning on the Alpha.obrien2002-03-151-1/+5
|
* This corrects the first of two known deadlock conditions thatmckusick2002-03-141-12/+1
| | | | come from the presence of a snapshot file.
* Fix a bug in ufsdirhash_adjfree() that caused it to incorrectlyiedowse2002-03-111-10/+7
| | | | | | | | | | | | | | | | | | | | update the free-space statistics in some cases. The problem affected directory blocks when the free space dropped below the size of the maximum allowed entry size. When this happened, the free-space summary information could claim that there are no further blocks that can fit a maximum-size entry, even if there are. The effect of this bug is that the directory may be enlarged even though there is space within the directory for the new entry. This wastes disk space and has a negative impact on performance. Fix it by correctly computing the dh_firstfree array index, adding a helper macro for clarity. Put an extra sanity check into ufsdirhash_checkblock() to detect the situation in future. Found by: dwmalone Reviewed by: dwmalone MFC after: 1 week
* I missed one VOP_CLOSE in the previous commit.phk2002-03-111-0/+5
| | | | Pointed out by: bde
* As a XXX bandaid open the mounted device READ/WRITE even if we only mountphk2002-03-111-0/+14
| | | | | | | | | | | read-only. The trouble here is that we don't reopen the device in read/write mode when we remount in read/write mode resulting in a filesystem sending write requests to a device which was only opened read/only. I'm not quite sure how such a reopen would best be done and defer the problem to more agile hackers.
* Update DBA for NAI. We have several. We used the wrong one. :-)rwatson2002-03-071-1/+1
|
* Add new errno ``ENOATTR''.green2002-03-072-29/+17
|
* cleanup readability syntax prior to ongoing b_resid work commits.dillon2002-03-061-4/+5
| | | | MFC after: 1 day
* Use thread0.td_ucred instead of proc0.p_ucred. This change is cosmeticjhb2002-02-271-1/+1
| | | | | | and isn't strictly required. However, it lowers the number of false positives found when grep'ing the kernel sources for p_ucred to ensure proper locking.
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-277-32/+32
| | | | reference.
* Replace bowrite() with BUF_WRITE in ufs.phk2002-02-221-3/+3
| | | | | | | | | Remove bowrite(), it is now unused. This is the first step in getting entirely rid of BIO_ORDERED which is a generally accepted evil thing. Approved by: mckusick
* o Minor style fix on #endif, missing '_' in comment.rwatson2002-02-201-1/+1
|
* Make v_addpollinfo() visible and non-inline.phk2002-02-181-5/+2
| | | | | | | Have callers only call it as needed. Add necessary call in ufs_kqfilter(). Test-case found by: Andrew Gallatin <gallatin@cs.duke.edu>
* Move the stuff related to select and poll out of struct vnode.phk2002-02-171-6/+12
| | | | | | | | | The use of the zone allocator may or may not be overkill. There is an XXX: over in ufs/ufs/ufs_vnops.c that jlemon may need to revisit. This shaves about 60 bytes of struct vnode which on my laptop means 600k less RAM used for vnodes.
* Collect the VN_KNOTE() macro definitions on vnode.hphk2002-02-173-8/+0
|
* In a threaded world, differnt priorirites become properties ofjulian2002-02-111-2/+2
| | | | | | different entities. Make it so. Reviewed by: jhb@freebsd.org (john baldwin)
* Minor style tweaks.rwatson2002-02-101-19/+15
| | | | | Remove an unneeded comment and commented out code that won't be needed.
* Copyright + license update.rwatson2002-02-101-1/+10
|
* Part I: Update extended attribute API and ABI:rwatson2002-02-101-20/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | o Modify the system call syntax for extattr_{get,set}_{fd,file}() so as not to use the scatter gather API (which appeared not to be used by any consumers, and be less portable), rather, accepts 'data' and 'nbytes' in the style of other simple read/write interfaces. This changes the API and ABI. o Modify system call semantics so that extattr_get_{fd,file}() return a size_t. When performing a read, the number of bytes read will be returned, unless the data pointer is NULL, in which case the number of bytes of data are returned. This changes the API only. o Modify the VOP_GETEXTATTR() vnode operation to accept a *size_t argument so as to return the size, if desirable. If set to NULL, the size will not be returned. o Update various filesystems (pseodofs, ufs) to DTRT. These changes should make extended attributes more useful and more portable. More commits to rebuild the system call files, as well as update userland utilities to follow. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Remove di_inumber since LFS is long gone.phk2002-02-101-2/+0
|
* Occationally background fsck would cause a spurious ``freeing freemckusick2002-02-071-0/+4
| | | | | | | | inode'' panic. This change corrects that problem by setting the fs_active flag when the inode map changes to notify the snapshot code that the cylinder group must be rescanned. Submitted by: Robert Watson <rwatson@FreeBSD.org>
* Occationally deleted files would hang around for hours or daysmckusick2002-02-071-7/+10
| | | | | | | | | | | without being reclaimed. This bug was introduced in revision 1.95 dealing with filenames placed in newly allocated directory blocks, thus is not present in 4.X systems. The bug is triggered when a new entry is made in a directory after the data block containing the original new entry has been written, but before the inode that references the data block has been written. Submitted by: Bill Fenner <fenner@research.att.com>
* When taking a snapshot, we must check for active files that havemckusick2002-02-026-272/+336
| | | | | | been unlinked (e.g., with a zero link count). We have to expunge all trace of these files from the snapshot so that they are neither reclaimed prematurely by fsck nor saved unnecessarily by dump.
* Add a stub for softdep_request_cleanup() so that compilation withoutmckusick2002-01-231-0/+9
| | | | | | SOFTUPDATES option works properly. Submitted by: Benno Rice <benno@jeamland.net>
* This patch fixes a long standing complaint with soft updates inmckusick2002-01-223-10/+64
| | | | | | | | | | | | | | | | which small and/or nearly full filesystems would fail with `file system full' messages when trying to replace a number of existing files (for example during a system installation). When the allocation routines are about to fail with a file system full condition, they make a call to softdep_request_cleanup() which attempts to accelerate the flushing of pending deletion requests in an effort to free up space. In the face of filesystem I/O requests that exceed the available disk transfer capacity, the cleanup request could take an unbounded amount of time. Thus, the softdep_request_cleanup() routine will only try for tickdelay seconds (default 2 seconds) before giving up and returning a filesystem full error. Under typical conditions, the softdep_request_cleanup() routine is able to free up space in under fifty milliseconds.
* Fix a bug introduced in ffs_snapshot.c -r1.25 and fs.h -r1.26mckusick2002-01-172-4/+4
| | | | | | | | | which caused incomplete snapshots to be taken. When background fsck would run on these snapshots, the result would be files being incorrectly released which would subsequently panic the kernel with ``handle_workitem_freefile: inodedep survived'', ``handle_written_inodeblock: live inodedep'', and ``handle_workitem_remove: lost inodedep'' errors.
* Put write on read-only filesystem panic after we have weeded outmckusick2002-01-161-2/+2
| | | | | | block and character devices, fifo's, etc. Submitted by: Bruce Evans <bde@zeta.org.au>
* When downgrading a filesystem from read-write to read-only, operationsmckusick2002-01-154-8/+17
| | | | | | | | | | | | | | | | | | | | involving file removal or file update were not always being fully committed to disk. The result was lost files or corrupted file data. This change ensures that the filesystem is properly synced to disk before the filesystem is down-graded. This delta also fixes a long standing bug in which a file open for reading has been unlinked. When the last open reference to the file is closed, the inode is reclaimed by the filesystem. Previously, if the filesystem had been down-graded to read-only, the inode could not be reclaimed, and thus was lost and had to be later recovered by fsck. With this change, such files are found at the time of the down-grade. Normally they will result in the filesystem down-grade failing with `device busy'. If a forcible down-grade is done, then the affected files will be revoked causing the inode to be released and the open file descriptors to begin failing on attempts to read. Submitted by: "Sam Leffler" <sam@errno.com>
* SMP Lock struct file, filedesc and the global file list.alfred2002-01-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seigo Tanimura (tanimura) posted the initial delta. I've polished it quite a bit reducing the need for locking and adapting it for KSE. Locks: 1 mutex in each filedesc protects all the fields. protects "struct file" initialization, while a struct file is being changed from &badfileops -> &pipeops or something the filedesc should be locked. 1 mutex in each struct file protects the refcount fields. doesn't protect anything else. the flags used for garbage collection have been moved to f_gcflag which was the FILLER short, this doesn't need locking because the garbage collection is a single threaded container. could likely be made to use a pool mutex. 1 sx lock for the global filelist. struct file * fhold(struct file *fp); /* increments reference count on a file */ struct file * fhold_locked(struct file *fp); /* like fhold but expects file to locked */ struct file * ffind_hold(struct thread *, int fd); /* finds the struct file in thread, adds one reference and returns it unlocked */ struct file * ffind_lock(struct thread *, int fd); /* ffind_hold, but returns file locked */ I still have to smp-safe the fget cruft, I'll get to that asap.
* When going to sleep, we must save our SPL so that it does not getmckusick2002-01-121-38/+76
| | | | | | | | | | lost if some other process uses the lock while we are sleeping. We restore it after we have slept. This functionality is provided by a new routine interlocked_sleep() that wraps the interlocking with functions that sleep. This function is then used in place of the old ACQUIRE_LOCK_INTERLOCKED() and FREE_LOCK_INTERLOCKED() macros. Submitted by: Debbie Chu <dchu@juniper.net>
* Must call drain_output() before checking the dirty block listmckusick2002-01-111-8/+10
| | | | | | | | | in softdep_sync_metadata(). Otherwise we may miss dependencies that need to be flushed which will result in a later panic with the message ``vinvalbuf: dirty bufs''. Submitted by: Matthew Dillon <dillon@apollo.backplane.com> MFC after: 1 week
* Do not pull quota entries of the cache-list if they have alreadyphk2002-01-101-1/+2
| | | | | | | | | | | | | been removed from the cache-list as part of a previous unmount. This would result in panics (page fault in dqflush()) during subsequent umounts provided that enough distinct UID's to actually make the hash do something are active. This can probably explain a number of weird quota related behaviours. PR: 32331 maybe more. Reproduced by: Søren Schrørder <sch@cybercity.dk>
* Initialise the bioops vector hack at runtime rather than at link time. Thismsmith2002-01-081-8/+7
| | | | | | avoids the use of common variables. Reviewed by: mckusick
* Fix a BUF_TIMELOCK race against BUF_LOCK and fix a deadlock in vget()dillon2001-12-202-2/+2
| | | | | | | | against VM_WAIT in the pageout code. Both fixes involve adjusting the lockmgr's timeout capability so locks obtained with timeouts do not interfere with locks obtained without a timeout. Hopefully MFC: before the 4.5 release
* Change the atomic_set_char to atomic_set_int and atomic_clear_charmckusick2001-12-183-13/+17
| | | | | | to atomic_clear_int to ease the implementation for the sparc64. Requested by: Jake Burkholder <jake@locore.ca>
* Make sure we ignore the value of `fs_active' when reloading theiedowse2001-12-161-1/+2
| | | | | superblock, and move the initialisation of it to beside where other pointer fields are initialised.
* Move the new superblock field `fs_active' into the region of theiedowse2001-12-161-5/+7
| | | | | | superblock that is already set up to handle pointer types. This fixes an accidental change in the superblock size on 64-bit platforms caused by revision 1.24.
OpenPOWER on IntegriCloud