mirror of
https://github.com/samba-team/samba.git
synced 2025-03-10 12:58:35 +03:00
vfs: Slightly speed up stream_dir()
lp_parm_bool() is a relatively expensive string-based operation. Do it only when needed. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
0dfaa08ce3
commit
ff63874306
@ -160,7 +160,6 @@ static char *stream_dir(vfs_handle_struct *handle,
|
||||
uint8_t first, second;
|
||||
struct file_id id;
|
||||
uint8_t id_buf[16];
|
||||
bool check_valid;
|
||||
char id_hex[sizeof(id_buf) * 2 + 1];
|
||||
char *rootdir = NULL;
|
||||
struct smb_filename *rootdir_fname = NULL;
|
||||
@ -168,9 +167,6 @@ static char *stream_dir(vfs_handle_struct *handle,
|
||||
struct vfs_rename_how rhow = { .flags = 0, };
|
||||
int ret;
|
||||
|
||||
check_valid = lp_parm_bool(SNUM(handle->conn),
|
||||
"streams_depot", "check_valid", true);
|
||||
|
||||
rootdir = stream_rootdir(handle,
|
||||
talloc_tos());
|
||||
if (rootdir == NULL) {
|
||||
@ -247,13 +243,18 @@ static char *stream_dir(vfs_handle_struct *handle,
|
||||
if (SMB_VFS_NEXT_STAT(handle, smb_fname_hash) == 0) {
|
||||
struct smb_filename *smb_fname_new = NULL;
|
||||
char *newname;
|
||||
bool delete_lost;
|
||||
bool check_valid, delete_lost;
|
||||
|
||||
if (!S_ISDIR(smb_fname_hash->st.st_ex_mode)) {
|
||||
errno = EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
check_valid = lp_parm_bool(SNUM(handle->conn),
|
||||
"streams_depot",
|
||||
"check_valid",
|
||||
true);
|
||||
|
||||
if (!check_valid ||
|
||||
file_is_valid(handle, smb_fname)) {
|
||||
return result;
|
||||
|
Loading…
x
Reference in New Issue
Block a user