s3/vfs: merge offline functionality into DOS attributes handling
[samba.git] / source3 / modules / vfs_offline.c
index 5921f4392fce14cafa2b21eac05ab80ef1693e54..e2d66fa930ee74ab4d5f7b89a0a0ff0036b5ecbb 100644 (file)
@@ -27,16 +27,26 @@ static uint32_t offline_fs_capabilities(struct vfs_handle_struct *handle,
               FILE_SUPPORTS_REMOTE_STORAGE;
 }
 
-static bool offline_is_offline(struct vfs_handle_struct *handle,
-                              const struct smb_filename *fname,
-                              SMB_STRUCT_STAT *stbuf)
+static NTSTATUS offline_get_dos_attributes(struct vfs_handle_struct *handle,
+                                          struct smb_filename *smb_fname,
+                                          uint32_t *dosmode)
 {
-       return true;
+       *dosmode |= FILE_ATTRIBUTE_OFFLINE;
+       return SMB_VFS_NEXT_GET_DOS_ATTRIBUTES(handle, smb_fname, dosmode);
+}
+
+static NTSTATUS offline_fget_dos_attributes(struct vfs_handle_struct *handle,
+                                           struct files_struct *fsp,
+                                           uint32_t *dosmode)
+{
+       *dosmode |= FILE_ATTRIBUTE_OFFLINE;
+       return SMB_VFS_NEXT_FGET_DOS_ATTRIBUTES(handle, fsp, dosmode);
 }
 
 static struct vfs_fn_pointers offline_fns = {
     .fs_capabilities_fn = offline_fs_capabilities,
-    .is_offline_fn = offline_is_offline,
+       .get_dos_attributes_fn = offline_get_dos_attributes,
+       .fget_dos_attributes_fn = offline_fget_dos_attributes,
 };
 
 NTSTATUS vfs_offline_init(void);