summaryrefslogtreecommitdiff
path: root/source3/include/vfs.h
diff options
context:
space:
mode:
authorZack Kirsch <zack.kirsch@isilon.com>2009-02-09 21:51:29 -0800
committerJeremy Allison <jra@samba.org>2009-02-13 10:08:40 -0800
commit813273c87e4f48d7d8415c8ee9a1a553ed369429 (patch)
tree2f6140e3f75d987f437ff93a291a4e8e14117d1b /source3/include/vfs.h
parenteb3d964f20f44deaf2b4f07adba64785875710e0 (diff)
downloadsamba-813273c87e4f48d7d8415c8ee9a1a553ed369429.tar.gz
samba-813273c87e4f48d7d8415c8ee9a1a553ed369429.tar.bz2
samba-813273c87e4f48d7d8415c8ee9a1a553ed369429.zip
Add VFS ops for Windows BRL: Lock, Unlock and Cancel:
This patch adds 3 new VFS OPs for Windows byte range locking: BRL_LOCK_WINDOWS, BRL_UNLOCK_WINDOWS and BRL_CANCEL_WINDOWS. Specifically: * I renamed brl_lock_windows, brl_unlock_windows and brl_lock_cancel to *_default as the default implementations of the VFS ops. * The blocking_lock_record (BLR) is now passed into the brl_lock_windows and brl_cancel_windows paths. The Onefs implementation uses it - future implementations may find it useful too. * Created brl_lock_cancel to do what brl_lock/brl_unlock do: set up a lock_struct and call either the Posix or Windows lock function. These happen to be the same for the default implementation. * Added helper functions: increment_current_lock_count() and decrement_current_lock_count(). * Minor spelling correction in brl_timeout_fn: brl -> blr. * Changed blocking_lock_cancel() to return the BLR that it has cancelled. This allows us to assert its the lock that we wanted to cancel. If this assert ever fires, this path will need to take in the BLR to cancel, rather than choosing on its own. * Adds a small helper function: find_blocking_lock_record_by_id(). Used by the OneFS implementation, but could be useful for others.
Diffstat (limited to 'source3/include/vfs.h')
-rw-r--r--source3/include/vfs.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index f944c899c6..ffa1a95ed0 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -115,6 +115,7 @@
/* Leave at 25 - not yet released. Add get_alloc_size call. -- tprouty. */
/* Leave at 25 - not yet released. Add SMB_STRUCT_STAT to readdir. - sdann */
/* Leave at 25 - not yet released. Add init_search_op call. - sdann */
+/* Leave at 25 - not yet released. Add locking calls. -- zkirsch. */
#define SMB_VFS_INTERFACE_VERSION 25
@@ -142,6 +143,7 @@ struct vfs_statvfs_struct;
struct smb_request;
struct ea_list;
struct smb_file_time;
+struct blocking_lock_record;
/*
Available VFS operations. These values must be in sync with vfs_ops struct
@@ -218,6 +220,9 @@ typedef enum _vfs_op_type {
SMB_VFS_OP_FILE_ID_CREATE,
SMB_VFS_OP_STREAMINFO,
SMB_VFS_OP_GET_REAL_FILENAME,
+ SMB_VFS_OP_BRL_LOCK_WINDOWS,
+ SMB_VFS_OP_BRL_UNLOCK_WINDOWS,
+ SMB_VFS_OP_BRL_CANCEL_WINDOWS,
/* NT ACL operations. */
@@ -393,6 +398,22 @@ struct vfs_ops {
TALLOC_CTX *mem_ctx,
char **found_name);
+ NTSTATUS (*brl_lock_windows)(struct vfs_handle_struct *handle,
+ struct byte_range_lock *br_lck,
+ struct lock_struct *plock,
+ bool blocking_lock,
+ struct blocking_lock_record *blr);
+
+ bool (*brl_unlock_windows)(struct vfs_handle_struct *handle,
+ struct messaging_context *msg_ctx,
+ struct byte_range_lock *br_lck,
+ const struct lock_struct *plock);
+
+ bool (*brl_cancel_windows)(struct vfs_handle_struct *handle,
+ struct byte_range_lock *br_lck,
+ struct lock_struct *plock,
+ struct blocking_lock_record *blr);
+
/* NT ACL operations. */
NTSTATUS (*fget_nt_acl)(struct vfs_handle_struct *handle,
@@ -531,6 +552,9 @@ struct vfs_ops {
struct vfs_handle_struct *file_id_create;
struct vfs_handle_struct *streaminfo;
struct vfs_handle_struct *get_real_filename;
+ struct vfs_handle_struct *brl_lock_windows;
+ struct vfs_handle_struct *brl_unlock_windows;
+ struct vfs_handle_struct *brl_cancel_windows;
/* NT ACL operations. */