opendb: only return delete_on_close on odb_get_delete_on_close()
authorStefan Metzmacher <metze@samba.org>
Wed, 27 Feb 2008 21:16:55 +0000 (22:16 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 28 Feb 2008 07:11:04 +0000 (08:11 +0100)
metze

source/cluster/ctdb/opendb_ctdb.c
source/ntvfs/common/opendb.c
source/ntvfs/common/opendb.h
source/ntvfs/common/opendb_tdb.c

index 3f6c8a2343fecbd73a99d75bf592acaeb4c9b8ef..3d67162d6dae2360bc7517f590542d99dd48c2e3 100644 (file)
@@ -563,20 +563,20 @@ static NTSTATUS odb_ctdb_set_delete_on_close(struct odb_lock *lck, bool del_on_c
   people still have the file open
 */
 static NTSTATUS odb_ctdb_get_delete_on_close(struct odb_context *odb, 
-                                           DATA_BLOB *key, bool *del_on_close, 
-                                           int *open_count, char **path)
+                                           DATA_BLOB *key, bool *del_on_close)
 {
        NTSTATUS status;
        struct opendb_file file;
        struct odb_lock *lck;
 
+       (*del_on_close) = false;
+
        lck = odb_lock(odb, odb, key);
        NT_STATUS_HAVE_NO_MEMORY(lck);
 
        status = odb_pull_record(lck, &file);
        if (NT_STATUS_EQUAL(NT_STATUS_OBJECT_NAME_NOT_FOUND, status)) {
                talloc_free(lck);
-               (*del_on_close) = false;
                return NT_STATUS_OK;
        }
        if (!NT_STATUS_IS_OK(status)) {
@@ -585,16 +585,6 @@ static NTSTATUS odb_ctdb_get_delete_on_close(struct odb_context *odb,
        }
 
        (*del_on_close) = file.delete_on_close;
-       if (open_count != NULL) {
-               (*open_count) = file.num_entries;
-       }
-       if (path != NULL) {
-               *path = talloc_strdup(odb, file.path);
-               NT_STATUS_HAVE_NO_MEMORY(*path);
-               if (file.num_entries == 1 && file.entries[0].delete_on_close) {
-                       (*del_on_close) = true;
-               }
-       }
 
        talloc_free(lck);
 
index 0b11f9dac5306b0c8e841d87e4fb8d06e3df8b15..d8cb67686b9221ff3938e7fc9e0e8b407fdf5fa9 100644 (file)
@@ -155,10 +155,9 @@ _PUBLIC_ NTSTATUS odb_set_delete_on_close(struct odb_lock *lck, bool del_on_clos
   people still have the file open
 */
 _PUBLIC_ NTSTATUS odb_get_delete_on_close(struct odb_context *odb, 
-                                         DATA_BLOB *key, bool *del_on_close, 
-                                         int *open_count, char **path)
+                                         DATA_BLOB *key, bool *del_on_close)
 {
-       return ops->odb_get_delete_on_close(odb, key, del_on_close, open_count, path);
+       return ops->odb_get_delete_on_close(odb, key, del_on_close);
 }
 
 
index c736c25a8de9d0d416deed089d55bae69b24ca39..33f2e1c88d21a9fdf59b5e784ba5a32430de6c68 100644 (file)
@@ -38,8 +38,7 @@ struct opendb_ops {
        NTSTATUS (*odb_rename)(struct odb_lock *lck, const char *path);
        NTSTATUS (*odb_set_delete_on_close)(struct odb_lock *lck, bool del_on_close);
        NTSTATUS (*odb_get_delete_on_close)(struct odb_context *odb, 
-                                           DATA_BLOB *key, bool *del_on_close, 
-                                           int *open_count, char **path);
+                                           DATA_BLOB *key, bool *del_on_close);
        NTSTATUS (*odb_can_open)(struct odb_lock *lck,
                                 uint32_t stream_id, uint32_t share_access,
                                 uint32_t access_mask, bool delete_on_close,
index f0269db5271b49a4f47ed63acf0964f156c0889d..37c1c0850b1d9e69681d3c9a3c9b6ff6b165100f 100644 (file)
@@ -734,20 +734,20 @@ static NTSTATUS odb_tdb_set_delete_on_close(struct odb_lock *lck, bool del_on_cl
   people still have the file open
 */
 static NTSTATUS odb_tdb_get_delete_on_close(struct odb_context *odb, 
-                                           DATA_BLOB *key, bool *del_on_close, 
-                                           int *open_count, char **path)
+                                           DATA_BLOB *key, bool *del_on_close)
 {
        NTSTATUS status;
        struct opendb_file file;
        struct odb_lock *lck;
 
+       (*del_on_close) = false;
+
        lck = odb_lock(odb, odb, key);
        NT_STATUS_HAVE_NO_MEMORY(lck);
 
        status = odb_pull_record(lck, &file);
        if (NT_STATUS_EQUAL(NT_STATUS_OBJECT_NAME_NOT_FOUND, status)) {
                talloc_free(lck);
-               (*del_on_close) = false;
                return NT_STATUS_OK;
        }
        if (!NT_STATUS_IS_OK(status)) {
@@ -756,16 +756,6 @@ static NTSTATUS odb_tdb_get_delete_on_close(struct odb_context *odb,
        }
 
        (*del_on_close) = file.delete_on_close;
-       if (open_count != NULL) {
-               (*open_count) = file.num_entries;
-       }
-       if (path != NULL) {
-               *path = talloc_strdup(odb, file.path);
-               NT_STATUS_HAVE_NO_MEMORY(*path);
-               if (file.num_entries == 1 && file.entries[0].delete_on_close) {
-                       (*del_on_close) = true;
-               }
-       }
 
        talloc_free(lck);