diff options
author | Andrew Tridgell <tridge@samba.org> | 2007-03-13 01:47:04 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:49:29 -0500 |
commit | 676a04a056d495b9b81ba7c6e6b1cbb9c3d64ac5 (patch) | |
tree | 7a950023f48314d41e8a72a91baba2ca2e767245 /source4/ntvfs/common/opendb.h | |
parent | 9b03286b32a916dbef59f1459eefa01f0ebfeed3 (diff) | |
download | samba-676a04a056d495b9b81ba7c6e6b1cbb9c3d64ac5.tar.gz samba-676a04a056d495b9b81ba7c6e6b1cbb9c3d64ac5.tar.bz2 samba-676a04a056d495b9b81ba7c6e6b1cbb9c3d64ac5.zip |
r21807: modularise the opendb code, so different backends can be
implemented. This will allow for a ctdb opendb backend.
(This used to be commit 6b91ca0968209ad17489341c78d9610607cc8320)
Diffstat (limited to 'source4/ntvfs/common/opendb.h')
-rw-r--r-- | source4/ntvfs/common/opendb.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/source4/ntvfs/common/opendb.h b/source4/ntvfs/common/opendb.h new file mode 100644 index 0000000000..9d6c18c471 --- /dev/null +++ b/source4/ntvfs/common/opendb.h @@ -0,0 +1,49 @@ +/* + Unix SMB/CIFS implementation. + + open database code - common include + + Copyright (C) Andrew Tridgell 2007 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +struct opendb_ops { + struct odb_context *(*odb_init)(TALLOC_CTX *mem_ctx, + struct ntvfs_context *ntvfs_ctx); + struct odb_lock *(*odb_lock)(TALLOC_CTX *mem_ctx, + struct odb_context *odb, DATA_BLOB *file_key); + NTSTATUS (*odb_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); + NTSTATUS (*odb_open_file_pending)(struct odb_lock *lck, void *private); + NTSTATUS (*odb_close_file)(struct odb_lock *lck, void *file_handle); + NTSTATUS (*odb_remove_pending)(struct odb_lock *lck, void *private); + 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); + NTSTATUS (*odb_can_open)(struct odb_lock *lck, + uint32_t share_access, uint32_t create_options, + uint32_t access_mask); +}; + + +void odb_set_ops(const struct opendb_ops *new_ops); +void odb_tdb_init_ops(void); + |