mirror of
https://github.com/samba-team/samba.git
synced 2025-12-13 16:23:50 +03:00
Ok - this is a big patch - and it may break smbd a bit (although
I hope not). If you encounter strange file-serving behavior after this patch then back it out. I analysed our stat() usage and realised we were doing approx. 3 stat calls per open, and 2 per getattr/setattr. This patch should fix all that. It causes the stat struct returned from unix_convert() (which now *must* be passed a valid SMB_STRUCT_STAT pointer) to be passed through into the open code. This should prevent the multiple stats that were being done so as not to violate layer encapsulation in the API's. Herb - if you could run a NetBench test with this code and do a padc/par syscall test and also run with the current 2.2.0 code and test the padc/par syscalls I'd appreciate it - you should find the number of stat calls reduced - not sure by how much. The patch depends on unix_convert() actually finding the file and returning a stat struct, or returning a zero'd out stat struct if the file didn't exist. I believe we can guarentee this to be the case - I just wasn't confident enough to make this an assertion before. Ok ok - I did write this whilst at the Miami conference..... sometimes you get a little free time at these things :-). Jeremy.
This commit is contained in:
@@ -104,8 +104,8 @@
|
||||
* stat structure is valid.
|
||||
*/
|
||||
|
||||
#define VALID_STAT(st) (st.st_nlink != 0)
|
||||
#define VALID_STAT_OF_DIR(st) (VALID_STAT(st) && S_ISDIR(st.st_mode))
|
||||
#define VALID_STAT(st) ((st).st_nlink != 0)
|
||||
#define VALID_STAT_OF_DIR(st) (VALID_STAT(st) && S_ISDIR((st).st_mode))
|
||||
|
||||
#define SMBENCRYPT() (lp_encrypted_passwords())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user