]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
VFS: default: let vfswrap_is_offline() take conn, not handle
authorRalph Boehme <slow@samba.org>
Mon, 24 Feb 2020 13:24:12 +0000 (14:24 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 25 Feb 2020 17:44:44 +0000 (17:44 +0000)
vfswrap_is_offline() has been converted to a "helper" function some time ago, it
had been a VFS interface function before. To make this change more obvious let
it take a struct connection_struct instead of a struct vfs_handle_struct which
is the canonical first parameter to VFS functions.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_default.c

index 37b59d8c3c061e741346d60000e4d1f796c6ac2f..209db91381e2fe9e90d7f2741234dca67011c780 100644 (file)
@@ -1638,7 +1638,7 @@ static NTSTATUS vfswrap_fsctl(struct vfs_handle_struct *handle,
        return NT_STATUS_NOT_SUPPORTED;
 }
 
-static bool vfswrap_is_offline(struct vfs_handle_struct *handle,
+static bool vfswrap_is_offline(struct connection_struct *conn,
                               const struct smb_filename *fname,
                               SMB_STRUCT_STAT *sbuf);
 
@@ -1648,7 +1648,7 @@ static NTSTATUS vfswrap_get_dos_attributes(struct vfs_handle_struct *handle,
 {
        bool offline;
 
-       offline = vfswrap_is_offline(handle, smb_fname, &smb_fname->st);
+       offline = vfswrap_is_offline(handle->conn, smb_fname, &smb_fname->st);
        if (offline) {
                *dosmode |= FILE_ATTRIBUTE_OFFLINE;
        }
@@ -1798,7 +1798,9 @@ static NTSTATUS vfswrap_fget_dos_attributes(struct vfs_handle_struct *handle,
 {
        bool offline;
 
-       offline = vfswrap_is_offline(handle, fsp->fsp_name, &fsp->fsp_name->st);
+       offline = vfswrap_is_offline(handle->conn,
+                                    fsp->fsp_name,
+                                    &fsp->fsp_name->st);
        if (offline) {
                *dosmode |= FILE_ATTRIBUTE_OFFLINE;
        }
@@ -3543,7 +3545,7 @@ static bool vfswrap_aio_force(struct vfs_handle_struct *handle, struct files_str
        return false;
 }
 
-static bool vfswrap_is_offline(struct vfs_handle_struct *handle,
+static bool vfswrap_is_offline(struct connection_struct *conn,
                               const struct smb_filename *fname,
                               SMB_STRUCT_STAT *sbuf)
 {
@@ -3555,7 +3557,7 @@ static bool vfswrap_is_offline(struct vfs_handle_struct *handle,
                return false;
        }
 
-       if (!lp_dmapi_support(SNUM(handle->conn)) || !dmapi_have_session()) {
+       if (!lp_dmapi_support(SNUM(conn)) || !dmapi_have_session()) {
 #if defined(ENOTSUP)
                errno = ENOTSUP;
 #endif