aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linux/linux_stats.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC Rev 1.75Jeff Roberson2006-03-131-48/+0
| | | | | | | | | | VFS SMP fixes, stack api, softupdates fixes. Sponsored by: Isilon Systems, Inc. Approved by: re (scottl) Notes: svn path=/stable/6/; revision=156620
* Actually only protect mount-point if security.jail.enforce_statfs is set to 2.Pawel Jakub Dawidek2005-06-231-3/+0
| | | | | | | | | | If we don't return statistics about requested file systems, system tools may not work correctly or at all. Approved by: re (scottl) Notes: svn path=/head/; revision=147559
* Rename sysctl security.jail.getfsstatroot_only to security.jail.enforce_statfsPawel Jakub Dawidek2005-06-091-2/+3
| | | | | | | | | | | | | | | | | | and extend its functionality: value policy 0 show all mount-points without any restrictions 1 show only mount-points below jail's chroot and show only part of the mount-point's path (if jail's chroot directory is /jails/foo and mount-point is /jails/foo/usr/home only /usr/home will be shown) 2 show only mount-point where jail's chroot directory is placed. Default value is 2. Discussed with: rwatson Notes: svn path=/head/; revision=147185
* Remove (now) unused argument 'td' from bsd_to_linux_statfs().Pawel Jakub Dawidek2005-05-271-4/+3
| | | | Notes: svn path=/head/; revision=146695
* The code is under '#ifdef not_that_way', but anyway:Pawel Jakub Dawidek2005-05-221-0/+3
| | | | | | | - Add missing prison_check_mount() check. Notes: svn path=/head/; revision=146505
* If we need to hide fsid, kern_statfs()/kern_fstatfs() will do it for us,Pawel Jakub Dawidek2005-05-221-7/+2
| | | | | | | | | | | | so do not duplicate the code in cvtstatfs(). Note, that we now need to clear fsid in freebsd4_getfsstat(). This moves all security related checks from functions like cvtstatfs() and will allow to add more security related stuff (like statfs(2), etc. protection for jails) a bit easier. Notes: svn path=/head/; revision=146502
* Neuter the duplicated disk-device magic code for now. Somebody withPoul-Henning Kamp2005-03-151-41/+32
| | | | | | | serious linux-clue is necessary to fix this properly. Notes: svn path=/head/; revision=143635
* Neuter linux_ustat() until somebody finds time to try to fix it.Poul-Henning Kamp2005-02-221-4/+9
| | | | | | | | | | | | | | | | | | The fundamental problem is that we get only the lower 8 bits of the minor device number so there is no guarantee that we can actually find the disk device in question at all. This was probably a bigger issue pre-GEOM where the upper bits signaled which slice were in use. The secondary problem is how we get from (partial) dev_t to vnode. The correct implementation will involve traversing the mount list looking for a perfect match or a possible match (for truncated minor). Notes: svn path=/head/; revision=142220
* - Use kern_{l,f,}stat() and kern_{f,}statfs() functions rather thanJohn Baldwin2005-02-071-132/+39
| | | | | | | | | duplicating the contents of the same functions inline. - Consolidate common code to convert a BSD statfs struct to a Linux struct into a static worker function. Notes: svn path=/head/; revision=141473
* Match the LINUX32's style with existing styleDavid E. O'Brien2005-01-141-6/+6
| | | | | | | | | Submitted by: Jung-uk Kim <jkim@niksun.com> Use positive, not negative logic. Notes: svn path=/head/; revision=140214
* Hold thread reference while frobbing cdevsw.Poul-Henning Kamp2004-09-241-18/+24
| | | | Notes: svn path=/head/; revision=135715
* Changes to MI Linux emulation code necessary to run 32-bit Linux binariesTim J. Robbins2004-08-161-2/+9
| | | | | | | | | | | | | | | | | | on AMD64, and the general case where the emulated platform has different size pointers than we use natively: - declare certain structure members as l_uintptr_t and use the new PTRIN and PTROUT macros to convert to and from native pointers. - declare some structures __packed on amd64 when the layout would differ from that used on i386. - include <machine/../linux32/linux.h> instead of <machine/../linux/linux.h> if compiling with COMPAT_LINUX32. This will need to be revisited before 32-bit and 64-bit Linux emulation support can coexist in the same kernel. - other small scattered changes. This should be a no-op on i386 and Alpha. Notes: svn path=/head/; revision=133816
* Add XXX comment about findcdev() misuse.Poul-Henning Kamp2004-08-141-0/+6
| | | | Notes: svn path=/head/; revision=133716
* Second half of the dev_t cleanup.Poul-Henning Kamp2004-06-171-4/+4
| | | | | | | | | | | | | | The big lines are: NODEV -> NULL NOUDEV -> NODEV udev_t -> dev_t udev2dev() -> findcdev() Various minor adjustments including handling of userland access to kernel space struct cdev etc. Notes: svn path=/head/; revision=130640
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-161-6/+6
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* Remove unused second arg to vfinddev().Poul-Henning Kamp2004-03-111-1/+1
| | | | | | | Don't call addaliasu() on VBLK nodes. Notes: svn path=/head/; revision=126851
* Device megapatch 5/6:Poul-Henning Kamp2004-02-211-4/+4
| | | | | | | | | | | | | | | Remove the unused second argument from udev2dev(). Convert all remaining users of makedev() to use udev2dev(). The semantic difference is that udev2dev() will only locate a pre-existing dev_t, it will not line makedev() create a new one. Apart from the tiny well controlled windown in D_PSEUDO drivers, there should no longer be any "anonymous" dev_t's in the system now, only dev_t's created with make_dev() and make_dev_alias() Notes: svn path=/head/; revision=126081
* Prevent leaking of fsid to non-root users in linux_statfs and linux_fstatfs.Eric 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 Notes: svn path=/head/; revision=122153
* Add a f_vnode field to struct file.Poul-Henning Kamp2003-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. Notes: svn path=/head/; revision=116678
* Use __FBSDID().David E. O'Brien2003-06-101-2/+3
| | | | Notes: svn path=/head/; revision=116173
* Initialize tbuf in newstat_copyout() too.Martin Blapp2003-04-291-0/+1
| | | | | | | Reviewed by: phk Notes: svn path=/head/; revision=114230
* Do the same thing for stat64_copyout() as we alreadyMartin Blapp2003-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 Notes: svn path=/head/; revision=114214
* Use td->td_ucred instead of td->td_proc->p_ucred.John Baldwin2003-03-201-4/+3
| | | | Notes: svn path=/head/; revision=112451
* Clean up whitespace and remove register keyword.Dag-Erling Smørgrav2003-03-031-6/+6
| | | | Notes: svn path=/head/; revision=111798
* More caddr_t removal, in conjunction with copy{in,out}(9) this time.Dag-Erling Smørgrav2003-03-031-4/+2
| | | | | | | Also clean up some egregious casts and incorrect use of sizeof. Notes: svn path=/head/; revision=111797
* Bow to the whining masses and change a union back into void *. RetainMatthew Dillon2003-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. Notes: svn path=/head/; revision=109153
* Change struct file f_data to un_data, a union of the correct structMatthew Dillon2003-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. Notes: svn path=/head/; revision=109123
* Include <sys/malloc.h> instead of depending on namespace pollution 2Bruce Evans2002-09-051-1/+2
| | | | | | | | | layers deep in <sys/proc.h> or <sys/vnode.h>. Removed unused includes. Sorted includes. Notes: svn path=/head/; revision=102954
* Use the new kern_* functions to avoid the need to store argumentsIan Dowse2002-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 Notes: svn path=/head/; revision=102814
* Make similar changes to fo_stat() and fo_poll() as made earlier toRobert Watson2002-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 Notes: svn path=/head/; revision=101983
* Another fix that wasn't pulled in from the MAC branch: theRobert Watson2002-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 Notes: svn path=/head/; revision=101707
* Introduce support for Mandatory Access Control and extensibleRobert Watson2002-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 Notes: svn path=/head/; revision=101189
* Fix typo in the BSD copyright: s/withough/without/Jens Schweikhardt2002-06-021-1/+1
| | | | | | | | Spotted and suggested by: des MFC after: 3 weeks Notes: svn path=/head/; revision=97748
* Replace ffind_* with fget calls.Alfred Perlstein2002-01-141-3/+2
| | | | | | | | | | | Make fget MPsafe. Make fgetvp and fgetsock use the fget subsystem to reduce code bloat. Push giant down in fpathconf(). Notes: svn path=/head/; revision=89319
* SMP Lock struct file, filedesc and the global file list.Alfred Perlstein2002-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. Notes: svn path=/head/; revision=89306
* Fix abuse of vtagtype. In addition, after this the linux programs will beMaxim Sobolev2001-09-191-32/+20
| | | | | | | | | | able correctly distinguish ext2fs from the ufs filesystem (previously ext2fs was indistinguishable from the ufs). Reviewed by: phk, marcel Notes: svn path=/head/; revision=83667
* KSE Milestone 2Julian Elischer2001-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 Notes: svn path=/head/; revision=83366
* Round of cleanups and enhancements. These include (in random order):Marcel Moolenaar2001-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. Notes: svn path=/head/; revision=83221
* S_IFCHR is not a bit mask, it's just a value in a field. The correctPaul Richards2001-06-041-1/+1
| | | | | | | | | way to clear that field is to use S_IFMT. Pointed out by BDE. Notes: svn path=/head/; revision=77675
* Remove vestiges of MFS.Ruslan Ermilov2001-06-011-1/+1
| | | | Notes: svn path=/head/; revision=77575
* Remove MFSPoul-Henning Kamp2001-05-291-2/+0
| | | | Notes: svn path=/head/; revision=77435
* - sys/n[tw]fs moved to sys/fs/n[tw]fsRuslan Ermilov2001-05-261-1/+1
| | | | | | | - /usr/include/n[tw]fs moved to /usr/include/fs/n[tw]fs Notes: svn path=/head/; revision=77223
* A bogus check for a char device also matched symbolic links.Paul Richards2001-04-251-1/+1
| | | | | | | | | Replace it with a correct check using S_ISCHR() Symbolic links will now work again in linux compatibility. Notes: svn path=/head/; revision=75988
* Allow debugging output to be controlled on a per-syscall granularity.Jonathan Lemon2001-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) Notes: svn path=/head/; revision=72543
* Instead of hard coding the major numbers for IDE and SCSI disksJosef Karthauser2001-01-141-10/+17
| | | | | | | look in the device's cdevsw for the D_DISK flag. Notes: svn path=/head/; revision=71048
* Map FreeBSD character device hard disks to Linux block device hard disks.Paul Richards2000-12-291-0/+14
| | | | | | | This fixes the problem with VMWARE not being able to use raw disks. Notes: svn path=/head/; revision=70458
* Don't auto-generate the syscalls.Marcel Moolenaar2000-12-031-4/+0
| | | | Notes: svn path=/head/; revision=69539
* Revert auto-generation. The Alpha port is broken.Marcel Moolenaar2000-11-101-0/+4
| | | | | | | Syncing with it is wrong. Notes: svn path=/head/; revision=68583
* Sync with Alpha:Marcel Moolenaar2000-11-091-4/+0
| | | | | | | | Do not use sysent.c, proto.h and syscall.h in source tree; use auto-generated versions. Notes: svn path=/head/; revision=68519
* Fix linux_ustat syscall. We only have cdevs now, so lookingMarcel Moolenaar2000-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 Notes: svn path=/head/; revision=68225