summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_extattr.c
Commit message (Collapse)AuthorAgeFilesLines
* Change the way we internally store the mount options tomux2002-06-201-59/+17
| | | | | | | | | | a linked list. This is to allow the merging of the mount options in the MNT_UPDATE case, as the current data structure is unsuitable for this. There are no functional differences in this commit. Reviewed by: phk
* Remove a duplicated vfs_freeopts() that I introduced in lastmux2002-05-281-2/+1
| | | | revision.
* Style nit, no functional changes.mux2002-05-231-0/+1
|
* Slightly change the way we pass mount options to the filesystemmux2002-05-231-6/+12
| | | | | | VFS_NMOUNT operations. Reviewed by: phk
* Change two vput() that should have been vrele().mux2002-05-201-2/+2
| | | | Submitted by: iedowse
* More s/file system/filesystem/gtrhodes2002-05-161-5/+5
|
* Disable the shared locking namei() code for now. It breaks several stackingjeff2002-05-141-1/+1
| | | | | filesystems. This is on hold until the rest of VFS Locking is reviewed and deemed safe. It can be enabled with 'options LOOKUP_SHARED'.
* Add the lchflags(2) syscall.mux2002-05-051-0/+23
| | | | Reviewed by: rwatson
* Move a KASSERT() in open() prior to unlocking the vnode. It's not safe tojeff2002-05-051-3/+4
| | | | call VOP_GETVOBJECT without a lock.
* Fix a typo.mux2002-05-041-1/+1
| | | | Submitted by: dwmalone
* Slightly restructure extattr_get_vp() so that there's only one entry pointrwatson2002-04-231-8/+15
| | | | | | | to VOP_GETEXTATTR(). This simplifies code flow when inserting MAC hooks. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Improve style consistency of vfs_syscalls.c by converting the style usedrwatson2002-04-201-53/+82
| | | | | | | | | | | | | in various extattr_*() calls to match the rest of the file. Originally, these bits at the end looked more like style(9). This patch was submitted by green by way of the TrustedBSD MAC tree, and I fixed a few problems with it on the way through. Someone with more time on their hands should convert the entire file to style(9); this commit is for diff reduction purposes. Submitted by: green Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* The recent NFS forced unmount improvements introduced a side-effectiedowse2002-04-171-2/+9
| | | | | | | | | | | | | | | | | where some client operations might be unexpectedly cancelled during an unsuccessful non-forced unmount attempt. This causes problems for amd(8), because it periodically attempts a non-forced unmount to check if the filesystem is still in use. Fix this by adding a new mountpoint flag MNTK_UNMOUNTF that is set only during the operation of a forced unmount. Use this instead of MNTK_UNMOUNT to trigger the cancellation of hung NFS operations. Also correct a problem where dounmount() might inadvertently clear the MNTK_UNMOUNT flag. Reported by: simokawa MFC after: 1 week
* Turn #ifdef LOOKUP_SHARED into #ifndef LOOKUP_EXCLUSIVE to enable thisjeff2002-04-091-1/+1
| | | | | | | | | behavior by default. Also, change the options line to reflect this. If there are no problems reported this will become the only behavior and the knob will be removed in a month or so. Demanded by: obrien
* The fourth parameter to copystr() is a size_t, not an int.mux2002-04-081-1/+2
| | | | Approved by: peter
* o Change kernel_vmount() interface to be more convenient : pass twomux2002-04-071-30/+34
| | | | | | | | separate strings instead of passing "foo=bar". o Don't forget to clear the VMOUNT flag on the vnode when vfs_nmount() fails because the fs doesn't implement VFS_NMOUNT (and in vfs_mount() when the fs doesn't implement VFS_MOUNT) ; also decrement the vfs refcount in the !MNT_UPDATE case.
* Add two forgotten vfs_unbusy() calls, in vfs_mount() and vfs_nmount().mux2002-04-031-0/+2
| | | | Reviewed by: phk
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-011-25/+25
| | | | | | | | | | | | 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@
* - Properly sync vfs_nmount() with changes that have be already donemux2002-03-281-57/+39
| | | | | | | | | | | | | | in vfs_mount(), in particular revisions 1.215, 1.227 and 1.240. - flag2 is a low quality variable name, change it to kern_flag. - strncpy NUL-terminates f_fstypename and f_mntonname since the strings have length <= <buffer length> - 1, so the explicit NUL-termination is bogus. - M_ZERO'ing space for fstype and fspath is stupid since we never use the space beyond the end of the string. - Do various style(9) cleanups in both functions. Submitted by: bde Reviewed by: phk
* - Fixup a few style nits:arr2002-03-261-6/+5
| | | | | | | | - return error -> return (error); - move a declaration to the top of the function. - become bug for bug compatible with if (error) lines. Submitted by: bde
* As discussed in -arch, add the new nmount(2) system call and themux2002-03-261-3/+553
| | | | | | | | | | new vfs_getopt()/vfs_copyopt() API. This is intended to be used later, when there will be filesystems implementing the VFS_NMOUNT operation. The mount(2) system call will disappear when all filesystems will be converted to the new API. Documentation will be committed in a while. Reviewed by: phk
* - Recommit the securelevel_gt() calls removed by commits rev. 1.84 ofarr2002-03-251-0/+5
| | | | | | | | kern_linker.c and rev. 1.237 of vfs_syscalls.c since these are not the source of the recent panics occuring around kldloading file system support modules. Requested by: rwatson
* - Back out the commit to make the linker_load_file() securelevel checkarr2002-03-221-5/+0
| | | | | | made aware in jail environments. Supposedly something is broken, so this should be backed out until further investigation proves otherwise, or a proper fix can be provided.
* - Fix a logic error in checking the securelevel that was introduced in thearr2002-03-211-1/+1
| | | | | | previous commit. Pointy hats to: arr, rwatson
* - Change a check of securelevel to securelevel_gt() call in order to helparr2002-03-201-0/+5
| | | | | | | | | against users within a jail attempting to load kernel modules. - Add a check of securelevel_gt() to vfs_mount() in order to chop some low hanging fruit for the repair of securelevel checking of linking and unlinking files from within jails. There is more to be done here. Reviewed by: rwatson
* Remove references to vm_zone.h and switch over to the new uma API.jeff2002-03-201-3/+3
| | | | | Also, remove maxsockets. If you look carefully you'll notice that the old zone allocator never honored this anyway.
* Remove __P.alfred2002-03-191-12/+12
|
* Close a race when vfs_syscalls.c:checkdirs() runs.alfred2002-03-191-7/+12
| | | | | To do this protect the filedesc pointer in the proc with PROC_LOCK in both checkdirs() and kern_descrip.c:fdfree().
* This patch adds the "LOCKSHARED" option to namei which causes it to only ↵jeff2002-03-121-0/+5
| | | | | | | | | | | | | | | | acquire shared locks on leafs. The stat() and open() calls have been changed to make use of this new functionality. Using shared locks in these cases is sufficient and can significantly reduce their latency if IO is pending to these vnodes. Also, this reduces the number of exclusive locks that are floating around in the system, which helps reduce the number of deadlocks that occur. A new kernel option "LOOKUP_SHARED" has been added. It defaults to off so this patch can be turned on for testing, and should eventually go away once it is proven to be stable. I have personally been running this patch for over a year now, so it is believed to be fully stable. Reviewed by: jake, obrien Approved by: jake
* Three p_ucred -> td_ucred's missed in jhb's earlier pass; all appear torwatson2002-03-051-2/+2
| | | | be safe.
* The change from td->td_proc->p_ucred to td->td_ucred has shortened somerwatson2002-03-051-4/+3
| | | | lines: more agressively line wrap under those circumstances.
* - Change namei() to use td_ucred instead of p_ucred.jhb2002-02-271-3/+3
| | | | | - Change the hack in access() that uses a temporary credential to set td_ucred to the temp cred instead of p_ucred.
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-271-60/+60
| | | | reference.
* Make sure to hold vnode lock when calling into VOP_GETATTR().rwatson2002-02-101-0/+2
| | | | Discussed with: mckusick, phk
* Make sure to grab vnode lock on a vnode before calling VOP_GETATTR()rwatson2002-02-101-5/+9
| | | | | | | | to perform an ownership test in revoke(). This is also required for MAC hooks so that the vnode lock is held during a call to the MAC framework. Release the lock before calling VOP_REVOKE(). Discussed with: phk, mckusick
* Remove a stray 'const' that slept into extattr_set_vp(), and couldrwatson2002-02-101-1/+1
| | | | result in compiler warnings.
* Part I: Update extended attribute API and ABI:rwatson2002-02-101-81/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* o Merge various recent fixes from the MAC branch relating to extattrctl():rwatson2002-02-081-6/+10
| | | | | | | | | | | | | | | - Fix null-pointer dereference introduced when snapshotting was introduced. This occured because unlike the previous code, vn_start_write() doesn't always return a non-NULL mp, as filesystems may not support the VOP_GETWRITEMOUNT() call. For now, rely on two pointers, so that vn_finished_write() works properly. - Fix locking problems on exit, introduced at some past time, some when snapshots came in, where a vnode might not be unlocked before being vrele'd in various error situations. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Pre-KSE/M3 commit.julian2002-02-071-2/+0
| | | | | | | | | | this is a low-functionality change that changes the kernel to access the main thread of a process via the linked list of threads rather than assuming that it is embedded in the process. It IS still embeded there but remove all teh code that assumes that in preparation for the next commit which will actually move it out. Reviewed by: peter@freebsd.org, gallatin@cs.duke.edu, benno rice,
* Don't recurse on filedesc lock in chroot_refuse_vdir_fds().alfred2002-02-011-8/+9
| | | | Noticed by: Michael Nottebrock <michaelnottebrock@gmx.net>
* Replace ffind_* with fget calls.alfred2002-01-141-4/+3
| | | | | | | | Make fget MPsafe. Make fgetvp and fgetsock use the fget subsystem to reduce code bloat. Push giant down in fpathconf().
* SMP Lock struct file, filedesc and the global file list.alfred2002-01-131-38/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Change dounmount() to return EBUSY in the non-MNT_FORCE case if weiedowse2002-01-101-1/+8
| | | | | | | can't acquire the mnt_lock without blocking. Normally non-forced unmount attempts return EBUSY quickly if any vnodes are active, so this just extends that behaviour to cover the per-mount mnt_lock too.
* Return EBADF in case some vnode field has been reset to a NULL pointer.se2002-01-031-0/+2
| | | | | | | | | | | | (There has been some discussion, whether ENOENT or EBADF is more appropriate. I choose the latter, since the operation is not supported on the file descriptor at that time, even if it was, immediately before.) PR: 32681 Reviewed by: dillon, iedowse, ... Approved by: nectar MFC after: 3 days (pending RE approval)
* Define a new mount flag "MNT_JAILDEVFS"phk2001-11-051-8/+2
| | | | | | Collect the magic combination of flags which can be updated into a macro in sys/mount.h rather than inlining them (twice!) in vfs_syscalls.c
* Add mnt_reservedvnlist so we can MFC to 4.x, in order to make all mountdillon2001-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.
* o Remove the local temporary variable "struct proc *p" from vfs_mount()rwatson2001-11-021-7/+7
| | | | | | | | | in vfs_syscalls.c. Although it did save some indirection, many of those savings will be obscured with the impending commit of suser() changes, and the result is increased code complexity. Also, once p->p_ucred and td->td_ucred are distinguished, this will make vfs_mount() use the correct thread credential, rather than the process credential.
* Argh!phk2001-11-021-21/+0
| | | | | | patch added the nmount at the bottom first time around. Take 3!
* Add empty shell for nmount syscall (take 2!)phk2001-11-021-0/+21
|
* Add nmount() stub function and regenerate the syscall-glue which shouldphk2001-11-021-0/+21
| | | | not need to check in generated files.
OpenPOWER on IntegriCloud