summaryrefslogtreecommitdiffstats
path: root/sys/gnu/ext2fs/ext2_lookup.c
Commit message (Collapse)AuthorAgeFilesLines
* Move ext2fs from src/gnu to src/gnu/fs.rodrigc2005-06-151-1080/+0
| | | | | | | | Discussed on arch@. Reviewed by: kan Approved by: re (blanket), kan Discussed with: dumbbell
* - Change all filesystems and vfs_cache to relock the dvp once the child isjeff2005-04-131-4/+3
| | | | | | locked in the ISDOTDOT case. Se vfs_lookup.c r1.79 for details. Sponsored by: Isilon Systems, Inc.
* - Remove wantparent, it is no longer necessary. An assert in vfs_lookup.cjeff2005-03-291-8/+1
| | | | | prevents any callers from doing a modifying op without LOCKPARENT or WANTPARENT.
* - ext2fs_lookup() is no longer responsible for unlocking the dvp, this isjeff2005-03-281-16/+1
| | | | | | | handled in vfs_lookup.c. This code was missing PDIRUNLOCK use prior to the removal of PDIRUNLOCK in rev 1.73 of vfs_lookup.c. Sponsored by: Isilon Systems, Inc.
* Make a SYSCTL_NODE staticphk2005-02-101-1/+1
|
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-2/+2
|
* Remove advertising clause from University of California Regent'simp2004-04-071-4/+0
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* Properly vector all bwrite() and BUF_WRITE() calls through the same pathphk2004-03-111-4/+4
| | | | and s/BUF_WRITE()/bwrite()/ since it now does the same as bwrite().
* Fixed misspellings of "ext2_*" as "ufs_*" and " "ext2fs_*", and ofbde2004-02-151-7/+6
| | | | | "independent" as "dependent" Fixed some other relatively minor wording and formatting errors.
* Clean up whitespace, s/register //, refrain from strong urge to ANSIfy.des2003-03-021-34/+33
|
* uiomove-related caddr_t -> void * (just the low-hanging fruit)des2003-03-021-2/+1
|
* Back out M_* changes, per decision of the TRB.imp2003-02-191-2/+2
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-2/+2
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* MFufs 1.33:bde2002-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
* In order to better support flexible and extensible access control,rwatson2002-08-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Pass IO_NOMACCHECK to vn_rdwr() in the following checks to preventrwatson2002-08-121-3/+5
| | | | | | | | | | | | | | | | | | | | 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
* Give ext2fs its own static "dirchk" variable instead of using ufs'siedowse2002-05-161-4/+12
| | | | variable. Make this accessible as the sysctl vfs.e2fs.dirchk.
* Remove register keyword.iedowse2002-05-161-12/+12
|
* Complete the separation of ext2fs from ufs by copying the remainingiedowse2002-05-161-16/+33
| | | | | | | | | | 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.
* Moved $FreeBSD$ to the correct place.bde2002-03-231-2/+1
|
* Fixed some style bugs in the removal of __P(()). Continuation linesbde2002-03-231-3/+2
| | | | | were not outdented to preserve non-KNF lining up of code with parentheses. Switch to KNF formatting.
* Remove __P.alfred2002-03-191-2/+2
|
* Add a flags parameter to VFS_VGET to pass through the desiredmckusick2002-03-171-5/+10
| | | | | | | | | | | | 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.
* KSE Milestone 2julian2001-09-121-15/+15
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Convert all users of fldoff() to offsetof(). fldoff() is badphk2000-10-271-2/+0
| | | | | | | | | | | | | | | | | | | | | | | because it only takes a struct tag which makes it impossible to use unions, typedefs etc. Define __offsetof() in <machine/ansi.h> Define offsetof() in terms of __offsetof() in <stddef.h> and <sys/types.h> Remove myriad of local offsetof() definitions. Remove includes of <stddef.h> in kernel code. NB: Kernelcode should *never* include from /usr/include ! Make <sys/queue.h> include <machine/ansi.h> to avoid polluting the API. Deprecate <struct.h> with a warning. The warning turns into an error on 01-12-2000 and the file gets removed entirely on 01-01-2001. Paritials reviews by: various. Significant brucifications by: bde
* Fixed some serious bugs in ext2_readdir():bde2000-09-121-11/+22
| | | | | | | | | | | | | | | | | The cookie buffer was usually overrun by a large amount whenever cookies were used. Cookies are used by nfs and the Linuxulator, so this bug usually caused panics whenever an ext2fs filesystem was nfs mounted or a Linux utility that calls readdir() was run on an ext2fs filesystem. The directory buffer was sometimes overrun by a small amount. This sometimes caused panics and wrong results even for FreeBSD utilities, but it was usually harmless because FreeBSD utilities use a large enough buffer size (4K). Linux utilities usually triggered the bug since they use a too-small buffer size (512 bytes), at least with the old RedHat utilities that I tested with. PR: 19407 (this fix is incomplete or for a slightly different bug)
* Separate the struct bio related stuff out of <sys/buf.h> intophk2000-05-051-0/+1
| | | | | | | | | | | | | | | <sys/bio.h>. <sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on the subject of nested includes. Diskdrivers and similar stuff below specfs::strategy() should no longer need to include <sys/buf.> unless they need caching of data. Still a few bogus uses of struct buf to track down. Repocopy by: peter
* ext2fs relies on UFS support code, and as a result also requiresrwatson2000-04-151-0/+1
| | | | | | | | | | extattr.h to be included. This fixes the broken ext2fs build as of the import of extattr code. Also added $FreeBSD: $ to a couple of files that didn't have them, without which I couldn't commit this fix. Reported by: "George W. Dinolt" <gdinolt@pacbell.net>
* Rename the existing BUF_STRATEGY() to DEV_STRATEGY()phk2000-03-201-4/+4
| | | | | | | | 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.
* MFS (ext2_lookup.c 1.17.2.2, ext2_vnops.c 1.42.2.2: fix "filetype" support).bde2000-03-031-1/+1
| | | | Approved by: jkh
* Support filesystems with the not-so-new "filetype" feature. Thisbde2000-01-051-66/+95
| | | | | feature gives the d_type field for struct dirent. We used to panic in ext2_readdir() for filesystems with this feature.
* Add a vnode argument to VOP_BWRITE to get rid of the last vnodemckusick1999-06-161-4/+4
| | | | | operator special case. Delete special case code from vnode_if.sh, vnode_if.src, umap_vnops.c, and null_vnops.c.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-271-16/+16
| | | | kernel compile
* Fixed printf format errors.bde1998-07-111-1/+1
|
* Back out DIAGNOSTIC changes.eivind1998-02-061-2/+0
|
* Turn DIAGNOSTIC into a new-style option.eivind1998-02-041-0/+2
|
* Removed __FreeBSD__ ifdefs.bde1997-12-021-4/+0
|
* VFS mega cleanup commit (x/N)phk1997-10-161-7/+7
| | | | | | | | | | | | | | | | | | | | | | | 1. Add new file "sys/kern/vfs_default.c" where default actions for VOPs go. Implement proper defaults for ABORTOP, BWRITE, LEASE, POLL, REVOKE and STRATEGY. Various stuff spread over the entire tree belongs here. 2. Change VOP_BLKATOFF to a normal function in cd9660. 3. Kill VOP_BLKATOFF, VOP_TRUNCATE, VOP_VFREE, VOP_VALLOC. These are private interface functions between UFS and the underlying storage manager layer (FFS/LFS/MFS/EXT2FS). The functions now live in struct ufsmount instead. 4. Remove a kludge of VOP_ functions in all filesystems, that did nothing but obscure the simplicity and break the expandability. If a filesystem doesn't implement VOP_FOO, it shouldn't have an entry for it in its vnops table. The system will try to DTRT if it is not implemented. There are still some cruft left, but the bulk of it is done. 5. Fix another VCALL in vfs_cache.c (thanks Bruce!)
* Remove some stuff from lookup which is now handled centrally.phk1997-09-101-11/+0
|
* Uncut&paste cache_lookup().phk1997-08-261-49/+1
| | | | | | | | | | | | | | | This unifies several times in theory indentical 50 lines of code. The filesystems have a new method: vop_cachedlookup, which is the meat of the lookup, and use vfs_cache_lookup() for their vop_lookup method. vfs_cache_lookup() will check the namecache and pass on to the vop_cachedlookup method in case of a miss. It's still the task of the individual filesystems to populate the namecache with cache_enter(). Filesystems that do not use the namecache will just provide the vop_lookup method as usual.
* Removed unused #includes.bde1997-06-141-1/+0
|
* Support NFS cookies in VOP_READDIR, allowing ext2fs filesystems to bedfr1997-04-051-0/+26
| | | | | | exported via NFS. 2.2 candidate.
* Fixed gratuitous ANSIisms.bde1997-04-011-5/+6
| | | | Removed trailing newline from panic messages.
* This is the kernel Lite/2 commit. There are some requisite userlanddyson1997-02-101-14/+15
| | | | | | | | | | | | | | | changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org>
* Fixed lookup of ".." in checkpath. It always failed, so renames ofbde1996-11-091-1/+1
| | | | | | | | directories to a different parent directory always failed. This bug was caused by 4.4Lite2 changing the directory format and ext2fs not keeping up. Should be in 2.2.
* Fixed spacefree calculation in ext2_direnter(). This bug sometimes causedbde1996-11-081-1/+1
| | | | | | | | | panics. This should be in 2.2, of course. Submitted by: davidg Obtained from: bouyer@antioche.ibp.fr (Manuel BOUYER) (fix for NetBSD)
* Clean up -Wunused warnings.gpalmer1996-06-121-1/+0
| | | | Reviewed by: bde
* ext2_inode_cnv.c:bde1995-11-091-3/+10
| | | | | | | | | | | | | | | Included <sys/vnode.h> and its prerequisite <sys/proc.h>, and cleaned up includes. The vop_t changes made the non-inclusion of vnode.h fatal instead of just sloppy. i386_bitops.h: Changed `extern inline' to `static inline'. `extern inline' is a Linuxism that stops things from compiling without -O. Fixed idempotency identifier. Misc: Added prototypes. Staticized some functions so that prototypes are unnecessary. Added casts. Cleaned up includes.
* Cleaned up some lint and some obvious prototyping errors.dyson1995-11-081-18/+5
|
* Main code for the ext2fs filesystem. Please refer to the COPYRIGHT.INFOdyson1995-11-051-0/+1083
file for GPL restrictions. This code was ported to the BSD platform by Godmar Back <gback@facility.cs.utah.edu> and specifically to FreeBSD by John Dyson. This code is still green and should be used with caution. Additional changes to UFS necessary to make this code work will be commited seperately. Submitted by: Godmar Back <gback@facility.cs.utah.edu> Obtained from: Lites/Mach4
OpenPOWER on IntegriCloud