summaryrefslogtreecommitdiffstats
path: root/sys/gnu
Commit message (Collapse)AuthorAgeFilesLines
* Garbage collect XFS bits which are now already completely disconnectedattilio2013-03-02164-108070/+0
| | | | | | from the tree since few months. This is not targeted for MFC.
* r16312 is not any longer real since many years (likely since when VFSattilio2012-11-191-7/+0
| | | | | | | | | | received granular locking) but the comment present in UFS has been copied all over other filesystems code incorrectly for several times. Removes comments that makes no sense now. Reviewed by: kib MFC after: 3 days
* Complete MPSAFE VFS interface and remove MNTK_MPSAFE flag.attilio2012-11-091-1/+0
| | | | | Porters should refer to __FreeBSD_version 1000021 for this change as it may have happened at the same timeframe.
* Add an unified macro to deny ability from the compiler to reorderattilio2012-10-092-5/+1
| | | | | | | | | | instruction loads/stores at its will. The macro __compiler_membar() is currently supported for both gcc and clang, but kernel compilation will fail otherwise. Reviewed by: bde, kib Discussed with: dim, theraven MFC after: 2 weeks
* Add VFCF_READONLY flag that indicates ntfs and xfs file systems arekevlo2012-09-121-1/+1
| | | | only supported as read-only.
* Partially revert r239959, after actually fixing most of the clangdim2012-09-025-8/+6
| | | | | | | | | | warnings in sys/gnu/fs/xfs. The only warnings that still need to be suppressed are those about array bound overruns of flexible array members in xfs_dir2_{block,sf}.c, which are too expensive (in terms of cascading code changes) to fix. MFC after: 1 week X-MFC-With: r239959
* Just like the other file systems found in /sys/fs, g_vfs_open()avatar2012-08-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | should be paried with g_vfs_close(). Though g_vfs_close() is a wrapper around g_wither_geom_close(), r206130 added the following test in g_vfs_open(): if (bo->bo_private != vp) return (EBUSY); Which will cause a 'Device busy' error inside reiserfs_mountfs() if the same file system is re-mounted again after umount or mounting failure: (case 1, /dev/ad4s3 is not a valid REISERFS partition) # mount -t reiserfs -o ro /dev/ad4s3 /mnt mount: /dev/ad4s3: Invalid argument # mount -t msdosfs -o ro /dev/ad4s3 /mnt mount: /dev/ad4s3: Device busy (case 2, /dev/ad4s3 is a valid REISERFS partition) # mount -t reiserfs -o ro /dev/ad4s3 /mnt # umount /mnt # mount -t reiserfs -o ro /dev/ad4s3 /mnt mount: /dev/ad4s3: Device busy On the other hand, g_vfs_close() 'fixed' the above cases by doing an extra step to keep 'sc->sc_bo->bo_private' and 'cp->private' pointers synchronised. Reviewed by: kib MFC after: 1 month
* Fix build:delphij2012-05-231-2/+2
| | | | | | | - Use %ll instead of %q for explicit long long casts; - Use %j instead of %q in XFS and cast to intmax_t. Tested with: make universe
* Remove unused thread argument to vrecycle().trasz2012-04-231-3/+1
| | | | Reviewed by: kib
* Make ReiserFS MPSAFEdumbbell2012-03-271-3/+11
| | | | | | Most functions seemed to be already fine w.r.t. what's done in msdosfs. MFC after: 1 month
* Remove fifo.h. The only used function declaration from the header iskib2012-03-111-2/+0
| | | | | | migrated to sys/vnode.h. Submitted by: gianni
* Use new OSS-based BSD-licensed header for cs sound driver.pfg2012-02-011-341/+0
| | | | | | | | | | | | | | | | | The cs driver requires a table with firmware values. An alternative firmware is available in a similar Open Sound System driver. This is actually a partial revert of Revision 77504. Special thanks to joel@ for patiently testing several replacement attempts. The csa driver and the complete sound system are now free of the GPL. Tested by: joel Approved by: jhb (mentor) MFC after: 3 weeks
* Replace GPLd headers from the Maestro3 driver with BSD licensedpfg2012-01-202-906/+0
| | | | | | | | | | | | | | | | | versions derived from /usr/ports/audio/oss. The particular headers used were taken from the attic/drv/oss_allegro directory and are mostly identical to the previous files. The Maestro3 driver is now free from the GPL. NOTE: due to lack of testers this driver is being considered for deprecation and removal. PR: kern/153920 Approved by: jhb (mentor) MFC after: 2 weeks
* Make sure all intermediate variables holding mount flags (mnt_flag)mckusick2012-01-171-1/+1
| | | | | | | and that all internal kernel calls passing mount flags are declared as uint64_t so that flags in the top 32-bits are not lost. MFC after: 2 weeks
* Convert files to UTF-8uqs2012-01-1512-13/+13
|
* Replace GPL'd headers in the emu10kx snd driver code.pfg2012-01-113-2015/+0
| | | | | | | | | | | | | | This uses the emuxkireg.h already used in the emu10k1 snd driver. Special thanks go to Alexander Motin as he was able to find some errors and reverse engineer some wrong values in the emuxkireg header. The emu10kx driver is now free from the GPL. PR: 153901 Tested by: mav, joel Approved by: jhb (mentor) MFC after: 2 weeks
* Use strchr() and strrchr().ed2012-01-021-2/+1
| | | | | | | | It seems strchr() and strrchr() are used more often than index() and rindex(). Therefore, simply migrate all kernel code to use it. For the XFS code, remove an empty line to make the code identical to the code in the Linux kernel.
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.ed2011-11-071-1/+1
| | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static.
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.ed2011-11-071-1/+1
| | | | This means that their use is restricted to a single C file.
* Second-to-last commit implementing Capsicum capabilities in the FreeBSDrwatson2011-08-111-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | kernel for FreeBSD 9.0: Add a new capability mask argument to fget(9) and friends, allowing system call code to declare what capabilities are required when an integer file descriptor is converted into an in-kernel struct file *. With options CAPABILITIES compiled into the kernel, this enforces capability protection; without, this change is effectively a no-op. Some cases require special handling, such as mmap(2), which must preserve information about the maximum rights at the time of mapping in the memory map so that they can later be enforced in mprotect(2) -- this is done by narrowing the rights in the existing max_protection field used for similar purposes with file permissions. In namei(9), we assert that the code is not reached from within capability mode, as we're not yet ready to enforce namespace capabilities there. This will follow in a later commit. Update two capability names: CAP_EVENT and CAP_KEVENT become CAP_POST_KEVENT and CAP_POLL_KEVENT to more accurately indicate what they represent. Approved by: re (bz) Submitted by: jonathan Sponsored by: Google Inc
* Fix typo in unused function nameuqs2011-05-221-1/+1
| | | | Submitted by: arundel
* Add a lock flags argument to the VFS_FHTOVP() file systemrmacklem2011-05-222-2/+4
| | | | | | | | | | | method, so that callers can indicate the minimum vnode locking requirement. This will allow some file systems to choose to return a LK_SHARED locked vnode when LK_SHARED is specified for the flags argument. This patch only adds the flag. It does not change any file system to use it and all callers specify LK_EXCLUSIVE, so file system semantics are not changed. Reviewed by: kib
* Fix typos - remove duplicate "the".brucec2011-02-212-3/+3
| | | | | | PR: bin/154928 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days
* Remove prtactive variable and related printf()s in the vop_inactivekib2010-11-191-4/+0
| | | | | | | | and vop_reclaim() methods. They seems to be unused, and the reported situation is normal for the forced unmount. MFC after: 1 week X-MFC-note: keep prtactive symbol in vfs_subr.c
* The r184588 changed the layout of struct export_args, causing an ABIkib2010-10-102-2/+4
| | | | | | | | | | breakage for old mount(2) syscall, since most struct <filesystem>_args embed export_args. The mount(2) is supposed to provide ABI compatibility for pre-nmount mount(8) binaries, so restore ABI to pre-r184588. Requested and reviewed by: bde MFC after: 2 weeks
* Add dedicated routines to toggle lockmgr flags such as LK_NOSHARE andjhb2010-08-201-1/+1
| | | | | | | | | | | | LK_CANRECURSE after a lock is created. Use them to implement macros that otherwise manipulated the flags directly. Assert that the associated lockmgr lock is exclusively locked by the current thread when manipulating these flags to ensure the flag updates are safe. This last change required some minor shuffling in a few filesystems to exclusively lock a brand new vnode slightly earlier. Reviewed by: kib MFC after: 3 days
* Move checking against RLIMIT_FSIZE into one place, vn_rlimit_fsize().trasz2010-05-051-10/+2
| | | | Reviewed by: kib
* Bring in the ext2fs work done by Aditya Sarawgi during and after Google Summerlulf2010-01-1422-8778/+10
| | | | | | | | | | | | | | | of Code 2009: - BSDL block and inode allocation policies for ext2fs. This involves the use FFS1 style block and inode allocation for ext2fs. Preallocation was removed since it was GPL'd. - Make ext2fs MPSAFE by introducing locks to per-mount datastructures. - Fixes for kern/122047 PR. - Various small bugfixes. - Move out of gnu/ directory. Sponsored by: Google Inc. Submitted by: Aditya Sarawgi <sarawgi.aditya AT SPAMFREE gmail DOT com>
* Remove extraneous semicolons, no functional changes.mbr2010-01-071-1/+1
| | | | | Submitted by: Marc Balmer <marc@msys.ch> MFC after: 1 week
* Remove unused code.trasz2009-12-031-36/+0
|
* File flags handling fixes for ext2fs:jh2009-11-052-4/+10
| | | | | | | | | | | | | | | | - Disallow setting of flags not supported by ext2fs. - Map EXT2_APPEND_FL to SF_APPEND. - Map EXT2_IMMUTABLE_FL to SF_IMMUTABLE. - Map EXT2_NODUMP_FL to UF_NODUMP. Note that ext2fs doesn't support user settable append and immutable flags. EXT2_NODUMP_FL is an user settable flag also on Linux. PR: kern/122047 Reported by: Ighighi Submitted by: Aditya Sarawgi (original version) Reviewed by: bde Approved by: trasz (mentor)
* Fix the build by using proper format.rdivacky2009-06-251-1/+1
| | | | | Pointy hat: me Approved by: kib
* Switch cmd argument of ioctl to u_long as elsewhere in the kernel.rdivacky2009-06-255-8/+8
| | | | | | | Propagate this change down the callchain. Approved by: kan (maintainer) Approved by: ed (mentor)
* Do not use casts (int *)0 and (struct thread *)0 for the arguments ofkib2009-06-162-8/+6
| | | | | | | vn_rdwr, use NULL. Reviewed by: jhb MFC after: 1 week
* Fix r193923 by noting that type of a_fp is struct file *, not int.kib2009-06-101-1/+1
| | | | | | | It was assumed that r193923 was trivial change that cannot be done wrong. MFC after: 2 weeks
* s/a_fdidx/a_fp/ for VOP_OPEN comments that inline struct vop_open_argskib2009-06-101-1/+1
| | | | | | | definition. Discussed with: bde MFC after: 2 weeks
* - Outindent long printf lines instead of splitting them in thestas2009-06-071-11/+12
| | | | | | | | middle of senetences. This also makes the code more consistent with the corresponding FFS code. - Use 2-space sentences breaks consistently. Suggested by: bde
* - Remove unused sparc64-bitops.h file. Our ext2fs code doesn't usestas2009-06-031-264/+0
| | | | | | sparc64-specific bitops implemetations and relies on generic ones. Furthermore, bitops implementations present in sparc64-bitops.h are written in C similarly to generic bitops.
* - Style(9) improvements.stas2009-06-031-271/+220
| | | | | | | | | - Convert all K&R definitions to ANSI equialents. - Retire bsd_malloc and bsd_free macros and use malloc/free directly. - Drop some unused debugging calls. This commit brings no functional changes.
* - Sync our copies of ext2fs Linux headers to current Linux versions.stas2009-06-035-67/+75
| | | | | | | | | | | | | | | | | | | Minimize differencies between our ext2fs headers and relevant Linux versions by using EXT2_SB macro to access the superblock fields. Most of the differencies in access to these fields are now hidden inside this macro. - Rename the s_db_per_group field of ext2fs_sb_info to s_gdb_count to reflect the similar change in Linux headers. New name also seem to be more appropriate for this field. - Use proper types for s_first_inode and s_inode_size in-core superblock fields. Now they reflec types used in the on-disk superblock version. - Add support for older filesystem revisions that doesn't have proper s_first_ino and s_inode_size fields in the on-disk superblock. In these cases predefined values for these fields are used. - Add simple sanity checks for s_first_inode and s_inode_size correctness. Reviewed by: bde (previous version) MFC after: 2 weeks
* Remove empty files and do nto try to build them.kan2009-05-183-0/+0
| | | | | | | Apparently, they are problematic for CTF users. PR: 119298 Submitted by: Julian H. Stacey
* FreeBSD right now support 32 CPUs on all the architectures at least.attilio2009-05-141-1/+0
| | | | | | | | | | | | | | | | With the arrival of 128+ cores it is necessary to handle more than that. One of the first thing to change is the support for cpumask_t that needs to handle more than 32 bits masking (which happens now). Some places, however, still assume that cpumask_t is a 32 bits mask. Fix that situation by using always correctly cpumask_t when needed. While here, remove the part under STOP_NMI for the Xen support as it is broken in any case. Additively make ipi_nmi_pending as static. Reviewed by: jhb, kmacy Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
* Remove the thread argument from the FSD (File-System Dependent) parts ofattilio2009-05-113-38/+33
| | | | | | | | | | | | | | | | | the VFS. Now all the VFS_* functions and relating parts don't want the context as long as it always refers to curthread. In some points, in particular when dealing with VOPs and functions living in the same namespace (eg. vflush) which still need to be converted, pass curthread explicitly in order to retain the old behaviour. Such loose ends will be fixed ASAP. While here fix a bug: now, UFS_EXTATTR can be compiled alone without the UFS_EXTATTR_AUTOSTART option. VFS KPI is heavilly changed by this commit so thirdy parts modules needs to be recompiled. Bump __FreeBSD_version in order to signal such situation.
* Fix two issues with bufdaemon, often causing the processes to hang inkib2009-03-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the "nbufkv" sleep. First, ffs background cg group block write requests a new buffer for the shadow copy. When ffs_bufwrite() is called from the bufdaemon due to buffers shortage, requesting the buffer deadlock bufdaemon. Introduce a new flag for getnewbuf(), GB_NOWAIT_BD, to request getblk to not block while allocating the buffer, and return failure instead. Add a flag argument to the geteblk to allow to pass the flags to getblk(). Do not repeat the getnewbuf() call from geteblk if buffer allocation failed and either GB_NOWAIT_BD is specified, or geteblk() is called from bufdaemon (or its helper, see below). In ffs_bufwrite(), fall back to synchronous cg block write if shadow block allocation failed. Since r107847, buffer write assumes that vnode owning the buffer is locked. The second problem is that buffer cache may accumulate many buffers belonging to limited number of vnodes. With such workload, quite often threads that own the mentioned vnodes locks are trying to read another block from the vnodes, and, due to buffer cache exhaustion, are asking bufdaemon for help. Bufdaemon is unable to make any substantial progress because the vnodes are locked. Allow the threads owning vnode locks to help the bufdaemon by doing the flush pass over the buffer cache before getnewbuf() is going to uninterruptible sleep. Move the flushing code from buf_daemon() to new helper function buf_do_flush(), that is called from getnewbuf(). The number of buffers flushed by single call to buf_do_flush() from getnewbuf() is limited by new sysctl vfs.flushbufqtarget. Prevent recursive calls to buf_do_flush() by marking the bufdaemon and threads that temporarily help bufdaemon by TDP_BUFNEED flag. In collaboration with: pho Reviewed by: tegge (previous version) Tested by: glebius, yandex ... MFC after: 3 weeks
* Don't declare bin_search() as an inline function, since there's nodas2009-03-081-1/+1
| | | | inline definition of it.
* Add memmove() to the kernel, making the kernel compile with Clang.ed2009-02-281-4/+0
| | | | | | | | | | | | When copying big structures, LLVM generates calls to memmove(), because it may not be able to figure out whether structures overlap. This caused linker errors to occur. memmove() is now implemented using bcopy(). Ideally it would be the other way around, but that can be solved in the future. On ARM we don't do add anything, because it already has memmove(). Discussed on: arch@ Reviewed by: rdivacky
* - Eliminate warnings in debug print macros by explicitly converting allstas2009-01-181-1/+1
| | | | field to unsigned long.
* - Whitespace fixes.stas2009-01-181-23/+23
| | | | | - s_bmask field doesn't exist. - Use correct flags in debug printf.
* - Obtain inode sizes and location of the first inode based on the contentsstas2009-01-185-8/+14
| | | | | | | | of superblock rather than using hardcoded values. This fixes ext2fs on filesystems with inode sized other than 128. Submitted by: Alex Lyashkov <Alexey.Lyashkov@Sun.COM> (based on) MFC after: 2 weeks
* Do not incorrectly add the low 5 bits of the offset to the resultingkib2009-01-041-1/+1
| | | | | | | position of the found zero bit. Submitted by: Jaakko Heinonen <jh saunalahti fi> MFC after: 2 weeks
OpenPOWER on IntegriCloud