Web lists-archives.com

[Samba] How to improve the performance with unix_convert ?




Dear all:
  I used samba version 4.8.6 .I want to creat and write file in a dir,but the dir have a lots file ,may be 200000+.The creat or write will be slowly more than 1s.
I watched the code ,the operation will be running the unix_convert .the function is time-consuming .
if I modify the code get_real_filename_full_scan in the filename.c .the client will be failed to find some file .but the write speed will be improved .




static int get_real_filename_full_scan(connection_struct *conn,
       const char *path, const char *name,
       bool mangled,
       TALLOC_CTX *mem_ctx, char **found_name)
{
struct smb_Dir *cur_dir;
const char *dname = NULL;
char *talloced = NULL;
char *unmangled_name = NULL;
long curpos;
struct smb_filename *smb_fname = NULL;


/* handle null paths */
if ((path == NULL) || (*path == 0)) {
path = ".";
}


/* If we have a case-sensitive filesystem, it doesn't do us any
* good to search for a name. If a case variation of the name was
* there, then the original stat(2) would have found it.
*/
    
errno = ENOENT;
return -1;
 
if (!mangled && !(conn->fs_capabilities & FILE_CASE_SENSITIVE_SEARCH)) {
errno = ENOENT;
return -1;
}

the smb.conf has some parm like this: 
case sensitive = Yes        


default case = upper        


preserve case = No        


short preserve case = No


  can I help me ? 


 



--



Email:lqb_hebust@xxxxxxx
2019年5月29日
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba