summaryrefslogtreecommitdiffstats
path: root/source3/smbd/files.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-10-28 15:31:46 -0700
committerJeremy Allison <jra@samba.org>2014-12-04 05:45:10 +0100
commitb72fca52defa1fd0f7d10f2811d86bbc7c661f50 (patch)
treec2da897552f5ae95d221f36d26f14fc1b1f899bd /source3/smbd/files.c
parent7ca8785cae6529fe9b8f5546aaf3c15cca9458cd (diff)
downloadsamba-b72fca52defa1fd0f7d10f2811d86bbc7c661f50.tar.gz
samba-b72fca52defa1fd0f7d10f2811d86bbc7c661f50.tar.xz
samba-b72fca52defa1fd0f7d10f2811d86bbc7c661f50.zip
s3:smbd: add fsp_lease_type() and get_lease_type() helper functions
These convert the oplock state into SMB2_LEASE_ flags. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/smbd/files.c')
-rw-r--r--source3/smbd/files.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index 71166288a6..d866d6337c 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -745,3 +745,11 @@ const struct GUID *fsp_client_guid(const files_struct *fsp)
{
return &fsp->conn->sconn->client->connections->smb2.client.guid;
}
+
+uint32_t fsp_lease_type(struct files_struct *fsp)
+{
+ if (fsp->oplock_type == LEASE_OPLOCK) {
+ return fsp->lease->lease.lease_state;
+ }
+ return map_oplock_to_lease_type(fsp->oplock_type);
+}