aboutsummaryrefslogtreecommitdiff
path: root/sys/gnu/ext2fs
Commit message (Collapse)AuthorAgeFilesLines
...
| * Finish (?) importing the Linux ext2fs files that our GPL'ed ext2fsBruce Evans2000-01-011-0/+135
| | | | | | | | | | | | | | | | | | | | | | | | files seem to be based on. Don't bother importing <asm-i386/string.h> just to get the Linux implementation of memscan() which is appended to our i386-bitops.h. The BSD skpc() should have been used instead of memscan(). Obtained from: Linux 1.2.2 distribution Notes: svn path=/vendor-sys/ext2fs/dist/; revision=55294
* | Back out M_* changes, per decision of the TRB.Warner Losh2003-02-193-9/+9
| | | | | | | | | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* | - Use the new vop_stdfsync instead of recreating our own.Jeff Roberson2003-02-091-49/+3
| | | | | | | | Notes: svn path=/head/; revision=110587
* | Use VOP_SPECSTRATEGY() instead of VOP_STRATEGY().Poul-Henning Kamp2003-01-281-1/+1
| | | | | | | | Notes: svn path=/head/; revision=110005
* | Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-213-9/+9
| | | | | | | | | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* | Since Jeffr made the std* functions the default in rev 1.63 ofPoul-Henning Kamp2003-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 Notes: svn path=/head/; revision=108648
* | Convert calls to BUF_STRATEGY to VOP_STRATEGY calls. This is a no-op sincePoul-Henning Kamp2003-01-031-1/+1
| | | | | | | | | | | | | | all BUF_STRATEGY did in the first place was call VOP_STRATEGY. Notes: svn path=/head/; revision=108589
* | Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,Jens Schweikhardt2003-01-011-2/+2
| | | | | | | | | | | | | | especially in troff files. Notes: svn path=/head/; revision=108533
* | Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/Jens Schweikhardt2002-12-301-1/+1
| | | | | | | | | | | | | | Add FreeBSD Id tag where missing. Notes: svn path=/head/; revision=108470
* | MFufs 1.33:Bruce Evans2002-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the 'found' case for ext2_lookup() the underlying bp's data was being accessed after the bp had been releaed. A simple move of the brelse() solves the problem. The PR reports that this caused panics running the GDB testsuite unless NO_GEOM is configured. PR: 44060 Reported by: Mark Kettenis <kettenis@chello.nl> MFC after: 3 days Notes: svn path=/head/; revision=105420
* | Be consistent about functions being static.Poul-Henning Kamp2002-10-161-16/+16
| | | | | | | | | | | | | | | | | | Fix misindentation. Spotted by: DARPA & NAI Labs. Notes: svn path=/head/; revision=105223
* | Regularize the vop_stdlock'ing protocol across all the filesystemsKirk McKusick2002-10-143-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that use it. Specifically, vop_stdlock uses the lock pointed to by vp->v_vnlock. By default, getnewvnode sets up vp->v_vnlock to reference vp->v_lock. Filesystems that wish to use the default do not need to allocate a lock at the front of their node structure (as some still did) or do a lockinit. They can simply start using vn_lock/VOP_UNLOCK. Filesystems that wish to manage their own locks, but still use the vop_stdlock functions (such as nullfs) can simply replace vp->v_vnlock with a pointer to the lock that they wish to have used for the vnode. Such filesystems are responsible for setting the vp->v_vnlock back to the default in their vop_reclaim routine (e.g., vp->v_vnlock = &vp->v_lock). In theory, this set of changes cleans up the existing filesystem lock interface and should have no function change to the existing locking scheme. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=105077
* | - Lock access to the buf lists.Jeff Roberson2002-09-253-14/+19
| | | | | | | | | | | | | | - Use vrefcnt() where appropriate. Notes: svn path=/head/; revision=103938
* | VOP_FSYNC() requires that it's vnode argument be locked, which nfs_link()Don Lewis2002-09-191-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | wasn't doing. Rather than just lock and unlock the vnode around the call to VOP_FSYNC(), implement rwatson's suggestion to lock the file vnode in kern_link() before calling VOP_LINK(), since the other filesystems also locked the file vnode right away in their link methods. Remove the locking and and unlocking from the leaf filesystem link methods. Reviewed by: rwatson, bde (except for the unionfs_link() changes) Notes: svn path=/head/; revision=103636
* | Remove any VOP_PRINT that redundantly prints the tag.Nate Lawson2002-09-181-4/+2
| | | | | | | | | | | | | | | | | | Move lockmgr_printinfo() into vprint() for everyone's benefit. Suggested by: bde Notes: svn path=/head/; revision=103559
* | Remove all use of vnode->v_tag, replacing with appropriate substitutes.Nate Lawson2002-09-142-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | v_tag is now const char * and should only be used for debugging. Additionally: 1. All users of VT_NTS now check vfsconf->vf_type VFCF_NETWORK 2. The user of VT_PROCFS now checks for the new flag VV_PROCDEP, which is propagated by pseudofs to all child vnodes if the fs sets PFS_PROCDEP. Suggested by: phk Reviewed by: bde, rwatson (earlier version) Notes: svn path=/head/; revision=103314
* | vfs_syscalls.c:Bruce Evans2002-09-101-51/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed rename(2) to follow the letter of the POSIX spec. POSIX requires rename() to have no effect if its args "resolve to the same existing file". I think "file" can only reasonably be read as referring to the inode, although the rationale and "resolve" seem to say that sameness is at the level of (resolved) directory entries. ext2fs_vnops.c, ufs_vnops.c: Replaced code that gave the historical BSD behaviour of removing one link name by checks that this code is now unreachable. This fixes some races. All vnodes needed to be unlocked for the removal, and locking at another level using something like IN_RENAME was not even attempted, so it was possible for rename(x, y) to return with both x and y removed even without any unlink(2) syscalls (one process can remove x using rename(x, y) and another process can remove y using rename(y, x)). Prodded by: alfred MFC after: 8 weeks PR: 42617 Notes: svn path=/head/; revision=103180
* | In order to better support flexible and extensible access control,Robert Watson2002-08-152-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | make a series of modifications to the credential arguments relating to file read and write operations to cliarfy which credential is used for what: - Change fo_read() and fo_write() to accept "active_cred" instead of "cred", and change the semantics of consumers of fo_read() and fo_write() to pass the active credential of the thread requesting an operation rather than the cached file cred. The cached file cred is still available in fo_read() and fo_write() consumers via fp->f_cred. These changes largely in sys_generic.c. For each implementation of fo_read() and fo_write(), update cred usage to reflect this change and maintain current semantics: - badfo_readwrite() unchanged - kqueue_read/write() unchanged pipe_read/write() now authorize MAC using active_cred rather than td->td_ucred - soo_read/write() unchanged - vn_read/write() now authorize MAC using active_cred but VOP_READ/WRITE() with fp->f_cred Modify vn_rdwr() to accept two credential arguments instead of a single credential: active_cred and file_cred. Use active_cred for MAC authorization, and select a credential for use in VOP_READ/WRITE() based on whether file_cred is NULL or not. If file_cred is provided, authorize the VOP using that cred, otherwise the active credential, matching current semantics. Modify current vn_rdwr() consumers to pass a file_cred if used in the context of a struct file, and to always pass active_cred. When vn_rdwr() is used without a file_cred, pass NOCRED. These changes should maintain current semantics for read/write, but avoid a redundant passing of fp->f_cred, as well as making it more clear what the origin of each credential is in file descriptor read/write operations. Follow-up commits will make similar changes to other file descriptor operations, and modify the MAC framework to pass both credentials to MAC policy modules so they can implement either semantic for revocation. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=101941
* | Pass IO_NOMACCHECK to vn_rdwr() in the following checks to preventRobert Watson2002-08-122-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | enforcement of MAC policy on the read or write operations: - In ext2fs, don't enforce MAC on loop-back reads and writes supporting directory read operations in lookup(), directory modifications in rename(), directory write operations in mkdir(), symlink write operations in symlink(). - In the NFS client locking code, perform vn_rdwr() on the NFS locking socket without enforcing MAC, since the write is done on behalf of the kernel NFS implementation rather than the user process. - In UFS, don't enforce MAC on loop-back reads and writes supporting directory read operations in lookup(), and symlink write operations in symlink(). Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=101744
* | - Replace v_flag with v_iflag and v_vflagJeff Roberson2002-08-041-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - v_vflag is protected by the vnode lock and is used when synchronization with VOP calls is needed. - v_iflag is protected by interlock and is used for dealing with vnode management issues. These flags include X/O LOCK, FREE, DOOMED, etc. - All accesses to v_iflag and v_vflag have either been locked or marked with mp_fixme's. - Many ASSERT_VOP_LOCKED calls have been added where the locking was not clear. - Many functions in vfs_subr.c were restructured to provide for stronger locking. Idea stolen from: BSD/OS Notes: svn path=/head/; revision=101308
* | Use hashdestroy() now that it exists.Ian Dowse2002-06-301-6/+1
| | | | | | | | Notes: svn path=/head/; revision=99102
* | Convert ext2fs to nmount(2).Maxime Henrion2002-05-242-27/+28
| | | | | | | | Notes: svn path=/head/; revision=97255
* | Add an ext2_uninit() routine that undoes the actions performed byIan Dowse2002-05-183-5/+27
| | | | | | | | | | | | | | | | ext2_init(). This permits the ext2fs module to be unloaded without causing panics and leaking memory. Notes: svn path=/head/; revision=96881
* | Fix two off-by-one errors when sanity-checking inode numbers. InIan Dowse2002-05-182-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | ext2fs, inode numbers start at 1, so the maximum valid inode number is (s_inodes_per_group * s_groups_count), not one less. This is just a minimal change to avoid unnecessary panics and errors; some other related bugs that Bruce Evans mentioned to me are not addressed. Reviewed by: bde (ages ago) Notes: svn path=/head/; revision=96880
* | Use explicitly-sized types where necessary to make ext2fs work againIan Dowse2002-05-188-59/+59
| | | | | | | | | | | | | | after the change to a 64-bit daddr_t. Notes: svn path=/head/; revision=96877
* | Give ext2fs its own static "dirchk" variable instead of using ufs'sIan Dowse2002-05-161-4/+12
| | | | | | | | | | | | | | variable. Make this accessible as the sysctl vfs.e2fs.dirchk. Notes: svn path=/head/; revision=96753
* | Remove register keyword.Ian Dowse2002-05-168-86/+83
| | | | | | | | Notes: svn path=/head/; revision=96752
* | Complete the separation of ext2fs from ufs by copying the remainingIan Dowse2002-05-1614-449/+1342
| | | | | | | | | | | | | | | | | | | | | | | | | | shared code and converting all ufs references. Originally it may have made sense to share common features between the two filesystems, but recently it has only caused problems, the UFS2 work being the final straw. All UFS_* indirect calls are now direct calls to ext2_* functions, and ext2fs-specific mount and inode structures have been introduced. Notes: svn path=/head/; revision=96749
* | Following a repo-copy from src/sys/ufs/ufs, rename functions andIan Dowse2002-05-144-162/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | structures etc. to ext2fs-specific names, and remove ufs-specific code that is no longer required. As a first stage, the code will still convert back and forth between the on-disk format and struct inode, so the struct dinode fields have been added to struct inode for now. Note that these files are not yet connected to the build. Notes: svn path=/head/; revision=96596
* | Make daddr_t and u_daddr_t 64bits wide.Poul-Henning Kamp2002-05-141-2/+2
| | | | | | | | | | | | | | | | | | Retire daddr64_t and use daddr_t instead. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=96572
* | Fixed syntax errors (garbage after #endif; just editing errors in thisBruce Evans2002-05-131-4/+4
| | | | | | | | | | | | | | | | | | case). These errors and related style bugs swere cloned from ufs shortly after they were committed to ufs. They were mostly fixed in ufs long ago. Notes: svn path=/head/; revision=96521
* | Remove register keyword.Poul-Henning Kamp2002-05-131-1/+1
| | | | | | | | | | | | | | | | Sponsored by: DARPA & NAI Labs. Submitted by: mckusick Notes: svn path=/head/; revision=96506
* | ARGH! SBLOCK is not unused. Try to get this right.Poul-Henning Kamp2002-05-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | BBSIZE belongs in <sys/disklabel.h> (but shouldn't be a constant). Define SBLOCK again, using the right math. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=96473
* | Remove #define for BBOFF, it is assumed == 0 so many places that we mightPoul-Henning Kamp2002-05-121-2/+1
| | | | | | | | | | | | | | | | | | | | as well forget about it. In fact the only thing which used it was the SBOFF macro. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=96472
* | Remove unused BBLOCK and SBLOCK #defines.Poul-Henning Kamp2002-05-121-2/+0
| | | | | | | | | | | | | | Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=96471
* | Change callers of mtx_init() to pass in an appropriate lock type name. InJohn Baldwin2002-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=93818
* | Change the suser() API to take advantage of td_ucred as well as do aJohn Baldwin2002-04-012-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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@ Notes: svn path=/head/; revision=93593
* | In ffs_mountffs(), set mnt_iosize_max to si_iosize_max unconditionallyBruce Evans2002-03-301-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=93430
* | Moved $FreeBSD$ to the correct place.Bruce Evans2002-03-232-3/+2
| | | | | | | | Notes: svn path=/head/; revision=93016
* | Repaired CSRG id. This file was not in Lite1; it was just cloned from aBruce Evans2002-03-234-5/+4
| | | | | | | | | | | | | | file with a in Lite1 before being cvs-added to FreeBSD. Notes: svn path=/head/; revision=93015
* | Fixed some style bugs in the removal of __P(()). Continuation linesBruce Evans2002-03-233-11/+8
| | | | | | | | | | | | | | | | were not outdented to preserve non-KNF lining up of code with parentheses. Switch to KNF formatting. Notes: svn path=/head/; revision=93014
* | Remove __P.Alfred Perlstein2002-03-198-84/+84
| | | | | | | | Notes: svn path=/head/; revision=92728
* | Add a flags parameter to VFS_VGET to pass through the desiredKirk McKusick2002-03-175-15/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=92462
* | Introduce the new 64-bit size disk block, daddr64_t. ChangeKirk McKusick2002-03-152-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=92363
* | Remove use of the bogus ioctl DIOCGPART.Poul-Henning Kamp2002-03-111-11/+1
| | | | | | | | | | | | | | | | | | | | It was used to initialize an unused variable, because ext2fs was copy&pasted from UFS rather than copy,paste&cleaned from UFS. Suggested by: bde Notes: svn path=/head/; revision=92082
* | Simple p_ucred -> td_ucred changes to start using the per-thread ucredJohn Baldwin2002-02-271-3/+3
| | | | | | | | | | | | | | reference. Notes: svn path=/head/; revision=91406
* | Update to C99, s/__FUNCTION__/__func__/,David E. O'Brien2001-12-101-1/+1
| | | | | | | | | | | | | | also don't use ANSI string concatenation. Notes: svn path=/head/; revision=87599
* | Add mnt_reservedvnlist so we can MFC to 4.x, in order to make all mountMatthew Dillon2001-11-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | structure changes now rather then piecemeal later on. mnt_nvnodelist currently holds all the vnodes under the mount point. This will eventually be split into a 'dirty' and 'clean' list. This way we only break kld's once rather then twice. nvnodelist will eventually turn into the dirty list and should remain compatible with the klds. Notes: svn path=/head/; revision=86037
* | Change the vnode list under the mount point from a LIST to a TAILQMatthew Dillon2001-10-231-4/+5
| | | | | | | | | | | | | | | | | | in preparation for an implementation of limiting code for kern.maxvnodes. MFC after: 3 days Notes: svn path=/head/; revision=85339
* | The addition of i_dirhash to struct inode pushed RELENG_4'sIan Dowse2001-09-242-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sizeof(struct inode) into a new malloc bucket on the i386. This didn't happen in -current due to the removal of i_lock, but it does no harm to apply the workaround to -current first. Reduce the size of the i_spare[] array in struct inode from 4 to 3 entries, and change ext2fs to use i_din.di_spare[1] so that it does not need i_spare[3]. Reviewed by: bde MFC after: 3 days Notes: svn path=/head/; revision=83899