summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_extattr.c
Commit message (Collapse)AuthorAgeFilesLines
* Drag another softupdates tentacle back into FFS: Now that FFS'sphk2005-02-081-4/+0
| | | | | vop_fsync is separate from the internal use we can do the full job there.
* Implement a kern_pathconf() wrapper for pathconf() which can take thejhb2005-02-071-6/+12
| | | | filename from either a user space or a kernel space pointer.
* - Tweak kern_msgctl() to return a copy of the requested message queue idjhb2005-02-071-122/+96
| | | | | | | | | | | | | | | | | structure in the struct pointed to by the 3rd argument for IPC_STAT and get rid of the 4th argument. The old way returned a pointer into the kernel array that the calling function would then access afterwards without holding the appropriate locks and doing non-lock-safe things like copyout() with the data anyways. This change removes that unsafeness and resulting race conditions as well as simplifying the interface. - Implement kern_foo wrappers for stat(), lstat(), fstat(), statfs(), fstatfs(), and fhstatfs(). Use these wrappers to cut out a lot of code duplication for freebsd4 and netbsd compatability system calls. - Add a new lookup function kern_alternate_path() that looks up a filename under an alternate prefix and determines which filename should be used. This is basically a more general version of linux_emul_convpath() that can be shared by all the ABIs thus allowing for further reduction of code duplication.
* - Correct a typo in kern_rename. tvfslocked should be initialized fromjeff2005-02-021-1/+1
| | | | | | | | tond and not fromnd. This could lead us to leak Giant, or unlock it twice, depending on the filesystems involved. renames within a single filesystem would not have caused any problems. Sponsored by: Isilon Systems, Inc.
* - Or MPSAFE with the correct set of flags in stat(). This affected onlyjeff2005-02-011-1/+1
| | | | | | the LOOKUP_SHARED case. Spotted by: jhb
* Don't use VOP_GETVOBJECT, use vp->v_object directly.phk2005-01-251-5/+4
|
* Don't call VOP_CREATEVOBJECT(), it's the responsibility of thephk2005-01-241-13/+1
| | | | filesystem which owns the vnode.
* - Change all vfs syscalls to use VFS_LOCK_GIANT(), and MPSAFE nds.jeff2005-01-241-100/+266
| | | | | | | - Move Giant acquisition into the few vfs syscalls that weren't already directly acquiring it. Sponsored By: Isilon Systems, Inc.
* Ditch vfs_object_create() and make the callers call VOP_CREATEVOBJECT()phk2005-01-131-2/+2
| | | | directly.
* Remove the unused credential argument from VOP_FSYNC() and VFS_SYNC().phk2005-01-111-3/+2
| | | | | | | | | | | | | | | | | | I'm not sure why a credential was added to these in the first place, it is not used anywhere and it doesn't make much sense: The credentials for syncing a file (ability to write to the file) should be checked at the system call level. Credentials for syncing one or more filesystems ("none") should be checked at the system call level as well. If the filesystem implementation needs a particular credential to carry out the syncing it would logically have to the cached mount credential, or a credential cached along with any delayed write data. Discussed with: rwatson
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Eliminate pointless goto.phk2004-11-161-3/+5
|
* Forgot to remove now unused variable in last commit.phk2004-11-151-1/+0
|
* It is not necessary to hold vn_start_write/vn_finished_write around VOP_REVOKE.phk2004-11-151-3/+0
|
* Next FILEDESC_LOCK properly around FILE_LOCKphk2004-11-151-2/+2
|
* Introduce an alias for FILEDESC_{UN}LOCK() with the suffix _FAST.phk2004-11-131-14/+14
| | | | | | | | Use this in all the places where sleeping with the lock held is not an issue. The distinction will become significant once we finalize the exact lock-type to use for this kind of case.
* Introduce fdclose() which will clean an entry in a filedesc.phk2004-11-071-27/+4
| | | | | | Replace homerolled versions with call to fdclose(). Make fdunused() static to kern_descrip.c
* Rename suser_cred()'s PRISON_ROOT flag to SUSER_ALLOWJAIL. This iscperciva2004-07-261-5/+5
| | | | | | | | | | | somewhat clearer, but more importantly allows for a consistent naming scheme for suser_cred flags. The old name is still defined, but will be removed in a few days (unless I hear any complaints...) Discussed with: rwatson, scottl Requested by: jhb
* Make VFS_ROOT() and vflush() take a thread argument.alfred2004-07-121-1/+1
| | | | | | This is to allow filesystems to decide based on the passed thread which vnode to return. Several filesystems used curthread, they now use the passed thread.
* Don't cuddle else's so much as we removed additional parts of eachrwatson2004-06-241-8/+4
| | | | block.
* Remove temporary API bandage that allowed applications speaking therwatson2004-06-241-9/+0
| | | | | | older API to list attributes on a file (zero-length attribute name) to function. extattr_list_*() are now the only available APIs to use when listing attributes.
* Acquire Giant in link() so that the system call can be markedrwatson2004-06-221-1/+5
| | | | | | MPSAFE. Don't want to acquire Giant in kern_link() sync linux compat code performs actions requiring Giant prior to calling kern_link().
* Acquire Giant in link() so that we can mark it as MSTD inrwatson2004-06-221-1/+5
| | | | | | syscalls.master. Don't want to do it in kern_link() since the Linux emulation code calls kern_link() after performing other actions requiring Giant.
* Only initialize f_data and f_ops if nobody else did so already.phk2004-06-191-2/+4
|
* Deorbit COMPAT_SUNOS.phk2004-06-111-5/+5
| | | | | We inherited this from the sparc32 port of BSD4.4-Lite1. We have neither a sparc32 port nor a SunOS4.x compatibility desire these days.
* Remove unused code.pjd2004-06-071-6/+1
| | | | Submitted by: Bjoern A. Zeeb
* Remove a stale comment.tjr2004-06-041-4/+0
|
* Eliminate a memory leak in kern_symlink() that could occur iftjr2004-05-111-1/+1
| | | | vn_start_write() failed.
* Always use nd.ni_vp->v_mount as an argument for VFS_QUOTACTL(), just likepjd2004-04-261-5/+4
| | | | | | in RELENG_4. Pointed out by: Alex Lyashkov <umka@sevinter.net>
* Look out! vn_start_write() is able to return 0 and NULL 'mp'.pjd2004-04-221-0/+2
| | | | Submitted by: Alex Lyashkov <shadow@psoft.net>
* Removed some less than useful comments:bde2004-04-061-68/+0
| | | | | | | | | - don't say what a small subset of the options includes are for. - don't mark up functions which use all their args with /* ARGSUSED */. The markup should have been removed when the unused retval parameter was removed. - don't comment on what routine suser() checks do. Removed nearby excessive vertical whitespace.
* Remove advertising clause from University of California Regent's license,imp2004-04-051-4/+0
| | | | | | per letter dated July 22, 1999. Approved by: core
* Add lgetfh(2) which is like getfh(2) but doesn't follow symlinks.dfr2004-04-051-0/+38
|
* Nudge Giant as far as I can into kern_open(). Mark open() as MPSAFE.dwmalone2004-03-161-9/+11
| | | | | | | | Use kern_open() to implement creat() rather than taking the long route through open(). Mark creat as MPSAFE. While I'm at it, mark nosys() (syscall 0) as MPSAFE, for all the difference it will make.
* Add two new sysctls:pjd2004-03-081-2/+46
| | | | | | | | | | | - security.bsd.hardlink_check_uid, when set, means, that unprivileged users are not permitted to create hard links to files not owned by them, - security.bsd.hardlink_check_gid, when set, means, that unprivileged users are not permitted to create hard links to files owned by group they don't belong to. OK'ed by: rwatson
* Correct a comment.dwmalone2004-02-171-1/+1
| | | | Reviewed by: alfred, tanimura
* By default, when a process in jail calls getfsstat(), only return therwatson2004-02-141-0/+8
| | | | | | | | data for the file system on which the jail's root vnode is located. Previous behavior (show data for all mountpoints) can be restored by setting security.jail.getfsstatroot_only to 0. Note: this also has the effect of hiding other mounts inside a jail, such as /dev, /tmp, and /proc, but errs on the side of leaking less information.
* New file descriptor allocation code, derived from similar code introduceddes2004-01-151-0/+3
| | | | | | | | | | | in OpenBSD by Niels Provos. The patch introduces a bitmap of allocated file descriptors which is used to locate available descriptors when a new one is needed. It also moves the task of growing the file descriptor table out of fdalloc(), reducing complexity in both fdalloc() and do_dup(). Debts of gratitude are owed to tjr@ (who provided the original patch on which this work is based), grog@ (for the gdb(4) man page) and rwatson@ (for assistance with pxeboot(8)).
* Mechanical whitespace cleanup; parenthesize return values; other minordes2004-01-111-30/+36
| | | | style nits. The #ifdefs in this file give me a headache...
* Document that when we are addressing an open()/close() race, the reasonrwatson2003-12-241-0/+2
| | | | | we call vn_close() manually rather than letting fdrop() take care of it is that we haven't yet hooked up the various 'struct file' fields.
* Update the statfs structure with 64-bit fields to allowmckusick2003-11-121-13/+296
| | | | | | | | | | | | | | | | | accurate reporting of multi-terabyte filesystem sizes. You should build and boot a new kernel BEFORE doing a `make world' as the new kernel will know about binaries using the old statfs structure, but an old kernel will not know about the new system calls that support the new statfs structure. Running an old kernel after a `make world' will cause programs such as `df' that do a statfs system call to fail with a bad system call. Reviewed by: Bruce Evans <bde@zeta.org.au> Reviewed by: Tim Robbins <tjr@freebsd.org> Reviewed by: Julian Elischer <julian@elischer.org> Reviewed by: the hoards of <arch@freebsd.org> Sponsored by: DARPA & NAI Labs.
* falloc allocates a file structure and adds it to the file descriptordwmalone2003-10-191-10/+2
| | | | | | | | | | | | | | | | | | | | | table, acquiring the necessary locks as it works. It usually returns two references to the new descriptor: one in the descriptor table and one via a pointer argument. As falloc releases the FILEDESC lock before returning, there is a potential for a process to close the reference in the file descriptor table before falloc's caller gets to use the file. I don't think this can happen in practice at the moment, because Giant indirectly protects closes. To stop the file being completly closed in this situation, this change makes falloc set the refcount to two when both references are returned. This makes life easier for several of falloc's callers, because the first thing they previously did was grab an extra reference on the file. Reviewed by: iedowse Idea run past: jhb
* Add mac_check_vnode_deleteextattr() and mac_check_vnode_listextattr():rwatson2003-08-211-4/+3
| | | | | | | | | | | explicit access control checks to delete and list extended attributes on a vnode, rather than implicitly combining with the setextattr and getextattr checks. This reflects EA API changes in the kernel made recently, including the move to explicit VOP's for both of these operations. Obtained from: TrustedBSD PRoject Sponsored by: DARPA, Network Associates Laboratories
* td_dupfd just needs to be less than 0, it does not have to hold thejhb2003-08-071-1/+1
| | | | negative value of the index of the new file, so just use -1.
* In the mknod(), mkfifo(), link(), symlink() and undelete() syscalls,iedowse2003-08-051-5/+23
| | | | | | | | | | | | | | use vrele() instead of vput() on the parent directory vnode returned by namei() in the case where it is equal to the target vnode. This handles namei()'s somewhat strange (but documented) behaviour of not locking either vnode when the two vnodes are equal and LOCKPARENT but not LOCKLEAF is specified. Note that since a vnode double-unlock is not currently fatal, these coding errors were effectively harmless. Spotted by: Juergen Hannken-Illjes <hannken@eis.cs.tu-bs.de> Reviewed by: mckusick
* Rename VOP_RMEXTATTR() to VOP_DELETEEXTATTR() for consistency with therwatson2003-07-281-1/+2
| | | | | | | | | | | | kernel ACL interfaces and system call names. Break out UFS2 and FFS extattr delete and list vnode operations from setextattr and getextattr to deleteextattr and listextattr, which cleans up the implementations, and makes the results more readable, and makes the APIs more clear. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Pass the file descriptor index down to vn_open.phk2003-07-271-1/+13
| | | | | If the method vector was replaced and we got the "special return code" smile and trust that whatever happened below DTRT.
* Add fdidx argument to vn_open() and vn_open_cred() and pass -1 throughout.phk2003-07-271-1/+1
|
* Add a "int fd" argument to VOP_OPEN() which in the future willphk2003-07-261-1/+1
| | | | | | | | | contain the filedescriptor number on opens from userland. The index is used rather than a "struct file *" since it conveys a bit more information, which may be useful to in particular fdescfs and /dev/fd/* For now pass -1 all over the place.
* Use the f_vnode field to tell which file descriptors have a vnode.phk2003-07-041-1/+2
|
OpenPOWER on IntegriCloud