summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_default.c10
-rw-r--r--source3/modules/vfs_tsmsm.c16
2 files changed, 11 insertions, 15 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index d4ba4dc611..755bcdeefa 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -1230,22 +1230,20 @@ static bool vfswrap_aio_force(struct vfs_handle_struct *handle, struct files_str
return false;
}
-static int vfswrap_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf, bool *offline)
+static bool vfswrap_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf)
{
if (ISDOT(path) || ISDOTDOT(path)) {
- *offline = false;
- return 0;
+ return false;
}
if (!lp_dmapi_support(SNUM(handle->conn)) || !dmapi_have_session()) {
#if defined(ENOTSUP)
errno = ENOTSUP;
#endif
- return -1;
+ return false;
}
- *offline = (dmapi_file_flags(path) & FILE_ATTRIBUTE_OFFLINE) != 0;
- return 0;
+ return (dmapi_file_flags(path) & FILE_ATTRIBUTE_OFFLINE) != 0;
}
static int vfswrap_set_offline(struct vfs_handle_struct *handle, const char *path)
diff --git a/source3/modules/vfs_tsmsm.c b/source3/modules/vfs_tsmsm.c
index c2d826f818..c737032907 100644
--- a/source3/modules/vfs_tsmsm.c
+++ b/source3/modules/vfs_tsmsm.c
@@ -136,24 +136,23 @@ static int tsmsm_connect(struct vfs_handle_struct *handle,
return SMB_VFS_NEXT_CONNECT(handle, service, user);
}
-static int tsmsm_is_offline(struct vfs_handle_struct *handle,
+static bool tsmsm_is_offline(struct vfs_handle_struct *handle,
const char *path,
- SMB_STRUCT_STAT *stbuf,
- bool *offline) {
+ SMB_STRUCT_STAT *stbuf) {
struct tsmsm_struct *tsmd = (struct tsmsm_struct *) handle->data;
void *dmhandle = NULL;
size_t dmhandle_len = 0;
size_t rlen;
dm_attrname_t dmname;
int ret;
+ bool offline;
/* 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) */
if (512 * (off_t)stbuf->st_blocks >= stbuf->st_size * tsmd->online_ratio) {
- *offline = false;
DEBUG(10,("%s not offline: st_blocks=%ld st_size=%ld online_ratio=%.2f\n",
path, stbuf->st_blocks, stbuf->st_size, tsmd->online_ratio));
- return 0;
+ return false;
}
/* using POSIX capabilities does not work here. It's a slow path, so
@@ -167,10 +166,9 @@ static int tsmsm_is_offline(struct vfs_handle_struct *handle,
/* go the slow DMAPI route */
if (dm_path_to_handle((char*)path, &dmhandle, &dmhandle_len) != 0) {
- ret = -1;
DEBUG(2,("dm_path_to_handle failed - assuming offline (%s) - %s\n",
path, strerror(errno)));
- *offline = true;
+ offline = true;
goto done;
}
@@ -181,7 +179,7 @@ static int tsmsm_is_offline(struct vfs_handle_struct *handle,
DM_NO_TOKEN, &dmname, 0, NULL, &rlen);
/* its offline if the IBMObj attribute exists */
- *offline = (ret == 0 || (ret == -1 && errno == E2BIG));
+ offline = (ret == 0 || (ret == -1 && errno == E2BIG));
DEBUG(10,("dm_get_dmattr %s ret=%d (%s)\n", path, ret, strerror(errno)));
@@ -191,7 +189,7 @@ static int tsmsm_is_offline(struct vfs_handle_struct *handle,
done:
unbecome_root();
- return ret;
+ return offline;
}