smbd: Remove byte_range_lock->read_only
authorVolker Lendecke <vl@samba.org>
Wed, 11 Sep 2013 11:54:37 +0000 (11:54 +0000)
committerStefan Metzmacher <metze@samba.org>
Sun, 6 Oct 2013 20:20:05 +0000 (22:20 +0200)
With the rewritten brl_get_lock_readonly we only set the destructor for
r/w lock records anyway.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sun Oct  6 22:20:05 CEST 2013 on sn-devel-104

source3/locking/brlock.c

index 78315bc7f9d8e2e82a53b5d0a3505d4ee2abe207..0d45501453adb2c37bfa793c469fdd428c172762 100644 (file)
@@ -47,7 +47,6 @@ struct byte_range_lock {
        struct files_struct *fsp;
        unsigned int num_locks;
        bool modified;
-       bool read_only;
        struct lock_struct *lock_data;
        struct db_record *record;
 };
@@ -1879,10 +1878,6 @@ int brl_forall(void (*fn)(struct file_id id, struct server_id pid,
 
 static void byte_range_lock_flush(struct byte_range_lock *br_lck)
 {
-       if (br_lck->read_only) {
-               SMB_ASSERT(!br_lck->modified);
-       }
-
        if (!br_lck->modified) {
                goto done;
        }
@@ -1910,10 +1905,7 @@ static void byte_range_lock_flush(struct byte_range_lock *br_lck)
        }
 
  done:
-
-       br_lck->read_only = true;
        br_lck->modified = false;
-
        TALLOC_FREE(br_lck->record);
 }
 
@@ -1961,7 +1953,6 @@ struct byte_range_lock *brl_get_locks(TALLOC_CTX *mem_ctx, files_struct *fsp)
                return NULL;
        }
 
-       br_lck->read_only = false;
        br_lck->lock_data = NULL;
 
        talloc_set_destructor(br_lck, byte_range_lock_destructor);
@@ -2119,7 +2110,6 @@ struct byte_range_lock *brl_get_locks_readonly(files_struct *fsp)
 
        br_lock->fsp = fsp;
        br_lock->modified = false;
-       br_lock->read_only = true;
        br_lock->record = NULL;
 
        if (lp_clustering()) {