From 27e322bb4d5a25a2a1ebc5df36690590d86e3afd Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 22 Feb 2008 10:18:13 +0100 Subject: opendb: add odb_get_key() function to get the key back from a struct odb_lock metze (This used to be commit 11f35a2a4d383b506ced35ba06120f9531bac70c) --- source4/cluster/ctdb/opendb_ctdb.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source4/cluster/ctdb/opendb_ctdb.c') diff --git a/source4/cluster/ctdb/opendb_ctdb.c b/source4/cluster/ctdb/opendb_ctdb.c index aaab3aa55d..f056e21716 100644 --- a/source4/cluster/ctdb/opendb_ctdb.c +++ b/source4/cluster/ctdb/opendb_ctdb.c @@ -133,6 +133,16 @@ static struct odb_lock *odb_ctdb_lock(TALLOC_CTX *mem_ctx, return lck; } +static DATA_BLOB odb_ctdb_get_key(TALLOC_CTX *mem_ctx, struct odb_lock *lck) +{ + /* + * as this file will went away and isn't used yet, + * copy the implementation from the tdb backend + * --metze + */ + return data_blob_const(NULL, 0); +} + /* determine if two odb_entry structures conflict @@ -610,6 +620,7 @@ static NTSTATUS odb_ctdb_can_open(struct odb_lock *lck, static const struct opendb_ops opendb_ctdb_ops = { .odb_init = odb_ctdb_init, .odb_lock = odb_ctdb_lock, + .odb_get_key = odb_ctdb_get_key, .odb_open_file = odb_ctdb_open_file, .odb_open_file_pending = odb_ctdb_open_file_pending, .odb_close_file = odb_ctdb_close_file, -- cgit From 71943b209b181e1e4a65ab477b83780add7051ae Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 21 Feb 2008 16:12:27 +0100 Subject: opendb: add odb_update_oplock() call metze (This used to be commit df576d69c6981a4879a0e9447069fcfacb3588db) --- source4/cluster/ctdb/opendb_ctdb.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'source4/cluster/ctdb/opendb_ctdb.c') diff --git a/source4/cluster/ctdb/opendb_ctdb.c b/source4/cluster/ctdb/opendb_ctdb.c index f056e21716..86dc1f50f1 100644 --- a/source4/cluster/ctdb/opendb_ctdb.c +++ b/source4/cluster/ctdb/opendb_ctdb.c @@ -450,6 +450,19 @@ static NTSTATUS odb_ctdb_close_file(struct odb_lock *lck, void *file_handle) return odb_push_record(lck, &file); } +/* + update the oplock level of the client +*/ +static NTSTATUS odb_ctdb_update_oplock(struct odb_lock *lck, void *file_handle, + uint32_t oplock_level) +{ + /* + * as this file will went away and isn't used yet, + * copy the implementation from the tdb backend + * --metze + */ + return NT_STATUS_FOOBAR; +} /* remove a pending opendb entry @@ -628,7 +641,8 @@ static const struct opendb_ops opendb_ctdb_ops = { .odb_rename = odb_ctdb_rename, .odb_set_delete_on_close = odb_ctdb_set_delete_on_close, .odb_get_delete_on_close = odb_ctdb_get_delete_on_close, - .odb_can_open = odb_ctdb_can_open + .odb_can_open = odb_ctdb_can_open, + .odb_update_oplock = odb_ctdb_update_oplock }; -- cgit From f94008e45a15666439766488edf84b21a86111ee Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 22 Feb 2008 16:30:13 +0100 Subject: opendb: add odb_break_oplocks() function This send breaks to none to all level2 holders metze (This used to be commit bd3654500b14e4ed8d4a8bb25ff9da5035a16a8b) --- source4/cluster/ctdb/opendb_ctdb.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source4/cluster/ctdb/opendb_ctdb.c') diff --git a/source4/cluster/ctdb/opendb_ctdb.c b/source4/cluster/ctdb/opendb_ctdb.c index 86dc1f50f1..915b760424 100644 --- a/source4/cluster/ctdb/opendb_ctdb.c +++ b/source4/cluster/ctdb/opendb_ctdb.c @@ -464,6 +464,16 @@ static NTSTATUS odb_ctdb_update_oplock(struct odb_lock *lck, void *file_handle, return NT_STATUS_FOOBAR; } +static NTSTATUS odb_ctdb_break_oplocks(struct odb_lock *lck) +{ + /* + * as this file will went away and isn't used yet, + * copy the implementation from the tdb backend + * --metze + */ + return NT_STATUS_FOOBAR; +} + /* remove a pending opendb entry */ @@ -642,7 +652,8 @@ static const struct opendb_ops opendb_ctdb_ops = { .odb_set_delete_on_close = odb_ctdb_set_delete_on_close, .odb_get_delete_on_close = odb_ctdb_get_delete_on_close, .odb_can_open = odb_ctdb_can_open, - .odb_update_oplock = odb_ctdb_update_oplock + .odb_update_oplock = odb_ctdb_update_oplock, + .odb_break_oplocks = odb_ctdb_break_oplocks }; -- cgit From facdc472c7e6dbca0553a5e0dfb100be322339ce Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 25 Feb 2008 16:47:48 +0100 Subject: opendb: pass down open_disposition and break_to_none to odb_open_file() metze (This used to be commit aaaa26ae5e810495f313dfada771a8de86cedbd4) --- source4/cluster/ctdb/opendb_ctdb.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'source4/cluster/ctdb/opendb_ctdb.c') diff --git a/source4/cluster/ctdb/opendb_ctdb.c b/source4/cluster/ctdb/opendb_ctdb.c index 915b760424..36ae204974 100644 --- a/source4/cluster/ctdb/opendb_ctdb.c +++ b/source4/cluster/ctdb/opendb_ctdb.c @@ -279,11 +279,13 @@ static NTSTATUS odb_oplock_break_send(struct odb_context *odb, struct opendb_ent Note that the path is only used by the delete on close logic, not for comparing with other filenames */ -static NTSTATUS odb_ctdb_open_file(struct odb_lock *lck, void *file_handle, - uint32_t stream_id, uint32_t share_access, - uint32_t access_mask, bool delete_on_close, - const char *path, - uint32_t oplock_level, uint32_t *oplock_granted) +static NTSTATUS odb_ctdb_open_file(struct odb_lock *lck, + void *file_handle, const char *path, + uint32_t stream_id, uint32_t share_access, + uint32_t access_mask, bool delete_on_close, + uint32_t open_disposition, bool break_to_none, + uint32_t oplock_level, uint32_t *oplock_granted) + { struct odb_context *odb = lck->odb; struct opendb_entry e; -- cgit From 7264a8b7ca5f91120dbc30fcbe8e8402f09ae883 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 25 Feb 2008 17:48:13 +0100 Subject: opendb: unify the parameters of odb_open_file() and odb_can_open() metze (This used to be commit e6b708a52b0eada3fd374b66292ded3b0f6ce217) --- source4/cluster/ctdb/opendb_ctdb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source4/cluster/ctdb/opendb_ctdb.c') diff --git a/source4/cluster/ctdb/opendb_ctdb.c b/source4/cluster/ctdb/opendb_ctdb.c index 36ae204974..3dfc6819b7 100644 --- a/source4/cluster/ctdb/opendb_ctdb.c +++ b/source4/cluster/ctdb/opendb_ctdb.c @@ -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; } -- cgit