Convert wb_resp_read to tevent_req
[ira/wip.git] / source3 / include / oplock_onefs.h
1 /*
2  * Unix SMB/CIFS implementation.
3  * Support for OneFS kernel oplocks
4  *
5  * Copyright (C) Tim Prouty, 2009
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, see <http://www.gnu.org/licenses/>.
19  */
20
21 #ifndef _OPLOCK_ONEFS_H
22 #define _OPLOCK_ONEFS_H
23
24 #if HAVE_ONEFS
25
26 #include <sys/isi_oplock.h>
27
28 struct deferred_open_record {
29         bool delayed_for_oplocks;
30         bool failed; /* added for onefs_oplocks */
31         struct file_id id;
32 };
33
34 /*
35  * OneFS oplock utility functions
36  */
37 const char *onefs_oplock_str(enum oplock_type onefs_oplock_type);
38 int onefs_oplock_to_samba_oplock(enum oplock_type onefs_oplock);
39 enum oplock_type onefs_samba_oplock_to_oplock(int samba_oplock_type);
40
41 /*
42  * OneFS oplock callback tracking
43  */
44 void destroy_onefs_callback_record(uint64 id);
45 uint64 onefs_oplock_wait_record(uint16 mid);
46 void onefs_set_oplock_callback(uint64 id, files_struct *fsp);
47
48 #endif /* HAVE_ONEFS */
49
50 #endif /* _OPLOCK_ONEFS_H */