2007-03-13 01:47:04 +00:00
/*
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
2007-07-10 02:07:03 +00:00
the Free Software Foundation ; either version 3 of the License , or
2007-03-13 01:47:04 +00:00
( 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
2007-07-10 02:07:03 +00:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2007-03-13 01:47:04 +00:00
*/
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 ) ;
2008-02-22 10:18:13 +01:00
DATA_BLOB ( * odb_get_key ) ( TALLOC_CTX * mem_ctx , struct odb_lock * lck ) ;
2008-02-25 16:47:48 +01:00
NTSTATUS ( * odb_open_file ) ( struct odb_lock * lck ,
void * file_handle , const char * path ,
2008-04-15 16:00:42 +02:00
int * fd , NTTIME open_write_time ,
bool allow_level_II_oplock ,
2007-03-13 01:47:04 +00:00
uint32_t oplock_level , uint32_t * oplock_granted ) ;
2009-02-02 08:32:46 +01:00
NTSTATUS ( * odb_open_file_pending ) ( struct odb_lock * lck , void * private_data ) ;
2008-02-27 21:50:51 +01:00
NTSTATUS ( * odb_close_file ) ( struct odb_lock * lck , void * file_handle ,
const char * * delete_path ) ;
2009-02-02 08:32:46 +01:00
NTSTATUS ( * odb_remove_pending ) ( struct odb_lock * lck , void * private_data ) ;
2007-03-13 01:47:04 +00:00
NTSTATUS ( * odb_rename ) ( struct odb_lock * lck , const char * path ) ;
2008-02-28 09:06:49 +01:00
NTSTATUS ( * odb_get_path ) ( struct odb_lock * lck , const char * * path ) ;
2007-08-27 18:10:19 +00:00
NTSTATUS ( * odb_set_delete_on_close ) ( struct odb_lock * lck , bool del_on_close ) ;
2008-04-15 16:00:42 +02:00
NTSTATUS ( * odb_set_write_time ) ( struct odb_lock * lck ,
NTTIME write_time , bool force ) ;
NTSTATUS ( * odb_get_file_infos ) ( struct odb_context * odb , DATA_BLOB * key ,
bool * del_on_close , NTTIME * write_time ) ;
2007-03-13 01:47:04 +00:00
NTSTATUS ( * odb_can_open ) ( struct odb_lock * lck ,
2008-02-25 17:48:13 +01:00
uint32_t stream_id , uint32_t share_access ,
uint32_t access_mask , bool delete_on_close ,
uint32_t open_disposition , bool break_to_none ) ;
2008-02-21 16:12:27 +01:00
NTSTATUS ( * odb_update_oplock ) ( struct odb_lock * lck , void * file_handle ,
uint32_t oplock_level ) ;
2008-02-22 16:30:13 +01:00
NTSTATUS ( * odb_break_oplocks ) ( struct odb_lock * lck ) ;
2007-03-13 01:47:04 +00:00
} ;
2008-02-21 12:20:31 +01:00
struct opendb_oplock_break {
void * file_handle ;
uint8_t level ;
} ;
2007-03-13 01:47:04 +00:00
void odb_set_ops ( const struct opendb_ops * new_ops ) ;
void odb_tdb_init_ops ( void ) ;
2007-04-05 03:51:49 +00:00
void odb_ctdb_init_ops ( void ) ;