summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2016-05-12 21:03:57 +0200
committerJeremy Allison <jra@samba.org>2016-05-21 01:28:28 +0200
commitda9b7056fcd6f68795db3a28564fca8bd8eb8605 (patch)
tree1e8fad6d58587f1e1434a25181664ada8450897a /source3/locking
parentbb93b24b18f02507f7a8714bb7a79b2a763aaa1a (diff)
downloadsamba-da9b7056fcd6f68795db3a28564fca8bd8eb8605.tar.gz
s3: VFS: Add bool use_ofd_locks member to struct files_struct.
Not yet used. We will set this if we translate a process-associated lock operation to a open file description lock operation. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Jeff Layton <jlayton@samba.org>
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/posix.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/locking/posix.c b/source3/locking/posix.c
index 0c729adc703..f3a89fdf508 100644
--- a/source3/locking/posix.c
+++ b/source3/locking/posix.c
@@ -591,12 +591,13 @@ int fd_close_posix(const struct files_struct *fsp)
size_t count, i;
if (!lp_locking(fsp->conn->params) ||
- !lp_posix_locking(fsp->conn->params))
+ !lp_posix_locking(fsp->conn->params) ||
+ fsp->use_ofd_locks)
{
/*
- * No locking or POSIX to worry about or we want POSIX semantics
- * which will lose all locks on all fd's open on this dev/inode,
- * just close.
+ * No locking or POSIX to worry about or we are using POSIX
+ * open file description lock semantics which only removes
+ * locks on the file descriptor we're closing. Just close.
*/
return close(fsp->fh->fd);
}