summaryrefslogtreecommitdiffstats
path: root/sys/fs/tmpfs
Commit message (Collapse)AuthorAgeFilesLines
* MFC r277828:kib2015-02-114-9/+69
| | | | | | | | | | | | | Update mtime for tmpfs files modified through memory mapping. MFC r277969: Update both ctime and mtime for writes to tmpfs files. MFC r277972: Remove single-use boolean. MFC r278151: Remove duplicated assignment.
* MFC r278000:kib2015-02-071-0/+2
| | | | | Update directory times immediately after an entry is created or removed.
* MFC r277827:kib2015-01-311-4/+4
| | | | tmpfs does not use UVM on FreeBSD.
* MFC r276007:kib2015-01-041-1/+5
| | | | Handle MAKEENTRY cnp flag in the VOP_CREATE().
* MFC r275897:kib2015-01-011-1/+1
| | | | | Set NOCACHE flag for CREATE namei() calls, do not specially handle MAKEENTRY in VOP_LOOKUP().
* MFC r268765:kib2014-07-301-1/+0
| | | | Remove unused header.
* MFC r268764:kib2014-07-301-15/+0
| | | | | Check for the cross-device cross-link attempt in the VFS, instead of VOP_LINK() implemenations.
* MFC r268766:kib2014-07-281-1/+3
| | | | Do not ignore error from tmpfs_alloc_vp().
* MFC r268617:kib2014-07-283-27/+74
| | | | Rework the tmpfs unmount.
* MFC r268615:kib2014-07-281-1/+1
| | | | | | | | | | | Add OBJ_TMPFS_NODE flag. MFC r268616: Set the OBJ_TMPFS_NODE flag for vm_object of VREG tmpfs node. MFC r269053: Correct assertion. tmpfs vm object is always at the bottom of the shadow chain.
* MFC r268614:kib2014-07-281-13/+13
| | | | | Use tmpfs_vn_get_ino_gen() to handle the races with reclaim in tmpfs dotdot lookup.
* MFC r268613:kib2014-07-282-1/+2
| | | | Style. Add comment about lock mode.
* MFC r268611:kib2014-07-281-9/+5
| | | | Replace goto's with the return.
* MFC r268610:kib2014-07-282-1/+3
| | | | Add convenience macro to assert tmpfs node lock.
* MFC r268609:kib2014-07-282-0/+3
| | | | Add some assertions for the code handling vm_object for tmpfs vnode.
* MFC r268608:kib2014-07-281-2/+2
| | | | | The tmpfs_link() must not dereference the filesystem-specific data for a vnode until it is verified that the vnode indeed belongs to tmpfs mount.
* MFC r268605:kib2014-07-287-132/+0
| | | | Remove code separator lines which do not conform to style(9).
* MFC r267564:kib2014-06-243-24/+15
| | | | | In msdosfs_setattr(), add a check for result of the utimes(2) permissions test. Refactor the permission checks for utimes(2).
* MFC r267060:kib2014-06-111-0/+2
| | | | Allow shared locking for the tmpfs vnode.
* MFC r263131,r263174,r263175:bdrewery2014-03-302-27/+38
| | | | | | | | | | | | | | | | Tmpfs readdir() redundant logic and code readability cleanup. r263131: Cleanup redundant logic and add some comments to help explain how it works in lieu of potentially less clear code. r263174: Rename cnt to maxcookies and change its use as the condition for when to lookup cookies to be less obscure. r263175: Add missing FALLTHROUGH comment in tmpfs_dir_getdents for looking up '.' and '..'.
* MFC r263130:bdrewery2014-03-301-2/+4
| | | | Fix -o size less than PAGE_SIZE resulting in SIZE_MAX being used.
* Support storing 7 additional file flags in tmpfs:ken2013-08-281-3/+4
| | | | | | | | | | | UF_SYSTEM, UF_SPARSE, UF_OFFLINE, UF_REPARSE, UF_ARCHIVE, UF_READONLY, and UF_HIDDEN. Sort the file flags tmpfs supports alphabetically. tmpfs now supports the same flags as UFS, with the exception of SF_SNAPSHOT. Reported by: bdrewery, antoine Sponsored by: Spectra Logic
* Allow tmpfs be mounted inside jail.delphij2013-08-231-1/+7
|
* Extract the general-purpose code from tmpfs to perform uiomove fromkib2013-08-211-211/+24
| | | | | | | | the page queue of some vm object. Discussed with: alc Tested by: pho Sponsored by: The FreeBSD Foundation
* The soft and hard busy mechanism rely on the vm object lock to work.attilio2013-08-092-14/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unify the 2 concept into a real, minimal, sxlock where the shared acquisition represent the soft busy and the exclusive acquisition represent the hard busy. The old VPO_WANTED mechanism becames the hard-path for this new lock and it becomes per-page rather than per-object. The vm_object lock becames an interlock for this functionality: it can be held in both read or write mode. However, if the vm_object lock is held in read mode while acquiring or releasing the busy state, the thread owner cannot make any assumption on the busy state unless it is also busying it. Also: - Add a new flag to directly shared busy pages while vm_page_alloc and vm_page_grab are being executed. This will be very helpful once these functions happen under a read object lock. - Move the swapping sleep into its own per-object flag The KPI is heavilly changed this is why the version is bumped. It is very likely that some VM ports users will need to change their own code. Sponsored by: EMC / Isilon storage division Discussed with: alc Reviewed by: jeff, kib Tested by: gavin, bapt (older version) Tested by: pho, scottl
* The tmpfs_alloc_vp() is used to instantiate vnode for the tmpfs node,kib2013-08-052-0/+25
| | | | | | | | | | | | | | | | | | | | | | in particular, from the tmpfs_lookup VOP method. If LK_NOWAIT is not specified in the lkflags, the lookup is supposed to return an alive vnode whenever the underlying node is valid. Currently, the tmpfs_alloc_vp() returns ENOENT if the vnode attached to node exists and is being reclaimed. This causes spurious ENOENT errors from lookup on tmpfs and corresponding random 'No such file' failures from syscalls working with tmpfs files. Fix this by waiting for the doomed vnode to be detached from the tmpfs node if sleepable allocation is requested. Note that filesystems which use vfs_hash.c, correctly handle the case due to vfs_hash_get() looping when vget() returns ENOENT for sleepable requests. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* Revert r253939:attilio2013-08-051-6/+8
| | | | | | | | | | | | | We cannot busy a page before doing pagefaults. Infact, it can deadlock against vnode lock, as it tries to vget(). Other functions, right now, have an opposite lock ordering, like vm_object_sync(), which acquires the vnode lock first and then sleeps on the busy mechanism. Before this patch is reinserted we need to break this ordering. Sponsored by: EMC / Isilon storage division Reported by: kib
* The page hold mechanism is fast but it has couple of fallouts:attilio2013-08-041-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | - It does not let pages respect the LRU policy - It bloats the active/inactive queues of few pages Try to avoid it as much as possible with the long-term target to completely remove it. Use the soft-busy mechanism to protect page content accesses during short-term operations (like uiomove_fromphys()). After this change only vm_fault_quick_hold_pages() is still using the hold mechanism for page content access. There is an additional complexity there as the quick path cannot immediately access the page object to busy the page and the slow path cannot however busy more than one page a time (to avoid deadlocks). Fixing such primitive can bring to complete removal of the page hold mechanism. Sponsored by: EMC / Isilon storage division Discussed with: alc Reviewed by: jeff Tested by: pho
* Remove unnecessary soft busy of the page before to do vn_rdwr() inattilio2013-08-041-5/+3
| | | | | | | | | | | | kern_sendfile() which is unnecessary. The page is already wired so it will not be subjected to pagefault. The content cannot be effectively protected as it is full of races already. Multiple accesses to the same indexes are serialized through vn_rdwr(). Sponsored by: EMC / Isilon storage division Reviewed by: alc, jeff Tested by: pho
* tmpfs works perfectly fine with -o union -- there is no reason to exclude itnwhitehorn2013-07-231-1/+1
| | | | from the list of options.
* Add missing VM object unlocks in an error case.alc2013-06-071-0/+2
| | | | Reviewed by: kib
* Don't busy the page unless we are likely to release the object lock.alc2013-06-061-4/+7
| | | | | Reviewed by: kib Sponsored by: EMC / Isilon Storage Division
* Eliminate unnecessary vm object locking from tmpfs_nocacheread().alc2013-06-041-2/+0
|
* Assert that OBJ_TMPFS flag on the vm object for the tmpfs node iskib2013-05-301-0/+2
| | | | | | cleared when the tmpfs node is going away. Tested by: bdrewery, pho
* Avoid deactivating the page if it is already on a queue, only requeuekib2013-05-061-6/+10
| | | | | | | | | | the page. This both reduces the number of queues locking and avoids moving the active page to inactive list just because the page was read or written. Based on the suggestion by: alc Reviewed by: alc Tested by: pho
* Fix the v_object leak for non-regular tmpfs vnodes.kib2013-05-021-0/+3
| | | | | Reported and tested by: pho Sponsored by: The FreeBSD Foundation
* For the new regular tmpfs vnode, v_object is initialized beforekib2013-05-023-14/+34
| | | | | | | | | | | | | | insmntque() is called. The standard insmntque destructor resets the vop vector to deadfs one, and calls vgone() on the vnode. As result, v_object is kept unchanged, which triggers an assertion in the reclaim code, on instmntque() failure. Also, in this case, OBJ_TMPFS flag on the backed vm object is not cleared. Provide the tmpfs insmntque() destructor which properly clears OBJ_TMPFS flag and resets v_object. Reported and tested by: pho Sponsored by: The FreeBSD Foundation
* The page read or written could be wired. Do not requeue if the pagekib2013-05-021-2/+4
| | | | | | | is not on a queue. Reported and tested by: pho Sponsored by: The FreeBSD Foundation
* Rework the handling of the tmpfs node backing swap object and tmpfskib2013-04-282-164/+103
| | | | | | | | | | | | | | | | | | vnode v_object to avoid double-buffering. Use the same object both as the backing store for tmpfs node and as the v_object. Besides reducing memory use up to 2x times for situation of mapping files from tmpfs, it also makes tmpfs read and write operations copy twice bytes less. VM subsystem was already slightly adapted to tolerate OBJT_SWAP object as v_object. Now the vm_object_deallocate() is modified to not reinstantiate OBJ_ONEMAPPING flag and help the VFS to correctly handle VV_TEXT flag on the last dereference of the tmpfs backing object. Reviewed by: alc Tested by: pho, bf MFC after: 1 month
* - Constify local path variable for chflagsat().pjd2013-03-221-1/+1
| | | | | | - Use correct format characters (%lx) for u_long. This fixes the build broken in r248599.
* - Make 'flags' argument to chflags(2), fchflags(2) and lchflags(2) of typepjd2013-03-212-3/+4
| | | | | | | | | | | u_long. Before this change it was of type int for syscalls, but prototypes in sys/stat.h and documentation for chflags(2) and fchflags(2) (but not for lchflags(2)) stated that it was u_long. Now some related functions use u_long type for flags (strtofflags(3), fflagstostr(3)). - Make path argument of type 'const char *' for consistency. Discussed on: arch Sponsored by: The FreeBSD Foundation
* Remove negative name cache entry pointing to the target name, whichkib2013-03-171-0/+1
| | | | | | | | could be instantiated while tdvp was unlocked. Reported by: Rick Miller <vmiller at hostileadmin com> Tested by: pho MFC after: 1 week
* Rename VM_OBJECT_LOCK(), VM_OBJECT_UNLOCK() and VM_OBJECT_TRYLOCK() toattilio2013-02-202-27/+27
| | | | | | their "write" versions. Sponsored by: EMC / Isilon storage division
* Switch vm_object lock to be a rwlock.attilio2013-02-202-0/+4
| | | | | | | | * VM_OBJECT_LOCK and VM_OBJECT_UNLOCK are mapped to write operations * VM_OBJECT_SLEEP() is introduced as a general purpose primitve to get a sleep operation using a VM_OBJECT_LOCK() as protection * The approach must bear with vm_pager.h namespace pollution so many files require including directly rwlock.h
* Remove a racy checks on resident and cached pages forattilio2013-02-101-12/+0
| | | | | | | | | | | | | | | | tmpfs_mapped{read, write}() functions: - tmpfs_mapped{read, write}() are only called within VOP_{READ, WRITE}(), which check before-hand to work only on valid VREG vnodes. Also the vnode is locked for the duration of the work, making vnode reclaiming impossible, during the operation. Hence, vobj can never be NULL. - Currently check on resident pages and cached pages without vm object lock held is racy and can do even more harm than good, as a page could be transitioning between these 2 pools and then be skipped entirely. Skip the checks as lookups on empty splay trees are very cheap. Discussed with: alc Tested by: flo MFC after: 2 weeks
* tmpfs: Replace directory entry linked list with RB-Tree.gleb2013-01-064-312/+538
| | | | | | | | | | | | | | | | | | | | | Use file name hash as a tree key, handle duplicate keys. Both VOP_LOOKUP and VOP_READDIR operations utilize same tree for search. Directory entry offset (cookie) is either file name hash or incremental id in case of hash collisions (duplicate-cookies). Keep sorted per directory list of duplicate-cookie entries to facilitate cookie number allocation. Don't fail if previous VOP_READDIR() offset is no longer valid, start with next dirent instead. Other file system handle it similarly. Workaround race prone tn_readdir_last[pn] fields update. Add tmpfs_dir_destroy() to free all dirents. Set NFS cookies in tmpfs_dir_getdents(). Return EJUSTRETURN from tmpfs_dir_getdents() instead of hard coded -1. Mark directory traversal routines static as they are no longer used outside of tmpfs_subr.c
* 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.
* Fix up kernel sources to be ready for a 64-bit ino_t.mdf2012-09-271-1/+2
| | | | Original code by: Gleb Kurtsou
* After the PHYS_TO_VM_PAGE() function was de-inlined, the main reasonkib2012-08-052-0/+2
| | | | | | | | | | | | | to pull vm_param.h was removed. Other big dependency of vm_page.h on vm_param.h are PA_LOCK* definitions, which are only needed for in-kernel code, because modules use KBI-safe functions to lock the pages. Stop including vm_param.h into vm_page.h. Include vm_param.h explicitely for the kernel code which needs it. Suggested and reviewed by: alc MFC after: 2 weeks
* Remove unused thread argument to vrecycle().trasz2012-04-231-2/+1
| | | | Reviewed by: kib
OpenPOWER on IntegriCloud