aboutsummaryrefslogtreecommitdiff
path: root/tmpfs/node.c
Commit message (Collapse)AuthorAgeFilesLines
* Correct handling of object size.Maksym Planeta2012-04-021-9/+4
| | | | | | | | * tmpfs/node.c (diskfs_truncate): Pass the original (non-rounded) size to default_pager_object_set_size. (diskfs_grow): Likewise. (diskfs_get_filemap): Do not set object size, as default_pager_object_create already sets it.
* Correct available space check.Maksym Planeta2012-03-261-1/+2
| | | | | *tmpfs/node.c (diskfs_grow): Parameter size denotes new size, not delta. So available space check should take that into account.
* Fix symlink support in tmpfsBen Asselstine2011-11-201-3/+5
| | | | | | * node.c (create_symlink_hook): Set NP->dn_stat.st_size to the length of TARGET. (create_symlink_hook): Set NP->dn->type to DT_LNK. (diskfs_truncate): Do NP->allocsize check after symlink check.
* Work with memory object only after vm_map has been performedMaksym Planeta2011-11-201-5/+6
| | | | | * tmpfs/node.c (diskfs_get_filemap): Work with memory object only after vm_map has been performed.
* Fix comment on when Mach would try to clear tmpfs dataSamuel Thibault2010-08-271-1/+1
| | | | | * tmpfs/node.c (diskfs_get_filemap): Fix comment according to second patch from Sergio Lopez.
* Keep a reference on objects to preserve their content.Samuel Thibault2010-08-271-1/+10
| | | | | | | | | | | Modify tmpfs to keep a reference (by mapping it into its own space) to each memory object created by the user, so they don't get inmediately terminated at the end of the current operation. * tmpfs/tmpfs.h (struct disknode): Add `memref' field. * tmpfs/node.c (diskfs_get_filemap): vm_map() the first page of the newly-allocated object, store in `memref' field. (diskfs_free_node) vm_deallocate the page pointed by `memref' field.
* [ftpfs]Samuel Thibault2009-02-021-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-02-02 Samuel Thibault <samuel.thibault@ens-lyon.org> * dir.c (ftpfs_refresh_node): Use st_mtim.tv_sec members instead of st_mtime. Also compare st_mtim.tv_nsec members. [libdiskfs] 2009-02-02 Samuel Thibault <samuel.thibault@ens-lyon.org> * file-utimes.c (diskfs_S_file_utimes): Use st_atim.tv_sec/ st_mtim.tv_sec members instead of st_atime/st_mtime. Also set st_atim.tv_nsec/st_mtim.tv_nsec members. [libftpconn] 2009-02-02 Samuel Thibault <samuel.thibault@ens-lyon.org> * unix.c (parse_dir_entry): Use st_mtim.tv_sec instead of st_mtime. Set st_atim.tv_nsec, st_ctim.tv_nsec and st_mtim.tv_nsec to 0. [login] 2009-02-02 Samuel Thibault <samuel.thibault@ens-lyon.org> * utmp.c (S_login_get_idle_time): Use st_atim.tv_sec and st_atim.tv_nsec members instead of st_atime and st_atime_usec. [tmpfs] 2009-02-02 Samuel Thibault <samuel.thibault@ens-lyon.org> * tmpfs.h (struct disknode): Make atime, mtime and ctime members struct timespec instead of time_t. * tmpfs.c (main): Copy st_atim/st_mtim/st_ctim members from st to diskfs_root_node->dn_stat instead of st_atime/st_mtime/st_ctime. * node.c (diskfs_node_norefs): Copy st_atime/st_mtime/st_ctime members from np->dn_stat to atime/mtime/ctime members of np->dn (diskfs_cached_lookup): Conversely.
* 2002-06-08 Roland McGrath <roland@frob.com>Roland McGrath2002-06-111-5/+5
| | | | | | | * node.c (diskfs_cached_lookup): Use ino_t for argument. * node.c (diskfs_alloc_node): Case to uintptr_t before ino_t. (diskfs_cached_lookup): Likewise, and vice versa. * dir.c (diskfs_get_directs, diskfs_lookup_hard): Likewise.
* 2002-05-29 Roland McGrath <roland@frob.com>Roland McGrath2002-06-021-3/+3
| | | | | * node.c (diskfs_S_file_get_storage_info): Return a null port when the peropen is not open for read/write. Set STORE_READONLY if O_WRITE set.
* 2002-03-23 Roland McGrath <roland@frob.com>Roland McGrath2002-03-241-7/+30
| | | | | | | * node.c: Include "default_pager_U.h", not <mach/default_pager.h>. (diskfs_truncate): Return early if page-rounded size is unchanged. Call default_pager_object_set_size on the memory object. (diskfs_grow): Likewise.
* 2001-09-30 Roland McGrath <roland@frob.com>Roland McGrath2001-10-011-1/+30
| | | | | * node.c (diskfs_S_file_get_storage_info): Implement it to return the memory object port with STORAGE_MEMORY.
* 2001-05-05 Roland McGrath <roland@frob.com>Roland McGrath2001-05-061-1/+2
| | | | | * node.c (diskfs_truncate): Set st_size before rounding it up, and do set it when there is a memory object.
* 2001-04-15 Neal H Walfield <neal@cs.uml.edu>Roland McGrath2001-04-151-8/+14
| | | | | | | | | | | | | | | | | * dir.c (diskfs_get_directs): Total rewrite. (diskfs_lookup_hard): Likewise. (diskfs_enter_hard): Count node size in the size of the dirent so diskfs_get_directs does not have to guess; this is only a few bytes different. Check the amount of space correctly, i.e. we cannot compare bytes and pages. * node.c: (diskfs_free_node): We already hold diskfs_node_refcnt_lock; do not try to lock it again. (diskfs_cached_lookup): Use diskfs_nref, that is why we have it. Link the nodes correctly. (diskfs_set_translator): Add or remove S_IPTRANS from np->dn_stat.st_mode as appropriate. (diskfs_truncate): Set the new np->dn_stat.st_size. (diskfs_grow): Move the assert up.
* 2001-02-26 Roland McGrath <roland@frob.com>Roland McGrath2001-02-261-2/+12
| | | | | | | | * node.c (diskfs_free_node): Reset hnext's hprevp. (diskfs_node_norefs): Likewise. (diskfs_cached_lookup): Fix insane code for finding existing node ptr. (diskfs_get_filemap_pager_struct): Remove spurious assert. (diskfs_get_filemap): Always add a reference to the send right.
* 2001-02-26 Roland McGrath <roland@frob.com>Roland McGrath2001-02-261-2/+6
| | | | | | * node.c (diskfs_free_node): Reset hnext's hprevp. (diskfs_node_norefs): Likewise. (diskfs_cached_lookup): Fix insane code for finding existing node ptr.
* 2001-02-25 Roland McGrath <roland@frob.com>Roland McGrath2001-02-261-3/+16
| | | | | | * node.c (diskfs_S_file_get_storage_info): New function. * tmpfs.c (diskfs_synchronous): New variable. * node.c: #include <mach/default_pager.h>.
* 2000-12-30 Marcus Brinkmann <marcus@gnu.org>Marcus Brinkmann2000-12-301-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | * dir.c: Include <stddef.h>, <unistd.h>, <sys/mman.h> (diskfs_get_directs): Cast *data to struct dirent *. * node.c: Include <stddef.h>. (diskfs_alloc_node): Remove unused variables err, st, np. (diskfs_free_node): Use *np->dn, not *dn to calculate used space. (recompute_blocks): Replace DT_DEV with DT_BLK. (diskfs_node_norefs): Likewise. (recompute_blocks): Take address of np->dn_stat for pointer st. (diskfs_cached_lookup): New variable st. (diskfs_cached_lookup): Set st to &np->dn_stat, not &dn->dn_stat. (create_symlink_hook): Fix malloc call and return code check. (read_symlink_hook): Return 0. * tmpfs.c: Include <argp.h>, <string.h>, <inttypes.h>, <argz.h>, <error.h>. (parse_opt): Reverse second and third argument of strtoimax call. * tmpfs.h (struct disknode): Remove blind passenger (unnamed copy of anonymous struct {} reg). Some of the above were also reported by Alexey Dejneka <adejneka@comail.ru>.
* 2000-12-28 Roland McGrath <roland@frob.com>Roland McGrath2000-12-291-30/+40
| | | | | | | * node.c (recompute_blocks): New function, broken out of ... (diskfs_cached_lookup): here. Now use call that. (diskfs_set_translator): Likewise. (create_symlink_hook): Likewise. Do nothing for zero-length target.
* New directory tmpfs, in-core filesystem based on libdiskfsRoland McGrath2000-12-271-0/+484