]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:locking: move get_existing_share_mode_lock() to share_mode_lock.[ch]
authorStefan Metzmacher <metze@samba.org>
Thu, 18 Aug 2022 12:14:20 +0000 (14:14 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 19 Aug 2022 18:41:34 +0000 (18:41 +0000)
This should be where get_share_mode_lock() is located.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/locking/locking.c
source3/locking/proto.h
source3/locking/share_mode_lock.c
source3/locking/share_mode_lock.h
source3/smbd/smbd.h

index b002e80fee4b5043c32c97cc50501d0055f958e8..befdc10f369baa09ffbd46c2b9a38ff7795c903c 100644 (file)
@@ -468,17 +468,6 @@ char *share_mode_str(TALLOC_CTX *ctx, int num,
                 (unsigned int)e->name_hash);
 }
 
-/*******************************************************************
- Fetch a share mode where we know one MUST exist. This call reference
- counts it internally to allow for nested lock fetches.
-********************************************************************/
-
-struct share_mode_lock *get_existing_share_mode_lock(TALLOC_CTX *mem_ctx,
-                                                    const struct file_id id)
-{
-       return get_share_mode_lock(mem_ctx, id, NULL, NULL, NULL);
-}
-
 struct rename_share_filename_state {
        struct share_mode_lock *lck;
        struct messaging_context *msg_ctx;
index d6e7a54a7665c27b429e435ba1175daa28ca9313..52452e56a7b775bd1a71ba7bdc49800503897e3a 100644 (file)
@@ -128,8 +128,6 @@ void locking_close_file(files_struct *fsp,
 char *share_mode_str(TALLOC_CTX *ctx, int num,
                     const struct file_id *id,
                     const struct share_mode_entry *e);
-struct share_mode_lock *get_existing_share_mode_lock(TALLOC_CTX *mem_ctx,
-                                                    struct file_id id);
 
 bool rename_share_filename(struct messaging_context *msg_ctx,
                        struct share_mode_lock *lck,
index b3f30c0f5128977fbbec75761a62dbe3d620f4ae..75912ec5dc86127580810ad945f9a561508385b5 100644 (file)
@@ -1005,6 +1005,17 @@ static int share_mode_lock_destructor(struct share_mode_lock *lck)
        return 0;
 }
 
+/*******************************************************************
+ Fetch a share mode where we know one MUST exist. This call reference
+ counts it internally to allow for nested lock fetches.
+********************************************************************/
+
+struct share_mode_lock *get_existing_share_mode_lock(TALLOC_CTX *mem_ctx,
+                                                    const struct file_id id)
+{
+       return get_share_mode_lock(mem_ctx, id, NULL, NULL, NULL);
+}
+
 struct share_mode_do_locked_state {
        TDB_DATA key;
        void (*fn)(const uint8_t *buf,
index f8693b14b547d89722b8291ce6be28e319965689..4f47b6fbcbe5203cd719eda3d6e710f889a6120b 100644 (file)
@@ -38,6 +38,8 @@ struct share_mode_lock *get_share_mode_lock(
        const char *servicepath,
        const struct smb_filename *smb_fname,
        const struct timespec *old_write_time);
+struct share_mode_lock *get_existing_share_mode_lock(TALLOC_CTX *mem_ctx,
+                                                    struct file_id id);
 
 bool del_share_mode(struct share_mode_lock *lck,
                    struct files_struct *fsp);
index f2c3abcda2d0ec2cd656a1e269a53b358a4e20b6..6cf2b64a5a15195393ecdbadb8891545c62a9794 100644 (file)
@@ -25,6 +25,7 @@ struct dptr_struct;
 #include "vfs.h"
 #include "smbd/proto.h"
 #include "locking/proto.h"
+#include "locking/share_mode_lock.h"
 #include "smbd/fd_handle.h"
 #if defined(WITH_SMB1SERVER)
 #include "smbd/smb1_message.h"