summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-07-23 20:28:58 -0400
committerVolker Lendecke <vl@samba.org>2009-07-24 11:42:05 -0400
commit033185e2a1b2892fe8dc74a18a38e5e13e08cb22 (patch)
tree67f652f7c4caba015eb3ad7b5ad7d0f6ed56cc8d /source3/locking
parentbe5cf236968658263b0be5e1e4742741c70f65f8 (diff)
downloadsamba-033185e2a1b2892fe8dc74a18a38e5e13e08cb22.tar.gz
samba-033185e2a1b2892fe8dc74a18a38e5e13e08cb22.tar.bz2
samba-033185e2a1b2892fe8dc74a18a38e5e13e08cb22.zip
Make the smbd VFS typesafe
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/brlock.c30
-rw-r--r--source3/locking/posix.c16
2 files changed, 46 insertions, 0 deletions
diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c
index e238ec959b..05d6c7f95d 100644
--- a/source3/locking/brlock.c
+++ b/source3/locking/brlock.c
@@ -774,6 +774,17 @@ static NTSTATUS brl_lock_posix(struct messaging_context *msg_ctx,
return status;
}
+NTSTATUS smb_vfs_call_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)
+{
+ VFS_FIND(brl_lock_windows);
+ return handle->fns->brl_lock_windows(handle, br_lck, plock,
+ blocking_lock, blr);
+}
+
/****************************************************************************
Lock a range of bytes.
****************************************************************************/
@@ -1116,6 +1127,15 @@ static bool brl_unlock_posix(struct messaging_context *msg_ctx,
return True;
}
+bool smb_vfs_call_brl_unlock_windows(struct vfs_handle_struct *handle,
+ struct messaging_context *msg_ctx,
+ struct byte_range_lock *br_lck,
+ const struct lock_struct *plock)
+{
+ VFS_FIND(brl_unlock_windows);
+ return handle->fns->brl_unlock_windows(handle, msg_ctx, br_lck, plock);
+}
+
/****************************************************************************
Unlock a range of bytes.
****************************************************************************/
@@ -1274,6 +1294,16 @@ NTSTATUS brl_lockquery(struct byte_range_lock *br_lck,
return NT_STATUS_OK;
}
+
+bool smb_vfs_call_brl_cancel_windows(struct vfs_handle_struct *handle,
+ struct byte_range_lock *br_lck,
+ struct lock_struct *plock,
+ struct blocking_lock_record *blr)
+{
+ VFS_FIND(brl_cancel_windows);
+ return handle->fns->brl_cancel_windows(handle, br_lck, plock, blr);
+}
+
/****************************************************************************
Remove a particular pending lock.
****************************************************************************/
diff --git a/source3/locking/posix.c b/source3/locking/posix.c
index 33ffaf95ca..17945399c5 100644
--- a/source3/locking/posix.c
+++ b/source3/locking/posix.c
@@ -177,6 +177,14 @@ static bool posix_lock_in_range(SMB_OFF_T *offset_out, SMB_OFF_T *count_out,
return True;
}
+bool smb_vfs_call_lock(struct vfs_handle_struct *handle,
+ struct files_struct *fsp, int op, SMB_OFF_T offset,
+ SMB_OFF_T count, int type)
+{
+ VFS_FIND(lock);
+ return handle->fns->lock(handle, fsp, op, offset, count, type);
+}
+
/****************************************************************************
Actual function that does POSIX locks. Copes with 64 -> 32 bit cruft and
broken NFS implementations.
@@ -220,6 +228,14 @@ static bool posix_fcntl_lock(files_struct *fsp, int op, SMB_OFF_T offset, SMB_OF
return ret;
}
+bool smb_vfs_call_getlock(struct vfs_handle_struct *handle,
+ struct files_struct *fsp, SMB_OFF_T *poffset,
+ SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
+{
+ VFS_FIND(getlock);
+ return handle->fns->getlock(handle, fsp, poffset, pcount, ptype, ppid);
+}
+
/****************************************************************************
Actual function that gets POSIX locks. Copes with 64 -> 32 bit cruft and
broken NFS implementations.