Improve performance of (large) directory listings: Avoid
stat:ing each file many times. The patch modifies rdesktop so that the g_notify_stamp is only set when writing. Also, the stamp is not set before disk_create_notify(), since this would mean that NotifyInfo would be called twice directly. With this patch, the number of stat:s has dropped from 24 to 4, using my tests. git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1401 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
995f232b2b
commit
75bd1939f8
3
disk.c
3
disk.c
@ -493,6 +493,8 @@ disk_create(uint32 device_id, uint32 accessmask, uint32 sharemode, uint32 create
|
|||||||
g_fileinfo[handle].accessmask = accessmask;
|
g_fileinfo[handle].accessmask = accessmask;
|
||||||
strncpy(g_fileinfo[handle].path, path, PATH_MAX - 1);
|
strncpy(g_fileinfo[handle].path, path, PATH_MAX - 1);
|
||||||
g_fileinfo[handle].delete_on_close = False;
|
g_fileinfo[handle].delete_on_close = False;
|
||||||
|
|
||||||
|
if (accessmask & GENERIC_ALL || accessmask & GENERIC_WRITE)
|
||||||
g_notify_stamp = True;
|
g_notify_stamp = True;
|
||||||
|
|
||||||
*phandle = handle;
|
*phandle = handle;
|
||||||
@ -506,6 +508,7 @@ disk_close(RD_NTHANDLE handle)
|
|||||||
|
|
||||||
pfinfo = &(g_fileinfo[handle]);
|
pfinfo = &(g_fileinfo[handle]);
|
||||||
|
|
||||||
|
if (pfinfo->accessmask & GENERIC_ALL || pfinfo->accessmask & GENERIC_WRITE)
|
||||||
g_notify_stamp = True;
|
g_notify_stamp = True;
|
||||||
|
|
||||||
rdpdr_abort_io(handle, 0, RD_STATUS_CANCELLED);
|
rdpdr_abort_io(handle, 0, RD_STATUS_CANCELLED);
|
||||||
|
2
rdpdr.c
2
rdpdr.c
@ -645,8 +645,6 @@ rdpdr_process_irp(STREAM s)
|
|||||||
|
|
||||||
in_uint32_le(s, info_level); /* notify mask */
|
in_uint32_le(s, info_level); /* notify mask */
|
||||||
|
|
||||||
g_notify_stamp = True;
|
|
||||||
|
|
||||||
status = disk_create_notify(file, info_level);
|
status = disk_create_notify(file, info_level);
|
||||||
result = 0;
|
result = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user