aboutsummaryrefslogtreecommitdiff
path: root/libdiskfs/peropen-make.c
Commit message (Collapse)AuthorAgeFilesLines
* make_peropen: Fix memory leaks on errorSamuel Thibault2023-01-011-2/+9
|
* libdiskfs: Support for file record lockingNeal H Walfield2019-10-301-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2019-03-04 Svante Signell <svante.signell@gmail.com> * file-lock.c: Make flock work regardless of the mode in which the file was opened. 2019-02-12 Svante Signell <svante.signell@gmail.com> * file-lock.c: Comment out "Make flock work without R or W mode" 2019-02-01 Svante Signell <svante.signell@gmail.com> * Update copyright years. * file-record-lock.c(diskfs_S_file_record_lock): Don't set rendezvous to MACH_PORT_NULL. 2018-12-07 Svante Signell <svante.signell@gmail.com> * Update copyright years. * dir-lookup.c(diskfs_S_dir_lookup): Call fshelp_rlock_tweak() with new last argument rendezvous = MACH_PORT_NULL. * file-lock.c(diskfs_S_file_lock): Likewise. * file-record-lock.c(diskfs_S_file_record_lock): Likewise. (diskfs_S_file_record_lock): Add new argument mach_port_t rendezvous. 2017-01-05 Svante Signell <svante.signell@gmail.com> * Update copyright years and headers. 2016-05-23 Svante Signell <svante.signell@gmail.com> * file-lock-stat.c: Port from cthreads to libpthread. * file-lock.c: Likewise. * file-record-lock: Likewise. 2001-04-11 Neal H Walfield <neal@cs.uml.edu> * Makefile (FSSRCS): Add file-record-lock.c. * diskfs.h (struct peropen): Change the type of lock_status from an int to a struct rlock_peropen. (struct node): Change the type of userbox from a struct lock_box to a struct rlock_box. * dir-lookup.c (diskfs_S_dir_lookup): Use fshelp_rlock_tweak as fshelp_acquire_lock is now depreciated. * file-lock-stat.c (diskfs_S_file_lock_stat): Total rewrite around the new record locking functions. * file-lock.c (diskfs_S_file_lock): Total rewrite around the new record locking functions. * file-record-lock.c: New file. Implement diskfs_S_file_record_lock. * node-make.c (diskfs_make_node): Initialize userbox with fshelp_rlock_init. * peropen-make.c (diskfs_make_peropen): Initialize lock_status using fshelp_rlock_po_init. * peropen-rele.c (diskfs_release_peropen): Release lock_status using fshelp_rlock_drop_peropen.
* libdiskfs: fix reference counting of peropen objectsJustus Winter2014-08-311-1/+1
| | | | | | | | | | | | | | | | | | | Previously, peropen objects were created with a reference count of zero. Therefore, if diskfs_create_protid fails, passing such an object to diskfs_release_peropen would lead to a reference count underflow. * libdiskfs/peropen-make.c (diskfs_peropen_make): Initialize reference count to one. * libdiskfs/protid-make.c (diskfs_start_protid): And consume this reference on success. Update comment. (diskfs_create_protid): Update comment. * libdiskfs/diskfs.h: Update comments. * libdiskfs/io-duplicate.c (diskfs_S_io_duplicate): Adjust reference counting accordingly. * libdiskfs/io-reauthenticate.c (diskfs_S_io_reauthenticate): Likewise. * libdiskfs/io-restrict-auth.c (diskfs_S_io_restrict_auth): Likewise. * doc/hurd.texi (Diskfs Internals): Update accordingly.
* libdiskfs: lock-less reference counting for peropen objectsJustus Winter2014-05-261-1/+1
| | | | | | | | | * libdiskfs/diskfs.h (struct peropen): Use refcount_t for field refcnt. * libdiskfs/peropen-make.c (diskfs_make_peropen): Initialize refcnt. * libdiskfs/peropen-rele.c (diskfs_release_peropen): Adjust accordingly. * libdiskfs/protid-make.c (diskfs_start_protid): Likewise. Also, the node must no longer be locked, adjust comment accordingly. (diskfs_create_protid): Likewise.
* Fix ENOMEM handling in *_make_peropenSamuel Thibault2013-09-211-7/+7
| | | | | | | * libdiskfs/peropen-make.c (diskfs_make_peropen): Move `strdup` before port reference modifications, to fix abortion. * libnetfs/make-peropen.c (netfs_make_peropen): Check for `malloc` failure. Move `strdup` before port reference modifications, to fix abortion.
* libdiskfs: track file name in struct peropenJustus Winter2013-09-151-0/+8
| | | | | | | | | | | Track the relative path used to obtain a file handle in the struct peropen. * libdiskfs/diskfs.h (struct peropen): New field path. * libdiskfs/peropen-make.c (diskfs_make_peropen): Initialize path. * libdiskfs/peropen-rele.c (diskfs_release_peropen): Free path. * libdiskfs/fsys-getroot.c (diskfs_S_fsys_getroot): Initialize path. * libdiskfs/dir-lookup.c (diskfs_S_dir_lookup): Preserve the path.
* 2002-03-25 Neal H Walfield <neal@cs.uml.edu>Neal H. Walfield2002-03-261-6/+7
| | | | | | | | | | | | | | | | | | | | | | * peropen-make.c (diskfs_make_peropen): Instead of returning the peropen, return as error_t and return the peropen in the new parameter *PPO. * diskfs.h (diskfs_make_peropen): Change declaration to reflect new semantics. * boot-start.c (diskfs_start_bootstrap): Check the return value of diskfs_make_peropen using the new semantics. (diskfs_S_exec_startup_get_info): Likewise. (diskfs_execboot_fsys_startup): Likewise. (diskfs_S_fsys_init): Likewise. * dir-lookup.c (diskfs_S_dir_lookup): Likewise. * dir-mkfile.c (diskfs_S_dir_mkfile): Likewise. * file-exec.c (diskfs_S_file_exec): Likewise. * file-reparent.c (diskfs_S_file_reparent): Likewise. * fsys-getfile.c (diskfs_S_fsys_getfile): Likewise. * fsys-getroot.c (diskfs_S_fsys_getroot): Likewise. * trans-callback.c (_diskfs_translator_callback2_fn): Likewise. * init-startup.c (diskfs_startup_diskfs): Likewise.
* 2001-03-28 Neal H Walfield <neal@cs.uml.edu>Roland McGrath2001-04-011-1/+4
| | | | | | * dir-chg.c (diskfs_S_dir_notice_changes): Check what malloc returns. * peropen-make.c (diskfs_make_peropen): Likewise.
* Sat Feb 13 04:29:29 1999 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell1999-02-131-2/+2
| | | | | | * peropen-make.c (diskfs_make_peropen): If there is no existing context, then set the shadow_root iff we are a chrooted virtual root filesystem.
* (diskfs_make_peropen):Miles Bader1997-06-251-0/+6
| | | | Initialize the ROOT_PARENT, SHADOW_ROOT, and SHADOW_ROOT_PARENT fields.
* (diskfs_make_peropen):Miles Bader1997-02-141-7/+21
| | | | | Add & use CONTEXT param. Remove DOTDOT & DEPTH params.
* (diskfs_make_peropen):Miles Bader1997-02-061-2/+4
| | | | Add & use DEPTH argument.
* entered into RCSMichael I. Bushnell1994-07-201-2/+1
|
* Formerly peropen-make.c.~8~Michael I. Bushnell1994-07-191-1/+2
|
* Formerly peropen-make.c.~7~Michael I. Bushnell1994-07-131-1/+5
|
* Formerly peropen-make.c.~6~Michael I. Bushnell1994-03-031-0/+1
|
* Formerly peropen-make.c.~5~Michael I. Bushnell1994-02-171-1/+1
|
* Formerly peropen-make.c.~4~Michael I. Bushnell1994-02-171-2/+1
|
* Formerly peropen-make.c.~3~Michael I. Bushnell1994-02-081-0/+1
|
* Formerly peropen-make.c.~2~Michael I. Bushnell1994-02-071-1/+1
|
* Initial revisionMichael I. Bushnell1994-02-021-0/+33