]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: move locking related vfs functions to smbd/vfs.c
authorStefan Metzmacher <metze@samba.org>
Sun, 21 Aug 2022 13:15:09 +0000 (15:15 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 20 Sep 2022 00:34:35 +0000 (00:34 +0000)
This allows us to make VFS_FIND local to smbd/vfs.c in the
next step.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/locking/brlock.c
source3/locking/posix.c
source3/smbd/vfs.c
source3/wscript_build

index 68ade6b6d591af725203fbbfcccf1c6b3cea308d..d2e4abf48d73e8612a703a3a801eaa233d133865 100644 (file)
@@ -971,14 +971,6 @@ static NTSTATUS brl_lock_posix(struct byte_range_lock *br_lck,
        return status;
 }
 
-NTSTATUS smb_vfs_call_brl_lock_windows(struct vfs_handle_struct *handle,
-                                      struct byte_range_lock *br_lck,
-                                      struct lock_struct *plock)
-{
-       VFS_FIND(brl_lock_windows);
-       return handle->fns->brl_lock_windows_fn(handle, br_lck, plock);
-}
-
 /****************************************************************************
  Lock a range of bytes.
 ****************************************************************************/
@@ -1250,14 +1242,6 @@ static bool brl_unlock_posix(struct byte_range_lock *br_lck,
        return True;
 }
 
-bool smb_vfs_call_brl_unlock_windows(struct vfs_handle_struct *handle,
-                                    struct byte_range_lock *br_lck,
-                                    const struct lock_struct *plock)
-{
-       VFS_FIND(brl_unlock_windows);
-       return handle->fns->brl_unlock_windows_fn(handle, br_lck, plock);
-}
-
 /****************************************************************************
  Unlock a range of bytes.
 ****************************************************************************/
index 536d8bf802bb47c1ee54d9bc73c7324b468362db..5aad427a218b19823ba5654a62e3e5db8b1b4b73 100644 (file)
@@ -179,14 +179,6 @@ static bool posix_lock_in_range(off_t *offset_out, off_t *count_out,
        return True;
 }
 
-bool smb_vfs_call_lock(struct vfs_handle_struct *handle,
-                      struct files_struct *fsp, int op, off_t offset,
-                      off_t count, int type)
-{
-       VFS_FIND(lock);
-       return handle->fns->lock_fn(handle, fsp, op, offset, count, type);
-}
-
 /****************************************************************************
  Actual function that does POSIX locks. Copes with 64 -> 32 bit cruft and
  broken NFS implementations.
@@ -243,15 +235,6 @@ static bool posix_fcntl_lock(files_struct *fsp, int op, off_t offset, off_t coun
        return ret;
 }
 
-bool smb_vfs_call_getlock(struct vfs_handle_struct *handle,
-                         struct files_struct *fsp, off_t *poffset,
-                         off_t *pcount, int *ptype, pid_t *ppid)
-{
-       VFS_FIND(getlock);
-       return handle->fns->getlock_fn(handle, fsp, poffset, pcount, ptype, 
-                                      ppid);
-}
-
 /****************************************************************************
  Actual function that gets POSIX locks. Copes with 64 -> 32 bit cruft and
  broken NFS implementations.
index 1d9f70bafc9a30a0e8bf993501d5c62cf22d4318..acd66f3ca20a37d810ef1520570ebc461cd48bd3 100644 (file)
@@ -2633,3 +2633,36 @@ NTSTATUS smb_vfs_call_freaddir_attr(struct vfs_handle_struct *handle,
                                             mem_ctx,
                                             attr_data);
 }
+
+bool smb_vfs_call_lock(struct vfs_handle_struct *handle,
+                      struct files_struct *fsp, int op, off_t offset,
+                      off_t count, int type)
+{
+       VFS_FIND(lock);
+       return handle->fns->lock_fn(handle, fsp, op, offset, count, type);
+}
+
+bool smb_vfs_call_getlock(struct vfs_handle_struct *handle,
+                         struct files_struct *fsp, off_t *poffset,
+                         off_t *pcount, int *ptype, pid_t *ppid)
+{
+       VFS_FIND(getlock);
+       return handle->fns->getlock_fn(handle, fsp, poffset, pcount, ptype,
+                                      ppid);
+}
+
+NTSTATUS smb_vfs_call_brl_lock_windows(struct vfs_handle_struct *handle,
+                                      struct byte_range_lock *br_lck,
+                                      struct lock_struct *plock)
+{
+       VFS_FIND(brl_lock_windows);
+       return handle->fns->brl_lock_windows_fn(handle, br_lck, plock);
+}
+
+bool smb_vfs_call_brl_unlock_windows(struct vfs_handle_struct *handle,
+                                    struct byte_range_lock *br_lck,
+                                    const struct lock_struct *plock)
+{
+       VFS_FIND(brl_unlock_windows);
+       return handle->fns->brl_unlock_windows_fn(handle, br_lck, plock);
+}
index 19e31c80e75421d9b44bcbf9bfb909ca45d567bd..df0bfb95c01c03cf0f5e3380e7434e83632c422d 100644 (file)
@@ -758,6 +758,7 @@ bld.SAMBA3_SUBSYSTEM('LOCKING',
                     deps='''
                          tdb
                          talloc
+                         vfs
                          LEASES_DB
                          LEASES_UTIL
                          NDR_OPEN_FILES