From 026a66abecea3e3a54cdbfb97129d5e65608e5df Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Thu, 17 Jan 2008 14:57:35 +0300 Subject: Rework of VFS is_offline() function to only return boolean offline/online result for a file. This makes sense as upper levels are only taking returned result of 0 (no error) into consideration when deciding whether to mark file offline/online as returned from is_offline. That means that we simply can move the decision down to VFS module and clean up upper levels so that they always see only file status. If there is an error when trying to identify file status, then VFS module could decide what to return (offline or online) by itself -- after all, it ought to have system-specific knowledge anyway. (This used to be commit 75cc08661473cce62756fa062071bb2bc1fb39ec) --- examples/VFS/skel_opaque.c | 4 ++-- examples/VFS/skel_transparent.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/VFS') diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index 1c2fc45011..42154c47a6 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -585,9 +585,9 @@ static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct return vfswrap_aio_force(NULL, fsp); } -static int skel_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf, bool *offline) +static bool skel_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf) { - return vfswrap_set_offline(NULL, path, sbuf, offline); + return vfswrap_is_offline(NULL, path, sbuf); } static int skel_set_offline(struct vfs_handle_struct *handle, const char *path) diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 0a934976c4..997783819c 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -544,9 +544,9 @@ static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct return SMB_VFS_NEXT_AIO_FORCE(handle, fsp); } -static int skel_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf, bool *offline) +static bool skel_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf) { - return SMB_VFS_NEXT_IS_OFFLINE(handle, path, sbuf, offline); + return SMB_VFS_NEXT_IS_OFFLINE(handle, path, sbuf); } static int skel_set_offline(struct vfs_handle_struct *handle, const char *path) -- cgit From 03387a0f5886d449eda359a5acecd830f3bd35bc Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Thu, 17 Jan 2008 16:51:14 +0300 Subject: Remove is_remotestorage() call from VFS. We already have statvfs() there to handle FS capabilities. As discussed with Volker, it is better to calculate FS capabilities at connection time. We already do this with help of VFS statvfs() call which allows to fill-in system-specific attributes including FS capabilities. So just re-use it if you want to represent additional capabilities in your modules. The only caution is that you need to call underlying statvfs() call to actually get system-specific capabilities (and other fields) added. Then add module-specific ones. (This used to be commit e342ca0d931f9a5c8ec9e472dc9c63f1fe012b3a) --- examples/VFS/skel_opaque.c | 6 ------ examples/VFS/skel_transparent.c | 1 - 2 files changed, 7 deletions(-) (limited to 'examples/VFS') diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index 42154c47a6..4a6e6be42f 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -595,11 +595,6 @@ static int skel_set_offline(struct vfs_handle_struct *handle, const char *path) return vfswrap_set_offline(NULL, path); } -static bool skel_is_remotestorage(struct vfs_handle_struct *handle, const char *path) -{ - return vfswrap_is_remotestorage(NULL, path); -} - /* VFS operations structure */ static vfs_op_tuple skel_op_tuples[] = { @@ -724,7 +719,6 @@ static vfs_op_tuple skel_op_tuples[] = { /* offline operations */ {SMB_VFS_OP(skel_is_offline), SMB_VFS_OP_IS_OFFLINE, SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(skel_set_offline), SMB_VFS_OP_SET_OFFLINE, SMB_VFS_LAYER_OPAQUE}, - {SMB_VFS_OP(skel_is_remotestorage), SMB_VFS_OP_IS_REMOTESTORAGE, SMB_VFS_LAYER_OPAQUE}, {NULL, SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} }; diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 997783819c..f4cb9b15ba 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -681,7 +681,6 @@ static vfs_op_tuple skel_op_tuples[] = { /* offline operations */ {SMB_VFS_OP(skel_is_offline), SMB_VFS_OP_IS_OFFLINE, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_set_offline), SMB_VFS_OP_SET_OFFLINE, SMB_VFS_LAYER_TRANSPARENT}, - {SMB_VFS_OP(skel_is_remotestorage), SMB_VFS_OP_IS_REMOTESTORAGE, SMB_VFS_LAYER_TRANSPARENT}, {NULL, SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} }; -- cgit