diff options
author | Tim Prouty <tprouty@samba.org> | 2009-01-27 16:13:35 -0800 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-02-09 23:47:45 -0800 |
commit | 16d2c2fa58c57539a9b540eb93825806caaea0b5 (patch) | |
tree | f9e36ba11388ece127fa82c7eb96bfbc6a853902 /source3/include | |
parent | 32d68b8ec3aee7853c7547296e829277515813d1 (diff) | |
download | samba-16d2c2fa58c57539a9b540eb93825806caaea0b5.tar.gz samba-16d2c2fa58c57539a9b540eb93825806caaea0b5.tar.bz2 samba-16d2c2fa58c57539a9b540eb93825806caaea0b5.zip |
s3 OneFS: Add kernel oplocks implementation
A few functions in oplocks_onefs.c need to be accessed from the onefs
vfs module. It would be ideal if oplocks were implemented at the vfs
layer, but since they aren't yet, a new header is added to
source3/include to make these functions available to the onefs vfs
module. oplocks_onefs.o doesn't need to be linked into the onefs vfs
module explicitly, since it is already linked into smbd by default.
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/oplock_onefs.h | 50 | ||||
-rw-r--r-- | source3/include/proto.h | 4 |
2 files changed, 54 insertions, 0 deletions
diff --git a/source3/include/oplock_onefs.h b/source3/include/oplock_onefs.h new file mode 100644 index 0000000000..a20becdf2c --- /dev/null +++ b/source3/include/oplock_onefs.h @@ -0,0 +1,50 @@ +/* + * Unix SMB/CIFS implementation. + * Support for OneFS kernel oplocks + * + * Copyright (C) Tim Prouty, 2009 + * + * 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 3 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, see <http://www.gnu.org/licenses/>. + */ + +#ifndef _OPLOCK_ONEFS_H +#define _OPLOCK_ONEFS_H + +#if HAVE_ONEFS + +#include <sys/isi_oplock.h> + +struct deferred_open_record { + bool delayed_for_oplocks; + bool failed; /* added for onefs_oplocks */ + struct file_id id; +}; + +/* + * OneFS oplock utility functions + */ +const char *onefs_oplock_str(enum oplock_type onefs_oplock_type); +int onefs_oplock_to_samba_oplock(enum oplock_type onefs_oplock); +enum oplock_type onefs_samba_oplock_to_oplock(int samba_oplock_type); + +/* + * OneFS oplock callback tracking + */ +void destroy_onefs_callback_record(uint64 id); +uint64 onefs_oplock_wait_record(uint16 mid); +void onefs_set_oplock_callback(uint64 id, files_struct *fsp); + +#endif /* HAVE_ONEFS */ + +#endif /* _OPLOCK_ONEFS_H */ diff --git a/source3/include/proto.h b/source3/include/proto.h index f553f7625e..1566a01dc5 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6924,6 +6924,10 @@ int linux_set_lease_sighandler(int fd); int linux_setlease(int fd, int leasetype); struct kernel_oplocks *linux_init_kernel_oplocks(TALLOC_CTX *mem_ctx) ; +/* The following definitions come from smbd/oplock_onefs.c */ + +struct kernel_oplocks *onefs_init_kernel_oplocks(TALLOC_CTX *mem_ctx); + /* The following definitions come from smbd/password.c */ user_struct *get_valid_user_struct(uint16 vuid); |