opendb: unify the parameters of odb_open_file() and odb_can_open()
authorStefan Metzmacher <metze@samba.org>
Mon, 25 Feb 2008 16:48:13 +0000 (17:48 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 26 Feb 2008 08:32:56 +0000 (09:32 +0100)
metze
(This used to be commit e6b708a52b0eada3fd374b66292ded3b0f6ce217)

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

index 36ae204974f40c06ad5f598cf00915e66fbb8eca..3dfc6819b7c09bbdcd02da250cc6305e43a6fed7 100644 (file)
@@ -596,8 +596,9 @@ static NTSTATUS odb_ctdb_get_delete_on_close(struct odb_context *odb,
   create_options and access_mask
 */
 static NTSTATUS odb_ctdb_can_open(struct odb_lock *lck,
-                                uint32_t share_access, uint32_t create_options, 
-                                uint32_t access_mask)
+                                 uint32_t stream_id, uint32_t share_access,
+                                 uint32_t access_mask, bool delete_on_close,
+                                 uint32_t open_disposition, bool break_to_none)
 {
        struct odb_context *odb = lck->odb;
        NTSTATUS status;
@@ -611,7 +612,7 @@ static NTSTATUS odb_ctdb_can_open(struct odb_lock *lck,
        }
        NT_STATUS_NOT_OK_RETURN(status);
 
-       if ((create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE) && 
+       if (delete_on_close &&
            file.num_entries != 0) {
                return NT_STATUS_SHARING_VIOLATION;
        }
index c3803554669dd7f4e4a581f21645437efb0e316c..36144d0406b09a20cb1c1d62f6ce5323e91be0f7 100644 (file)
@@ -166,10 +166,12 @@ _PUBLIC_ NTSTATUS odb_get_delete_on_close(struct odb_context *odb,
   create_options and access_mask
 */
 _PUBLIC_ NTSTATUS odb_can_open(struct odb_lock *lck,
-                              uint32_t share_access, uint32_t create_options, 
-                              uint32_t access_mask)
+                              uint32_t stream_id, uint32_t share_access,
+                              uint32_t access_mask, bool delete_on_close,
+                              uint32_t open_disposition, bool break_to_none)
 {
-       return ops->odb_can_open(lck, share_access, create_options, access_mask);
+       return ops->odb_can_open(lck, stream_id, share_access, access_mask,
+                                delete_on_close, open_disposition, break_to_none);
 }
 
 _PUBLIC_ NTSTATUS odb_update_oplock(struct odb_lock *lck, void *file_handle,
index 205d2228ea1fe9ec28d376f99963cea19c3d0d22..9591bcf6b9b38817b34cd0262488fabf952d6131 100644 (file)
@@ -40,8 +40,9 @@ struct opendb_ops {
                                            DATA_BLOB *key, bool *del_on_close, 
                                            int *open_count, char **path);
        NTSTATUS (*odb_can_open)(struct odb_lock *lck,
-                                uint32_t share_access, uint32_t create_options, 
-                                uint32_t access_mask);
+                                uint32_t stream_id, uint32_t share_access,
+                                uint32_t access_mask, bool delete_on_close,
+                                uint32_t open_disposition, bool break_to_none);
        NTSTATUS (*odb_update_oplock)(struct odb_lock *lck, void *file_handle,
                                      uint32_t oplock_level);
        NTSTATUS (*odb_break_oplocks)(struct odb_lock *lck);
index d41a5c371eec8088f5b73e5775d53a8f4768a193..73c04b7c4f3ffae9154df737fd9af37202531b3c 100644 (file)
@@ -742,16 +742,13 @@ static NTSTATUS odb_tdb_get_delete_on_close(struct odb_context *odb,
   create_options and access_mask
 */
 static NTSTATUS odb_tdb_can_open(struct odb_lock *lck,
-                                uint32_t share_access, uint32_t create_options, 
-                                uint32_t access_mask)
+                                uint32_t stream_id, uint32_t share_access,
+                                uint32_t access_mask, bool delete_on_close,
+                                uint32_t open_disposition, bool break_to_none)
 {
        struct odb_context *odb = lck->odb;
        NTSTATUS status;
        struct opendb_file file;
-       uint32_t stream_id = 0;
-       uint32_t open_disposition = 0;
-       bool delete_on_close = false;
-       bool break_to_none = false;
        bool attrs_only = false;
 
        status = odb_pull_record(lck, &file);
@@ -760,10 +757,6 @@ static NTSTATUS odb_tdb_can_open(struct odb_lock *lck,
        }
        NT_STATUS_NOT_OK_RETURN(status);
 
-       if (create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE) {
-               delete_on_close = true;
-       }
-
        status = odb_tdb_open_can_internal(odb, &file, stream_id,
                                           share_access, access_mask,
                                           delete_on_close, open_disposition,