diff options
author | Thomas Bushnell <thomas@gnu.org> | 1996-10-10 21:13:37 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1996-10-10 21:13:37 +0000 |
commit | 3cabe8d87469422c549d61e7845cc044fe72c660 (patch) | |
tree | 96ee2f26536f1264bd6dbbfff95444137b69e6a8 | |
parent | d20d69575f684bf4c355521006a6c9686340d5cf (diff) |
*** empty log message ***
-rw-r--r-- | libdiskfs/ChangeLog | 5 | ||||
-rw-r--r-- | libdiskfs/dir-lookup.c | 17 | ||||
-rw-r--r-- | libfshelp/ChangeLog | 5 | ||||
-rw-r--r-- | libfshelp/lock-acquire.c | 6 |
4 files changed, 28 insertions, 5 deletions
diff --git a/libdiskfs/ChangeLog b/libdiskfs/ChangeLog index 64116b74..0ee2d73c 100644 --- a/libdiskfs/ChangeLog +++ b/libdiskfs/ChangeLog @@ -1,3 +1,8 @@ +Thu Oct 10 17:11:05 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * dir-lookup.c (diskfs_S_dir_lookup): Implement O_SHLOCK and + O_EXLOCK directly here. + Thu Oct 10 10:53:28 1996 Miles Bader <miles@gnu.ai.mit.edu> * peropen-rele.c (diskfs_release_peropen): Before freeing PO, diff --git a/libdiskfs/dir-lookup.c b/libdiskfs/dir-lookup.c index 36f2bceb..272b8bd8 100644 --- a/libdiskfs/dir-lookup.c +++ b/libdiskfs/dir-lookup.c @@ -397,16 +397,27 @@ diskfs_S_dir_lookup (struct protid *dircred, if ((flags & O_NOATIME) && (diskfs_isowner (np, dircred) == EPERM)) flags &= ~O_NOATIME; - - flags &= ~OPENONLY_STATE_MODES; - error = diskfs_create_protid (diskfs_make_peropen (np, flags, + error = diskfs_create_protid (diskfs_make_peropen (np, + (flags + & OPENONLY_STATE_MODES), dircred->po->dotdotport), dircred->uids, dircred->nuids, dircred->gids, dircred->ngids, &newpi); + if (! error) { + if (flags & O_EXLOCK) + error = fshelp_acquire_lock (&np->userlock, &po->lock_status, + &np->lock, LOCK_EX); + else if (flags & O_SHLOCK) + error = fshelp_acquire_lock (&np->userlock, &po->lock_status, + &np->lock, LOCK_SH); + } + + if (!error) + { *returned_port = ports_get_right (newpi); ports_port_deref (newpi); } diff --git a/libfshelp/ChangeLog b/libfshelp/ChangeLog index a7cd8b0e..997b1a3b 100644 --- a/libfshelp/ChangeLog +++ b/libfshelp/ChangeLog @@ -1,3 +1,8 @@ +Thu Oct 10 17:12:19 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * lock-acquire.c (fshelp_acquire_lock): Use hurd_condition_wait so + we are properly interruptible. + Thu Sep 12 16:21:51 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> * Makefile (HURDLIBS): New variable. diff --git a/libfshelp/lock-acquire.c b/libfshelp/lock-acquire.c index 9c81634a..42e75dd0 100644 --- a/libfshelp/lock-acquire.c +++ b/libfshelp/lock-acquire.c @@ -80,7 +80,8 @@ fshelp_acquire_lock (struct lock_box *box, int *user, struct mutex *mut, if (flags & LOCK_NB) return EWOULDBLOCK; box->waiting = 1; - condition_wait (&box->wait, mut); + if (hurd_condition_wait (&box->wait, mut)) + return EINTR; } /* If we have a shared lock, release it. */ @@ -116,7 +117,8 @@ fshelp_acquire_lock (struct lock_box *box, int *user, struct mutex *mut, else { box->waiting = 1; - condition_wait (&box->wait, mut); + if (hurd_condition_wait (&box->wait, mut)) + return EINTR; } } box->type = LOCK_EX; |