summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-11-13 21:51:06 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-11-13 21:51:06 +0000
commit316fd871634d7fda6e6cf08ec5a4cb5f1d6d0760 (patch)
tree1e668c642796f32093754ef0e5b349bbfabf9bc6 /libdiskfs
parent736a7c7c58d4aa31d594579071390e930a982618 (diff)
(diskfs_S_file_lock_stat): Lock around reads to make sure they are
mutually consistent.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/file-lock-stat.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libdiskfs/file-lock-stat.c b/libdiskfs/file-lock-stat.c
index ce291b76..75341617 100644
--- a/libdiskfs/file-lock-stat.c
+++ b/libdiskfs/file-lock-stat.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1994 Free Software Foundation
+ Copyright (C) 1994, 1995 Free Software Foundation
This file is part of the GNU Hurd.
@@ -30,7 +30,9 @@ diskfs_S_file_lock_stat (struct protid *cred,
if (!cred)
return EOPNOTSUPP;
+ mutex_lock (&cred->po->np->lock);
*mystatus = cred->po->lock_status;
*otherstatus = cred->po->np->userlock.type;
+ mutex_unlock (&cred->po->np->lock);
return 0;
}