Add some helper functions that will be used to update a bunch of checks
for exclusive oplocks to the lease area.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=12766
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit
f631e95e2de857ea98204609a71e6db00993994b)
}
return map_oplock_to_lease_type(fsp->oplock_type);
}
+
+uint32_t lease_type_is_exclusive(uint32_t lease_type)
+{
+ if ((lease_type & (SMB2_LEASE_READ | SMB2_LEASE_WRITE)) ==
+ (SMB2_LEASE_READ | SMB2_LEASE_WRITE)) {
+ return true;
+ }
+
+ return false;
+}
+
+bool fsp_lease_type_is_exclusive(const struct files_struct *fsp)
+{
+ uint32_t lease_type = fsp_lease_type(fsp);
+
+ return lease_type_is_exclusive(lease_type);
+}
/* The following definitions come from locking/leases_util.c */
uint32_t map_oplock_to_lease_type(uint16_t op_type);
uint32_t fsp_lease_type(const struct files_struct *fsp);
+uint32_t lease_type_is_exclusive(uint32_t lease_type);
+bool fsp_lease_type_is_exclusive(const struct files_struct *fsp);
#endif /* _LOCKING_PROTO_H_ */