Method for reusing identifiers to improve performance of open and close input/output requests for client drive redirection
A method of performing open and close input/output (I/O) requests targeting a directory of a client computing device includes the steps of: receiving a first I/O request to open the directory, from a driver of a host server, forwarding the first I/O request to the client computing device; in response to the first I/O request, receiving an identifier (ID) of the directory from the client computing device and transmitting the ID to the driver; in response to receiving a second I/O request to close the directory, from the driver, storing the ID in a cache, and not forwarding the second I/O request to the client computing device; and in response to receiving a third I/O request to open the directory, from the driver, retrieving the ID from the cache, and transmitting the ID to the driver again.
1 . A method of performing open and close input/output (I/O) requests targeting a directory of a client computing device during a process of copying a plurality of files of the directory from the client computing device to a host server that is hosting a remote desktop accessed by the client computing device, the method comprising:
receiving a first I/O request to open the directory, from a driver of the host server;
forwarding the first I/O request to the client computing device;
in response to the first I/O request, receiving an identifier (ID) of the directory from the client computing device and transmitting the ID to the driver;
in response to receiving a second I/O request to close the directory, from the driver,
responding to the driver with an indication that the directory was successfully closed without forwarding the second I/O request to the client computing device,
storing the ID in a cache in association with a path and open parameters of the directory, and
waiting for a predetermined amount of time to elapse during which unless the ID is retrieved from the cache during the predetermined amount of time;
in response to receiving a third I/O request to open the directory from the driver prior to the elapsing of the predetermined amount of time,
determining whether the third I/O request conflicts with the path or the open parameters associated with the stored ID,
retrieving the ID from the cache in response to determining that the third I/O request does not conflict with the path or the open parameters associated with the stored ID, and
transmitting the ID to the driver again without issuing an open request to the client computing device; and
in response to determining that the predetermined amount of time during which the ID is not retrieved from the cache has elapsed, forwarding the second I/O request to close the directory to the client computing device.
2 . The method of claim 1 , further comprising:
upon the transmitting of the ID to the driver again, removing the ID from the cache.
3 . The method of claim 2 , further comprising:
after the removing of the ID from the cache, and in response to receiving a fourth I/O request to close the directory, from the driver, storing the ID in the cache again, and not forwarding the fourth I/O request to the client computing device.
4 . The method of claim 1 , further comprising:
receiving a plurality of I/O requests from the driver between the receiving of the first I/O request from the driver and the receiving of the second I/O request from the driver; and
determining that the plurality of I/O requests are each in a whitelist of predetermined types of I/O requests, wherein the storing of the ID in the cache is performed in response to the determining that the plurality of I/O requests are each in the whitelist.
5 . The method of claim 1 , further comprising:
determining that there are no I/O requests that fit all of the following criteria: (1) has already been transmitted to the client computing device, (2) targets the ID, and (3) a response thereto has not been received from the client computing device, wherein the storing of the ID in the cache is performed in response to the determining that there are no I/O requests that fit the criteria.
6 . A non-transitory computer-readable medium comprising instructions that are executable in a remote desktop system, wherein the instructions when executed cause the remote desktop system to carry out a method of performing open and close input/output (I/O) requests targeting a directory of a client computing device during a process of copying a plurality of files of the directory from the client computing device to a host server that is hosting a remote desktop accessed by the client computing device, the method comprising:
receiving a first I/O request to open the directory, from a driver of the host server;
forwarding the first I/O request to the client computing device;
in response to the first I/O request, receiving an identifier (ID) of the directory from the client computing device and transmitting the ID to the driver;
in response to receiving a second I/O request to close the directory, from the driver,
responding to the driver with an indication that the directory was successfully closed without forwarding the second I/O request to the client computing device,
storing the ID in a cache in association with a path and open parameters of the directory, and
waiting for a predetermined amount of time to elapse during which unless the ID is retrieved from the cache during the predetermined amount of time;
in response to receiving a third I/O request to open the directory from the driver prior to the elapsing of the predetermined amount of time,
determining whether the third I/O request conflicts with the path or the open parameters associated with the stored ID,
retrieving the ID from the cache in response to determining that the third I/O request does not conflict with the path or the open parameters associated with the stored ID, and
transmitting the ID to the driver again; and
in response to determining that the predetermined amount of time during which the ID is not retrieved from the cache has elapsed, forwarding the second I/O request to close the directory to the client computing device.
7 . The non-transitory computer-readable medium of claim 6 , the method further comprising:
upon the transmitting of the ID to the driver again, removing the ID from the cache.
8 . The non-transitory computer-readable medium of claim 7 , the method further comprising:
after the removing of the ID from the cache, and in response to receiving a fourth I/O request to close the directory, from the driver, storing the ID in the cache again, and not forwarding the fourth I/O request to the client computing device.
9 . The non-transitory computer-readable medium of claim 6 , the method further comprising:
receiving a plurality of I/O requests from the driver between the receiving of the first I/O request from the driver and the receiving of the second I/O request from the driver; and
determining that the plurality of I/O requests are each in a whitelist of predetermined types of I/O requests, wherein the storing of the ID in the cache is performed in response to the determining that the plurality of I/O requests are each in the whitelist.
10 . The non-transitory computer-readable medium of claim 6 , the method further comprising:
determining that there are no I/O requests that fit all of the following criteria: (1) has already been transmitted to the client computing device, (2) targets the ID, and (3) a response thereto has not been received from the client computing device, wherein the storing of the ID in the cache is performed in response to the determining that there are no I/O requests that fit the criteria.
11 . A remote desktop system comprising:
a client computing device storing a directory including a plurality of files to be copied to the host server; and
a host server including a software program and a driver, wherein the software program is configured to:
receive a first I/O request to open the directory, from the driver;
forward the first I/O request to the client computing device;
in response to the first I/O request, receive an identifier (ID) of the directory from the client computing device and transmit the ID to the driver;
in response to receiving a second I/O request to close the directory, from the driver,
respond to the driver with an indication that the directory was successfully closed without forwarding the second I/O request to the client computing device,
store the ID in a cache in association with a path and open parameters of the directory, and
wait for a predetermined amount of time to elapse during which unless the ID is retrieved from the cache during the predetermined amount of time;
in response to receiving a third I/O request to open the directory from the driver prior to the elapsing of the predetermined amount of time,
determine whether the third I/O request conflicts with the path or the open parameters associated with the stored ID,
retrieve the ID from the cache in response to determining that the third I/O request does not conflict with the path or the open parameters associated with the stored ID, and
transmit the ID to the driver again; and
in response to determining that the predetermined amount of time during which the ID is not retrieved from the cache has elapsed, forward the second I/O request to close the directory to the client computing device.
12 . The remote desktop system of claim 11 , wherein the software program is further configured to:
upon the transmitting of the ID to the driver again, remove the ID from the cache.
13 . The remote desktop system of claim 12 , wherein the software program is further configured to:
after the removing of the ID from the cache, and in response to receiving a fourth I/O request to close the directory, from the driver, store the ID in the cache again, and not forward the fourth I/O request to the client computing device.
14 . The remote desktop system of claim 11 , wherein the software program is further configured to:
receive a plurality of I/O requests from the driver between the receiving of the first I/O request from the driver and the receiving of the second I/O request from the driver; and
determine that the plurality of I/O requests are each in a whitelist of predetermined types of I/O requests, wherein the storing of the ID in the cache is performed in response to the determining that the plurality of I/O requests are each in the whitelist.
15 . The method of claim 1 , further comprising:
in response to determining that the third I/O request conflicts with the path or open parameters associated with the stored ID,
deleting the stored ID from the cache,
transmitting, to the client computing device, a request to close the directory associated with the stored ID,
receiving a response from the client computing device indicating that the directory was successfully closed, and
forwarding the third I/O request to the client computing device.
16 . The non-transitory computer-readable medium of claim 6 , the method further comprising:
in response to determining that the third I/O request conflicts with the path or open parameters associated with the stored ID,
deleting the stored ID from the cache,
transmitting, to the client computing device, a request to close the directory associated with the stored ID,
receiving a response from the client computing device indicating that the directory was successfully closed, and
forwarding the third I/O request to the client computing device.
17 . The remote desktop system of claim 11 , wherein the software program is further configured to:
in response to determining that the third I/O request conflicts with the path or open parameters associated with the stored ID,
delete the stored ID from the cache,
transmit, to the client computing device, a request to close the directory associated with the stored ID,
receive a response from the client computing device indicating that the directory was successfully closed, and
forward the third I/O request to the client computing device.