summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-02-01 20:40:06 +0100
committerVolker Lendecke <vl@samba.org>2012-02-02 20:35:27 +0100
commit03300f233c429caa9ec43cebebc603f4c7a513cb (patch)
tree29bd4bdf64cc0bb14d3d18fc32528799fb5aa21d /source3
parent3bea5a147b2a381fc4fa860c7b1ceeed11be4e80 (diff)
downloadsamba-03300f233c429caa9ec43cebebc603f4c7a513cb.tar.gz
samba-03300f233c429caa9ec43cebebc603f4c7a513cb.tar.bz2
samba-03300f233c429caa9ec43cebebc603f4c7a513cb.zip
s3: Simplify streams_depot a bit
b0c0b949 is a bit involved. Passing down booleans is almost never very clear
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/vfs_streams_depot.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/source3/modules/vfs_streams_depot.c b/source3/modules/vfs_streams_depot.c
index a18827421a..f268492ade 100644
--- a/source3/modules/vfs_streams_depot.c
+++ b/source3/modules/vfs_streams_depot.c
@@ -67,15 +67,10 @@ static uint32_t hash_fn(DATA_BLOB key)
* an option to put in a special ACL entry for a non-existing group.
*/
-static bool file_is_valid(vfs_handle_struct *handle, const char *path,
- bool check_valid)
+static bool file_is_valid(vfs_handle_struct *handle, const char *path)
{
char buf;
- if (!check_valid) {
- return true;
- }
-
DEBUG(10, ("file_is_valid (%s) called\n", path));
if (SMB_VFS_GETXATTR(handle->conn, path, SAMBA_XATTR_MARKER,
@@ -92,16 +87,11 @@ static bool file_is_valid(vfs_handle_struct *handle, const char *path,
return true;
}
-static bool mark_file_valid(vfs_handle_struct *handle, const char *path,
- bool check_valid)
+static bool mark_file_valid(vfs_handle_struct *handle, const char *path)
{
char buf = '1';
int ret;
- if (!check_valid) {
- return true;
- }
-
DEBUG(10, ("marking file %s as valid\n", path));
ret = SMB_VFS_SETXATTR(handle->conn, path, SAMBA_XATTR_MARKER,
@@ -214,7 +204,8 @@ static char *stream_dir(vfs_handle_struct *handle,
goto fail;
}
- if (file_is_valid(handle, smb_fname->base_name, check_valid)) {
+ if (!check_valid ||
+ file_is_valid(handle, smb_fname->base_name)) {
return result;
}
@@ -294,7 +285,7 @@ static char *stream_dir(vfs_handle_struct *handle,
goto fail;
}
- if (!mark_file_valid(handle, smb_fname->base_name, check_valid)) {
+ if (check_valid && !mark_file_valid(handle, smb_fname->base_name)) {
goto fail;
}