s3: VFS: Change SMB_VFS_LINK to use const struct smb_filename * instead of const...
[samba.git] / source3 / include / g_lock.h
index f4b78094751b8cb35c378e0bd7c62489b7a475dc..e6d4de14cf37c143856fc1e31c3e6542f1b903d8 100644 (file)
 #include "dbwrap/dbwrap.h"
 
 struct g_lock_ctx;
+struct messaging_context;
 
 enum g_lock_type {
        G_LOCK_READ = 0,
        G_LOCK_WRITE = 1,
 };
 
-/*
- * Or'ed with g_lock_type
- */
-#define G_LOCK_PENDING (2)
+struct g_lock_rec {
+       enum g_lock_type lock_type;
+       struct server_id pid;
+};
 
 struct g_lock_ctx *g_lock_ctx_init(TALLOC_CTX *mem_ctx,
                                   struct messaging_context *msg);
 
+struct tevent_req *g_lock_lock_send(TALLOC_CTX *mem_ctx,
+                                   struct tevent_context *ev,
+                                   struct g_lock_ctx *ctx,
+                                   const char *name,
+                                   enum g_lock_type type);
+NTSTATUS g_lock_lock_recv(struct tevent_req *req);
 NTSTATUS g_lock_lock(struct g_lock_ctx *ctx, const char *name,
                     enum g_lock_type lock_type, struct timeval timeout);
 NTSTATUS g_lock_unlock(struct g_lock_ctx *ctx, const char *name);
-NTSTATUS g_lock_get(struct g_lock_ctx *ctx, const char *name,
-               struct server_id *pid);
+
+NTSTATUS g_lock_write_data(struct g_lock_ctx *ctx, const char *name,
+                          const uint8_t *buf, size_t buflen);
 
 NTSTATUS g_lock_do(const char *name, enum g_lock_type lock_type,
                   struct timeval timeout,
@@ -51,9 +59,11 @@ int g_lock_locks(struct g_lock_ctx *ctx,
                 int (*fn)(const char *name, void *private_data),
                 void *private_data);
 NTSTATUS g_lock_dump(struct g_lock_ctx *ctx, const char *name,
-                    int (*fn)(struct server_id pid,
-                              enum g_lock_type lock_type,
-                              void *private_data),
+                    void (*fn)(const struct g_lock_rec *locks,
+                               size_t num_locks,
+                               const uint8_t *data,
+                               size_t datalen,
+                               void *private_data),
                     void *private_data);
 
 #endif