bool (*aio_force)(struct vfs_handle_struct *handle, struct files_struct *fsp);
/* offline operations */
- bool (*is_offline)(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf);
+ bool (*is_offline)(struct vfs_handle_struct *handle,
+ const struct smb_filename *fname,
+ SMB_STRUCT_STAT *sbuf);
int (*set_offline)(struct vfs_handle_struct *handle, const char *path);
};
bool smb_vfs_call_aio_force(struct vfs_handle_struct *handle,
struct files_struct *fsp);
bool smb_vfs_call_is_offline(struct vfs_handle_struct *handle,
- const char *path, SMB_STRUCT_STAT *sbuf);
+ const struct smb_filename *fname,
+ SMB_STRUCT_STAT *sbuf);
int smb_vfs_call_set_offline(struct vfs_handle_struct *handle,
const char *path);
#define SMB_VFS_NEXT_AIO_FORCE(handle,fsp) \
smb_vfs_call_aio_force((handle)->next,(fsp))
-#define SMB_VFS_IS_OFFLINE(conn,path,sbuf) \
- smb_vfs_call_is_offline((conn)->vfs_handles,(path),(sbuf))
-#define SMB_VFS_NEXT_IS_OFFLINE(handle,path,sbuf) \
- smb_vfs_call_is_offline((handle)->next,(path),(sbuf))
+#define SMB_VFS_IS_OFFLINE(conn,fname,sbuf) \
+ smb_vfs_call_is_offline((conn)->vfs_handles,(fname),(sbuf))
+#define SMB_VFS_NEXT_IS_OFFLINE(handle,fname,sbuf) \
+ smb_vfs_call_is_offline((handle)->next,(fname),(sbuf))
#define SMB_VFS_SET_OFFLINE(conn,path) \
smb_vfs_call_set_offline((conn)->vfs_handles,(path))
return false;
}
-static bool vfswrap_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf)
+static bool vfswrap_is_offline(struct vfs_handle_struct *handle,
+ const struct smb_filename *fname,
+ SMB_STRUCT_STAT *sbuf)
{
- if (ISDOT(path) || ISDOTDOT(path)) {
+ NTSTATUS status;
+ char *path;
+
+ if (ISDOT(fname->base_name) || ISDOTDOT(fname->base_name)) {
return false;
}
return false;
}
+ status = get_full_smb_filename(talloc_tos(), fname, &path);
+ if (!NT_STATUS_IS_OK(status)) {
+ errno = map_errno_from_nt_status(status);
+ return false;
+ }
+
return (dmapi_file_flags(path) & FILE_ATTRIBUTE_OFFLINE) != 0;
}
return result;
}
+static bool smb_full_audit_is_offline(struct vfs_handle_struct *handle,
+ const struct smb_filename *fname,
+ SMB_STRUCT_STAT *sbuf)
+{
+ bool result;
+
+ result = SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
+ do_log(SMB_VFS_OP_IS_OFFLINE, result, handle, "%s",
+ smb_fname_str_do_log(fname));
+ return result;
+}
+
static struct vfs_fn_pointers vfs_full_audit_fns = {
/* Disk operations */
.aio_fsync = smb_full_audit_aio_fsync,
.aio_suspend = smb_full_audit_aio_suspend,
.aio_force = smb_full_audit_aio_force,
+ .is_offline = smb_full_audit_is_offline,
};
NTSTATUS vfs_full_audit_init(void)
static bool
onefs_shadow_copy_is_offline(struct vfs_handle_struct *handle,
- const char *path, SMB_STRUCT_STAT *sbuf)
+ const struct smb_fname *fname,
+ SMB_STRUCT_STAT *sbuf)
{
+#error Isilon, please convert "char *path" to "struct smb_fname *fname"
SHADOW_NEXT(IS_OFFLINE,
(handle, cpath ?: path, sbuf),
bool);
}
static bool tsmsm_is_offline(struct vfs_handle_struct *handle,
- const char *path,
- SMB_STRUCT_STAT *stbuf) {
+ const struct smb_filename *fname,
+ SMB_STRUCT_STAT *stbuf)
+{
struct tsmsm_struct *tsmd = (struct tsmsm_struct *) handle->data;
const dm_sessid_t *dmsession_id;
void *dmhandle = NULL;
bool offline;
char *buf = NULL;
size_t buflen;
+ NTSTATUS status;
+ char *path;
+
+ status = get_full_smb_filename(talloc_tos(), fname, &path);
+ if (!NT_STATUS_IS_OK(status)) {
+ errno = map_errno_from_nt_status(status);
+ return false;
+ }
/* if the file has more than FILE_IS_ONLINE_RATIO of blocks available,
then assume it is not offline (it may not be 100%, as it could be sparse) */
}
}
- offline = SMB_VFS_IS_OFFLINE(conn, smb_fname->base_name, &smb_fname->st);
+ offline = SMB_VFS_IS_OFFLINE(conn, smb_fname, &smb_fname->st);
if (S_ISREG(smb_fname->st.st_ex_mode) && offline) {
result |= FILE_ATTRIBUTE_OFFLINE;
}
}
bool smb_vfs_call_is_offline(struct vfs_handle_struct *handle,
- const char *path, SMB_STRUCT_STAT *sbuf)
+ const struct smb_filename *fname,
+ SMB_STRUCT_STAT *sbuf)
{
VFS_FIND(is_offline);
- return handle->fns->is_offline(handle, path, sbuf);
+ return handle->fns->is_offline(handle, fname, sbuf);
}
int smb_vfs_call_set_offline(struct vfs_handle_struct *handle,