An embodiment of the present invention will now be described, by way of further example only.
With the present invention, when a client requests a directory listing, the file system builds two lists; one is returned to the client, whilst the other is held by the server. The list returned to the client is a standard directory list with each entry extended to include a tag referring to the corresponding entry in the server-side list. The list held by the server includes (as a minimum) the tag; together with information about the physical location of each file on a drive (this is the information that is needed to open the file). Note that because each entry returned to the client is tagged, the client can freely sort its own list without breaking the link between that list and the server-side list.
Preferably, the server list is held in an array with the tag of each item in the list also acting as its index to the array.
When a client wants to open a file, a new open file method is provided by the file server. Instead of being passed a filename or a pathname as a parameter, this new method takes as a parameter the tag for one of the entries in the directory listing.
The file server then uses this tag to find the location information in its array and passes this to the file system. The file can then be opened immediately without having to search the directory again.
This method is clearly advantageous over a system which simply caches directory listings, in which files still have to be opened by name even when a cache hit occurs, incurring the extra search overhead. The multiple string comparisons that this entails, especially on modern systems which use Unicode filenames, are non trivial.
On read-only filesystems (such those for ROM and ROFS disks) the steps already described are sufficient, because the contents of the disks never change. There will therefore be a performance improvement for all cases where files are loaded after searching a directory listing; the filesystem innovations of this invention will always allow files to be opened directly by tag with no searches involved.
In order to extend this innovation to writeable drives, a mechanism to handle changes to a directory list may be included. Such changes can comprise, for example, changes to the length of existing files, file deletion, or the creation of new files.
A number of possible mechanisms for achieving this will now be described.
The most straightforward mechanism is to flag the entire server-side list as being invalid if the directory is changed. In this case, attempts to open a file (or any object) referred to by any entry by means of passing its tag then causes the file server to return an error code to the client, which then reverts to opening the file (or object) by name.
A modified implementation of the above mechanism requires the server-side list to additionally store the filename, as well as the tag and the physical location of the file. In this case, passing a tag to a file on an invalidated list causes the file server, rather than the client as in the above example, to revert to opening the file or object by name, transparently to the client.
An alternative mechanism which avoids the necessity for the storage of the filename in the server-side list is for an additional version of the file open method to be provided which takes both a tag and a filename as parameters. This mechanism may be used with writable filesystems and enables the transparent fallback to opening the file by name by the server described above without the necessity for the storage of filenames in the server-side list.
The fact that there is no need to keep filenames in the server-side list in this implementation is particularly advantageous as far as memory utilisation is concerned. Storage of all names (especially long Unicode names) can be particularly burdensome on memory; as a result, many *nix implementations of DNLC name caches have found it necessary to limit the size of cached names to around 15 characters, which seriously affects the utility of the name caching scheme. Battery operated mobile computing devices in particular are resource constrained, so a method enabling the server list to simply store tags and physical locations even for writable drives is considered highly desirable and beneficial.
Optionally, with either of the two latter mechanisms, the server-side list may be updated automatically at the same time as the reversion to name specified file tag opening by the server.
A set of more complex mechanisms may also be developed by enabling the file server to actively monitor activity that could potentially cause changes to a directory and to dynamically adjust the contents of its list to ensure that it was always valid. For example, the server may be arranged to check whether there is an open file listing on a directory before making a change and either invalidate a single entry in the server side array, or ideally update it with new information.
Where a single entry is invalidated, either an error code may be returned to the client, or if the server list included file names as described above, the server could automatically fall back on opening the file by name; optionally, the server-side list entry could be updated and revalidated at the same time.
The application of the invention to ROM/ROFS drives is most significant, as it directly improves device boot time. The simplicity of this form of the invention means that there is no significant run-time overhead beyond the initial generation and storage of the server-side list; and because this overhead involves internal memory on the computing device rather than slow external media, the initial overhead would almost certainly be recouped the first time a new call to open a file by tag is used.
One particular advantage of this invention is that it can be included in most filesystem application programme interfaces (APIs) without breaking compatibility with previous client APIs. The only changes needed will usually be one or more file Open( ) functions which take tags as parameters either in addition to or instead of filenames. However, it is acknowledged that some systems may require modification to use this invention but a method that encapsulates a directory search and a file open as a single operation would in most cases benefit in terms of speed of operation and power consumption were it to be adapted to make use of the invention.
There are a number of ways of deciding how many directory lists the file server should keep, examples of which will now be outlined:
Which of these options is best in any particular circumstance may be determined by profiling a device to discover common usage patterns. Those skilled in this art will both know how to achieve such profiling and will also appreciate that the necessary trade-off in memory usage against speed are dependent on circumstances and cannot be legislated rigidly in advance.
Thus, with the present invention, when reading a directory on a computing device, the file server adds unique tags to the listing when passing the listing to a client application. The file server keeps a list of the unique tags together with the physical addresses of the files to which they correspond. When a client wishes to open a file, it can do so by passing the tag to the file server. This enables the file server to load the file directly without having to undertake a second directory search to discover the physical location of the file from its filename.
The present invention is considered to provide several significant advantages over known file management systems, including
Although the present invention has been described with reference to particular embodiments, it will be appreciated that modifications may be effected whilst remaining within the scope of the present invention as defined by the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
0414175.0 | Jun 2004 | GB | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/GB05/02462 | 6/22/2005 | WO | 00 | 12/18/2006 |