From: Volker Lendecke Date: Mon, 10 Sep 2018 12:50:40 +0000 (+0200) Subject: smbd: Simplify share_mode_lock.c X-Git-Tag: tdb-1.3.17~1622 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9e515f7c66d950be0ad3839c50fff1329aebc002;p=thirdparty%2Fsamba.git smbd: Simplify share_mode_lock.c "the_lock_id" is not required here. The share mode data carry the file id, so use that. Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c index 6fe75490d3b..2850e502bda 100644 --- a/source3/locking/share_mode_lock.c +++ b/source3/locking/share_mode_lock.c @@ -560,12 +560,10 @@ static struct share_mode_lock *get_share_mode_lock_internal( * talloc_reference. */ static struct share_mode_lock *the_lock; -static struct file_id the_lock_id; static int the_lock_destructor(struct share_mode_lock *l) { the_lock = NULL; - ZERO_STRUCT(the_lock_id); return 0; } @@ -595,9 +593,8 @@ struct share_mode_lock *get_share_mode_lock( goto fail; } talloc_set_destructor(the_lock, the_lock_destructor); - the_lock_id = id; } else { - if (!file_id_equal(&the_lock_id, &id)) { + if (!file_id_equal(&the_lock->data->id, &id)) { DEBUG(1, ("Can not lock two share modes " "simultaneously\n")); goto fail;