summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* Despite several examples in the kernel, the third argument ofdwmalone2007-06-041-2/+2
| | | | | | | | | | | | | sysctl_handle_int is not sizeof the int type you want to export. The type must always be an int or an unsigned int. Remove the instances where a sizeof(variable) is passed to stop people accidently cut and pasting these examples. In a few places this was sysctl_handle_int was being used on 64 bit types, which would truncate the value to be exported. In these cases use sysctl_handle_quad to export them and change the format to Q so that sysctl(1) can still print them.
* Reimplement traverse() helper function:pjd2007-06-042-10/+14
| | | | | | | | | | | | 1. Pass locking flags to VFS_ROOT(). 2. Check v_mountedhere while the vnode is locked. 3. Always return locked vnode on success. Change 1 fixes problem reported by Stephen M. Rumble - after zfs_vfsops.c,1.9 change, zfs_root() no longer locks the vnode unconditionally and traverse() didn't pass right lock type to VFS_ROOT(). The result was that kernel paniced when .zfs/ directory was accessed via NFS.
* Revert VMCNT_* operations introduction.attilio2007-05-313-12/+12
| | | | | | | | Probabilly, a general approach is not the better solution here, so we should solve the sched_lock protection problems separately. Requested by: alc Approved by: jeff (mentor)
* Revert UF_OPENING workaround for CURRENT.kib2007-05-314-4/+5
| | | | | | | | | Change the VOP_OPEN(), vn_open() vnode operation and d_fdopen() cdev operation argument from being file descriptor index into the pointer to struct file. Proposed and reviewed by: jhb Reviewed by: daichi (unionfs) Approved by: re (kensmith)
* There are too many false positive LORs reported by WITNESS, so when ZFSpjd2007-05-262-2/+14
| | | | | | debug is turned off, initialize locks with NOWITNESS flag. At some point I'll get back to them, we would probably need BLESSING functionality, which is currently turned off by default.
* DNLC_NO_VNODE can't be NULL.pjd2007-05-241-1/+1
| | | | Reported by: ru
* FreeBSD's namecache works quite well with ZFS, so remove DNLC.pjd2007-05-231-0/+40
|
* Remove duplicate includes.cognet2007-05-231-3/+0
| | | | Submitted by: Cyril Nguyen Huu <cyril ci0 org>
* Move futex support code from <arch>/support.s into linux compat directory.kib2007-05-231-75/+38
| | | | | | | | | | Implement all futex atomic operations in assembler to not depend on the fuword() that does not allow to distinguish between -1 and failure return. Correctly return 0 from atomic operations on success. In collaboration with: rdivacky Tested by: Scot Hetzel <swhetzel gmail com>, Milos Vyletel <mvyletel mzm cz> Sponsored by: Google SoC 2007
* Allow FreeBSD's native ELF image activators to execute shared libraries thekan2007-05-221-2/+2
| | | | | | | same way it was enabled for Linux binares in linuxulator. This allows binaries built with -pie. Many ports auto-detect -fPIE support in GCC 4.2 and build binaries FreeBSD was unable to run.
* - Move GDT/LDT locking into a seperate spinlock, removing the globaljeff2007-05-201-6/+6
| | | | | | | scheduler lock from this responsibility. Contributed by: Attilio Rao <attilio@FreeBSD.org> Tested by: jeff, kkenn
* - define and use VMCNT_{GET,SET,ADD,SUB,PTR} macros for manipulatingjeff2007-05-183-12/+12
| | | | | | | | vmcnts. This can be used to abstract away pcpu details but also changes to use atomics for all counters now. This means sched lock is no longer responsible for protecting counts in the switch routines. Contributed by: Attilio Rao <attilio@FreeBSD.org>
* Rework the support for ABIs to override resource limits (used by 32-bitjhb2007-05-141-31/+29
| | | | | | | | | | | | | | | | | | | processes under 64-bit kernels). Previously, each 32-bit process overwrote its resource limits at exec() time. The problem with this approach is that the new limits affect all child processes of the 32-bit process, including if the child process forks and execs a 64-bit process. To fix this, don't ovewrite the resource limits during exec(). Instead, sv_fixlimits() is now replaced with a different function sv_fixlimit() which asks the ABI to sanitize a single resource limit. We then use this when querying and setting resource limits. Thus, if a 32-bit process sets a limit, then that new limit will be inherited by future children. However, if the 32-bit process doesn't change a limit, then a future 64-bit child will see the "full" 64-bit limit rather than the 32-bit limit. MFC is tentative since it will break the ABI of old linux.ko modules (no other modules are affected). MFC after: 1 week
* Share-lock a vnode where possible.pjd2007-05-022-3/+3
|
* Eliminate the use of Giant from ia64-specific code in freebsd32_mmap().alc2007-05-011-6/+1
|
* Synchronize vm map and object accesses.alc2007-05-011-8/+26
| | | | Approved by: des@
* MFp4: Reduce diff against vendor code:pjd2007-04-235-5/+72
| | | | | | - Move FreeBSD-specific code to zfs_freebsd_*() functions in zfs_vnops.c and keep original functions as similar to vendor's code as possible. - Add various includes back, now that we have them.
* Now that we're MPSAFE, tell namei() to acquire Giant if necessary.des2007-04-221-2/+4
|
* MFp4:pjd2007-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | @118370 Correct typo. @118371 Integrate changes from vendor. @118491 Show backtrace on unexpected code paths. @118494 Integrate changes from vendor. @118504 Fix sendfile(2). I had two ways of fixing it: 1. Fixing sendfile(2) itself to use VOP_GETPAGES() instead of hacking around with vn_rdwr(UIO_NOCOPY), which was suggested by ups. 2. Modify ZFS behaviour to handle this special case. Although 1 is more correct, I've choosen 2, because hack from 1 have a side-effect of beeing faster - it reads ahead MAXBSIZE bytes instead of reading page by page. This is not easy to implement with VOP_GETPAGES(), at least not for me in this very moment. Reported by: Andrey V. Elsukov <bu7cher@yandex.ru> @118525 Reorganize the code to reduce diff. @118526 This code path is expected. It is simply when file is opened with O_FSYNC flag. Reported by: kris Reported by: Michal Suszko <dry@dry.pl>
* MFp4: Fix automatic snapshot mount when unprivileged user does lookuppjd2007-04-181-7/+8
| | | | | | | | | | | | on a snapshot directory: - Remove PRIV_VFS_MOUNT check - regular users can mount snapshots via lookups on snapshot directory. - Reset mount credential to kcred, so user won't be able to unmount the snapshot. - Reset owner uid. - Unlock vnode in case of a failure. Reported by: simokawa
* - Fix a leftover - vfs_mount_alloc() is now exported properly.pjd2007-04-171-4/+5
| | | | | | | | This fixes stange panics when listing .zfs/snapshot/ directory for me. Reported by: simokawa Reported by: Johan Hendriks <Johan@double-l.nl> - Hide cache_purge() under FREEBSD_NAMECACHE like in other files. - Protect mnt_flag with mount interlock.
* Whitespace cleanup.des2007-04-151-16/+18
|
* Some Linux applications (ping) pass a non-NULL msg_control argument torwatson2007-04-141-0/+10
| | | | | | | | sendmsg() while using a 0-length msg_controllen. This isn't allowed in the FreeBSD system call ABI, so detect this case and set msg_control to NULL. This allows Linux ping to work. Submitted by: rdivacky
* strchr() and strrchr() are already present in the kernel, but with lesswkoszek2007-04-102-33/+2
| | | | | | | | | | | | | popular names. Hence: - comment current index() and rindex() functions, as these serve the same functionality as, respectively, strchr() and strrchr() from userland; - add inlined version of strchr() and strrchr(), as we tend to use them more often; - remove str[r]chr() definitions from ZFS code; Reviewed by: pjd Approved by: cognet (mentor)
* Whitespace fixesscottl2007-04-101-28/+28
|
* Try to stabilize ZFS with regard to memory consumption:pjd2007-04-102-8/+26
| | | | | | | | | | | | | | | | | | - Allow to shrink ARC down to 16MB (instead of 64MB). - Set arc_max to 1/2 of kmem_map by default. - Start freeing things earlier when low memory situation is detected. - Serialize execution of arc_lowmem(). I decided to setup minimum ZFS memory requirements to 512MB of RAM and 256MB of kmem_map size. If there is less RAM or kmem_map, a warning will be printed. World is cruel, be no better. In other words: modern file system requires modern hardware:) From ZFS administration guide: "Currently the minimum amount of memory recommended to install a Solaris system is 512 Mbytes. However, for good ZFS performance, at least one Gbyte or more of memory is recommended."
* Instead of detecting if lock is already initialized based on standard 1 bitpjd2007-04-093-2/+55
| | | | | | | check, use more accurate 13 bits check. We had too many false-positives with the standard check. Reported by: mlaier
* Extend kobj compatibility KPI to support operating on files before andpjd2007-04-082-16/+102
| | | | | after the root file system is mounted. This is one of the changes that will allow to put root file system on ZFS.
* MFp4: Synchronize with recent OpenSolaris changes.pjd2007-04-082-0/+95
|
* Add the CAM 'SG' peripheral device. This device implements a subset of thescottl2007-04-072-0/+61
| | | | | | | | | | | | | | | | | | | | | | | Linux SCSI SG passthrough device API. The intention is to allow for both running of Linux apps that want to talk to /dev/sg* nodes, and to facilitate porting of apps from Linux to FreeBSD. As such, both native and linuxolator entry points and definitions are provided. Caveats: - This does not support the procfs and sysfs nodes that the Linux SG driver provides. Some Linux apps may rely on these for operation, others may only use them for informational purposes. - More ioctls need to be implemented. - Linux uses a naming scheme of "sg[a-z]" for devices, while FreeBSD uses a scheme of "sg[0-9]". Devfs aliasis (symlinks) are automatically created to link the two together. However, tools like camcontrol only see the native names. - Some operations were originally designed to return byte counts or other data directly as the syscall return value. The linuxolator doesn't appear to support this well, so this driver just punts for these cases. Now that the driver is in place, others are welcome to add missing functionality. Thanks to Roman Divacky for pushing this work along.
* Fix kernel module dependency. linprocfs depends on sysvmsg and sysvsem.jkim2007-04-061-0/+2
| | | | Submitted by: nork
* We have strcasecmp() in libkern now.pjd2007-04-064-55/+3
|
* Please welcome ZFS - The last word in file systems.pjd2007-04-0642-0/+4244
| | | | | | | | | | | ZFS file system was ported from OpenSolaris operating system. The code in under CDDL license. I'd like to thank all SUN developers that created this great piece of software. Supported by: Wheel LTD (http://www.wheel.pl/) Supported by: The FreeBSD Foundation (http://www.freebsdfoundation.org/) Supported by: Sentex (http://www.sentex.net/)
* Replace custom file descriptor array sleep lock constructed using a mutexrwatson2007-04-042-8/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and flags with an sxlock. This leads to a significant and measurable performance improvement as a result of access to shared locking for frequent lookup operations, reduced general overhead, and reduced overhead in the event of contention. All of these are imported for threaded applications where simultaneous access to a shared file descriptor array occurs frequently. Kris has reported 2x-4x transaction rate improvements on 8-core MySQL benchmarks; smaller improvements can be expected for many workloads as a result of reduced overhead. - Generally eliminate the distinction between "fast" and regular acquisisition of the filedesc lock; the plan is that they will now all be fast. Change all locking instances to either shared or exclusive locks. - Correct a bug (pointed out by kib) in fdfree() where previously msleep() was called without the mutex held; sx_sleep() is now always called with the sxlock held exclusively. - Universally hold the struct file lock over changes to struct file, rather than the filedesc lock or no lock. Always update the f_ops field last. A further memory barrier is required here in the future (discussed with jhb). - Improve locking and reference management in linux_at(), which fails to properly acquire vnode references before using vnode pointers. Annotate improper use of vn_fullpath(), which will be replaced at a future date. In fcntl(), we conservatively acquire an exclusive lock, even though in some cases a shared lock may be sufficient, which should be revisited. The dropping of the filedesc lock in fdgrowtable() is no longer required as the sxlock can be held over the sleep operation; we should consider removing that (pointed out by attilio). Tested by: kris Discussed with: jhb, kris, attilio, jeff
* MFP4: Turn emul_lock into a mutex.jkim2007-04-022-14/+14
| | | | Submitted by: rdivacky
* Use underlying structures instead of kernel_sysctlbyname() for msginfo andjkim2007-03-301-34/+5
| | | | | | | | | seminfo because kernel_sysctlbyname() is slow. There is no dependency problem since linux module depends on both sysvmsg and sysvsem and linprocfs depends on it in turn. Pointed out by: des Reviewed by: des
* MFP4: Linux futex support for amd64.jkim2007-03-301-87/+129
| | | | | | | Initial patch was submitted by kib and additional work was done by Divacky Roman. Tested by: emulation
* Implement the openat() linux syscalljulian2007-03-292-33/+142
| | | | | Submitted by: Roman Divacky (rdivacky@) MFC after: 2 weeks
* Add a pn_destroy field to pfs_node. This field points to a destructordes2007-03-122-45/+45
| | | | | | | | | | | | | function which is called from pfs_destroy() before the node is reclaimed. Modify pfs_create_{dir,file,link}() to accept a pointer to a destructor function in addition to the usual attr / fill / vis pointers. This breaks both the programming and binary interfaces between pseudofs and its consumers. It is believed that there are no pseudofs consumers outside the source tree, so that the impact of this change is minimal. Submitted by: Aniruddha Bohra <bohra@cs.rutgers.edu>
* In translate_path_major_minor(), do not calculate otherwise unused 'fp'rwatson2007-03-061-4/+0
| | | | variable, avoiding an extra locking of the file descriptor array.
* MFP4: 113090, 113130, 113132jkim2007-03-021-3/+100
| | | | Add Linux kernel version strings to /proc/sys/kernel.
* MFP4: 115220, 115222jkim2007-03-021-2/+2
| | | | | - Fix style(9) and reduce diff between amd64 and i386. - Prefix Linuxulator macros with LINUX_ to prevent future collision.
* MFp4 (110541):netchild2007-02-251-2/+7
| | | | | | Sync with rev 1.7 in NetBSD. Obtained from: NetBSD
* MFp4 (110523, parts which apply cleanly):netchild2007-02-252-89/+92
| | | | | | | | | semi-automatic style(9) The futex stuff already differs a lot (only a small part does not differ) from NetBSD, so we are already way off and can't apply changes from NetBSD automatically. As we need to merge everything by hand already, we can even make the files comply to our world order.
* Partial MFp4 of 114977:netchild2007-02-244-15/+12
| | | | | | Whitespace commit: Fix grammar, spelling and punctuation. Submitted by: "Scot Hetzel" <swhetzel@gmail.com>
* MFp4 (114193 (i386 part), 114194, 114195, 114200):netchild2007-02-232-7/+13
| | | | | | | | | | | | | - Dont "return" in linux_clone() after we forked the new process in a case of problems. - Move the copyout of p2->p_pid outside the emul_lock coverage in linux_clone(). - Cache the em->pdeath_signal in a local variable and move the copyout out of the emul_lock coverage. - Move the free() out of the emul_shared_lock coverage in a preparation to switch emul_lock to non-sleepable lock (mutex). Submitted by: rdivacky
* MFp4 (part of 114132):netchild2007-02-231-7/+8
| | | | | | - Fix a LOR caused by holding emul_lock and proctree_lock at once. Submitted by: rdivacky
* Use 'pause' in several places rather than trying to tsleep() on NULL (whichjhb2007-02-231-1/+1
| | | | | | triggers a KASSERT) or local variables. In the case of kern_ndis, the tsleep() actually used a common sleep address (curproc) making it susceptible to a premature wakeup.
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-231-1/+1
| | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@
* Remove extern int hz; use proper include file instead.kib2007-02-021-2/+1
|
OpenPOWER on IntegriCloud