summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_stats.c
Commit message (Collapse)AuthorAgeFilesLines
* Prevent leaking of fsid to non-root users in linux_statfs and linux_fstatfs.anholt2003-11-051-4/+14
| | | | | | | | Matches native syscalls now. PR: kern/58793 Submitted by: David P. Reese Jr. <daver@gomerbud.com> MFC after: 1 week
* Add a f_vnode field to struct file.phk2003-06-221-1/+1
| | | | | | | | | | | | Several of the subtypes have an associated vnode which is used for stuff like the f*() functions. By giving the vnode a speparate field, a number of checks for the specific subtype can be replaced simply with a check for f_vnode != NULL, and we can later free f_data up to subtype specific use. At this point in time, f_data still points to the vnode, so any code I might have overlooked will still work.
* Use __FBSDID().obrien2003-06-101-2/+3
|
* Initialize tbuf in newstat_copyout() too.mbr2003-04-291-0/+1
| | | | Reviewed by: phk
* Do the same thing for stat64_copyout() as we alreadymbr2003-04-291-0/+19
| | | | | | | | | | | | do for newstat_copyout(). Lie about disk drives which are character devices in FreeBSD but block devices under Linux. PR: 37227 Submitted by: Vladimir B. Grebenschikov <vova@sw.ru> Reviewed by: phk MFC after: 2 weeks
* Use td->td_ucred instead of td->td_proc->p_ucred.jhb2003-03-201-4/+3
|
* Clean up whitespace and remove register keyword.des2003-03-031-6/+6
|
* More caddr_t removal, in conjunction with copy{in,out}(9) this time.des2003-03-031-4/+2
| | | | Also clean up some egregious casts and incorrect use of sizeof.
* Bow to the whining masses and change a union back into void *. Retaindillon2003-01-131-1/+1
| | | | | removal of unnecessary casts and throw in some minor cleanups to see if anyone complains, just for the hell of it.
* Change struct file f_data to un_data, a union of the correct structdillon2003-01-121-1/+1
| | | | | | | | | | pointer types, and remove a huge number of casts from code using it. Change struct xfile xf_data to xun_data (ABI is still compatible). If we need to add a #define for f_data and xf_data we can, but I don't think it will be necessary. There are no operational changes in this commit.
* Include <sys/malloc.h> instead of depending on namespace pollution 2bde2002-09-051-1/+2
| | | | | | layers deep in <sys/proc.h> or <sys/vnode.h>. Removed unused includes. Sorted includes.
* Use the new kern_* functions to avoid the need to store argumentsiedowse2002-09-011-28/+27
| | | | | | | | in the stack gap. This converts most VFS and signal related system calls, as well as select(). Discussed on: -arch Approved by: marcel
* Make similar changes to fo_stat() and fo_poll() as made earlier torwatson2002-08-161-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fo_read() and fo_write(): explicitly use the cred argument to fo_poll() as "active_cred" using the passed file descriptor's f_cred reference to provide access to the file credential. Add an active_cred argument to fo_stat() so that implementers have access to the active credential as well as the file credential. Generally modify callers of fo_stat() to pass in td->td_ucred rather than fp->f_cred, which was redundantly provided via the fp argument. This set of modifications also permits threads to perform these operations on behalf of another thread without modifying their credential. Trickle this change down into fo_stat/poll() implementations: - badfo_poll(), badfo_stat(): modify/add arguments. - kqueue_poll(), kqueue_stat(): modify arguments. - pipe_poll(), pipe_stat(): modify/add arguments, pass active_cred to MAC checks rather than td->td_ucred. - soo_poll(), soo_stat(): modify/add arguments, pass fp->f_cred rather than cred to pru_sopoll() to maintain current semantics. - sopoll(): moidfy arguments. - vn_poll(), vn_statfile(): modify/add arguments, pass new arguments to vn_stat(). Pass active_cred to MAC and fp->f_cred to VOP_POLL() to maintian current semantics. - vn_close(): rename cred to file_cred to reflect reality while I'm here. - vn_stat(): Add active_cred and file_cred arguments to vn_stat() and consumers so that this distinction is maintained at the VFS as well as 'struct file' layer. Pass active_cred instead of td->td_ucred to MAC and to VOP_GETATTR() to maintain current semantics. - fifofs: modify the creation of a "filetemp" so that the file credential is properly initialized and can be used in the socket code if desired. Pass ap->a_td->td_ucred as the active credential to soo_poll(). If we teach the vnop interface about the distinction between file and active credentials, we would use the active credential here. Note that current inconsistent passing of active_cred vs. file_cred to VOP's is maintained. It's not clear why GETATTR would be authorized using active_cred while POLL would be authorized using file_cred at the file system level. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Another fix that wasn't pulled in from the MAC branch: therwatson2002-08-121-1/+2
| | | | | | | | struct mount is not cached as *mp at this point, so use vp->v_mount directly, following the check that it's non-NULL. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Introduce support for Mandatory Access Control and extensiblerwatson2002-08-011-0/+20
| | | | | | | | | | | | kernel access control. Invoke appropriate MAC entry points for a number of VFS-related operations in the Linux ABI module. In particular, handle uselib in a manner similar to open() (more work is probably needed here), as well as handle statfs(), and linux readdir()-like calls. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Fix typo in the BSD copyright: s/withough/without/schweikh2002-06-021-1/+1
| | | | | Spotted and suggested by: des MFC after: 3 weeks
* Replace ffind_* with fget calls.alfred2002-01-141-3/+2
| | | | | | | | 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-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix abuse of vtagtype. In addition, after this the linux programs will besobomax2001-09-191-32/+20
| | | | | | | able correctly distinguish ext2fs from the ufs filesystem (previously ext2fs was indistinguishable from the ufs). Reviewed by: phk, marcel
* KSE Milestone 2julian2001-09-121-31/+31
| | | | | | | | | | | | | | 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
* Round of cleanups and enhancements. These include (in random order):marcel2001-09-081-133/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Introduce private types for use in linux syscalls for two reasons: 1. establish type independence for ease in porting and, 2. provide a visual queue as to which syscalls have proper prototypes to further cleanup the i386/alpha split. Linuxulator types are prefixed by 'l_'. void and char have not been "virtualized". o Provide dummy functions for all syscalls and remove dummy functions or implementations of truely obsolete syscalls. o Sanitize the shm*, sem* and msg* syscalls. o Make a first attempt to implement the linux_sysctl syscall. At this time it only returns one MIB (KERN_VERSION), but most importantly, it tells us when we need to add additional sysctls :-) o Bump the kenel version up to 2.4.2 (this is not the same as the KERN_VERSION MIB, BTW). o Implement new syscalls, of which most are specific to i386. Our syscall table is now up to date with Linux 2.4.2. Some highlights: - Implement the 32-bit uid_t and gid_t bases syscalls. - Implement a couple of 64-bit file size/offset bases syscalls. o Fix or improve numerous syscalls and prototypes. o Reduce style(9) violations while I'm here. Especially indentation inconsistencies within the same file are addressed. Re-indenting did not obfuscate actual changes to the extend that it could not be combined. NOTE: I spend some time testing these changes and found that if there were regressions, they were not caused by these changes AFAICT. It was observed that installing a RH 7.1 runtime environment did make matters worse. Hangs and/or reboots have been observed with and without these changes, so when it failed to make life better in cases it doesn't look like it made it worse.
* S_IFCHR is not a bit mask, it's just a value in a field. The correctpaul2001-06-041-1/+1
| | | | | | way to clear that field is to use S_IFMT. Pointed out by BDE.
* Remove vestiges of MFS.ru2001-06-011-1/+1
|
* Remove MFSphk2001-05-291-2/+0
|
* - sys/n[tw]fs moved to sys/fs/n[tw]fsru2001-05-261-1/+1
| | | | - /usr/include/n[tw]fs moved to /usr/include/fs/n[tw]fs
* A bogus check for a char device also matched symbolic links.paul2001-04-251-1/+1
| | | | | | Replace it with a correct check using S_ISCHR() Symbolic links will now work again in linux compatibility.
* Allow debugging output to be controlled on a per-syscall granularity.jlemon2001-02-161-8/+12
| | | | | | Also clean up debugging output in a slightly more uniform fashion. The default behavior remains the same (all debugging output is turned on)
* Instead of hard coding the major numbers for IDE and SCSI disksjoe2001-01-141-10/+17
| | | | look in the device's cdevsw for the D_DISK flag.
* Map FreeBSD character device hard disks to Linux block device hard disks.paul2000-12-291-0/+14
| | | | This fixes the problem with VMWARE not being able to use raw disks.
* Don't auto-generate the syscalls.marcel2000-12-031-4/+0
|
* Revert auto-generation. The Alpha port is broken.marcel2000-11-101-0/+4
| | | | Syncing with it is wrong.
* Sync with Alpha:marcel2000-11-091-4/+0
| | | | | Do not use sysent.c, proto.h and syscall.h in source tree; use auto-generated versions.
* Fix linux_ustat syscall. We only have cdevs now, so lookingmarcel2000-11-021-2/+2
| | | | | | | | for a block device isn't that useful anymore. Reported by: Wesley Morgan <morganw@chemicals.tacorp.com> Submitted by: gallatin Acknowledged by: phk
* The MI/MD split wasn't perfect and the MI files need hacks for theobrien2000-11-011-9/+32
| | | | | | AlphaLinux compat bits. This will be better cleaned up soon. Agreed to what ever was necessary by: marcel
* Update include directives.marcel2000-08-221-4/+3
|
* Remove unneeded #include <vm/vm_zone.h>phk2000-04-301-1/+0
| | | | Generated by: src/tools/tools/kerninclude
* Convert the filesystem type returned in struct statfs by syscallsmarcel2000-01-081-2/+51
| | | | | | | | linux_statfs and linux_fstatfs. Linux binaries testing this expect the filesystem's magic number and not our vnode's tag. PR: 15425 Tested by: Vladimir N. Silyaev <vsilyaev@mindspring.com>
* Introduce NDFREE (and remove VOP_ABORTOP)eivind1999-12-151-0/+5
|
* Remove unused includes.marcel1999-12-101-2/+0
| | | | Found by: phk-scan
* Implement linux_ustat.marcel1999-11-271-3/+56
| | | | Reviewed by: bde
* Use fo_stat() rather than Yet Another duplication of kern_descrip.c's statpeter1999-11-081-15/+1
| | | | code.
* Fix a braino: Linux minor device numbers are 8 bits wide and not 10.marcel1999-08-291-1/+1
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Fix linux_newlstat in that it doesn't return the attributes of its containingmarcel1999-08-251-117/+104
| | | | | | | | directory. Also, update arguments of NDINIT for both newstat and newlstat. While I'm at it, fix style bugs in all {s|ls|fs}tat syscalls. Reported by: bde
* Divorce "dev_t" from the "major|minor" bitmap, which is now calledphk1999-05-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | udev_t in the kernel but still called dev_t in userland. Provide functions to manipulate both types: major() umajor() minor() uminor() makedev() umakedev() dev2udev() udev2dev() For now they're functions, they will become in-line functions after one of the next two steps in this process. Return major/minor/makedev to macro-hood for userland. Register a name in cdevsw[] for the "filedescriptor" driver. In the kernel the udev_t appears in places where we have the major/minor number combination, (ie: a potential device: we may not have the driver nor the device), like in inodes, vattr, cdevsw registration and so on, whereas the dev_t appears where we carry around a reference to a actual device. In the future the cdevsw and the aliased-from vnode will be hung directly from the dev_t, along with up to two softc pointers for the device driver and a few houskeeping bits. This will essentially replace the current "alias" check code (same buck, bigger bang). A little stunt has been provided to try to catch places where the wrong type is being used (dev_t vs udev_t), if you see something not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if it makes a difference. If it does, please try to track it down (many hands make light work) or at least try to reproduce it as simply as possible, and describe how to do that. Without DEVT_FASCIST I belive this patch is a no-op. Stylistic/posixoid comments about the userland view of the <sys/*.h> files welcome now, from userland they now contain the end result. Next planned step: make all dev_t's refer to the same devsw[] which means convert BLK's to CHR's at the perimeter of the vnodes and other places where they enter the game (bootdev, mknod, sysctl).
* Yet another place which knew too much. Still not sure how muchphk1999-05-091-2/+2
| | | | good this does in the end.
* Fix up a few easy 'assignment used as truth value' and 'suggest parenspeter1999-05-061-5/+9
| | | | | around && within ||' type warnings. I'm pretty sure I have not masked any problems here, I've committed real problem fixes seperately.
* Move the "retval" (3rd) parameter from all syscall functions and putphk1997-11-061-7/+6
| | | | | | | | | | | | it in struct proc instead. This fixes a boatload of compiler warning, and removes a lot of cruft from the sources. I have not removed the /*ARGSUSED*/, they will require some looking at. libkvm, ps and other userland struct proc frobbing programs will need recompiled.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
OpenPOWER on IntegriCloud