Method and system for file retrieval using image virtual file system

Methods and systems have been provided that allow a user to access a file in a computational device. The location of the file is made transparent to the user. The request for the file includes the filename. The filename is mapped to the location of the file in the computational device. The file is returned if it is present in the cache of the computational device. Otherwise, the file is retrieved from a storage device. The cached files are, deleted from the cache on the basis of a policy-based-cache-deletion mechanism.

BACKGROUND OF THE INVENTION

1. Field of Invention

Embodiments of the invention relate, in general, to file systems in a computational device. More specifically, embodiments of the invention relate to methods and systems for accessing a file from a memory or a local device in the computational device.

2. Description of the Background Art

A typical file system stores and organizes computer files and data in a computational device. The file system records the location of all the files and directories present in, for example, the hard disk, CD-ROM and other data storage devices. Moreover, the typical file system helps a user to manipulate, navigate, access and retrieve desired files from a computational device.

Conventionally, various file systems are used to access a file from any location in a Computational device. One conventional file system is a LINUX™-based, buffered file system. This file system requires virtual memory (VM) support to function. Virtual Memory is a computer design feature that permits software to use more main memory than the computer physically possesses. In the VM-based file system, VM buffers disk pages and files. Whenever a user wants to access a file, it is checked if the file is present in a buffer cache. The file is fetched from the disk if it is not present in the buffer cache. The files are automatically stored in the buffer cache and are deleted from it on the basis of a Least Recently Used (LRU)-based mechanism. According to the LRU-based mechanism, a file is deleted from the buffer cache when it is marked least recently used among a given set of files. This can sometimes lead to the deletion of files, which might be needed after the file has been deleted.

Moreover, the VM-based file system is a disk-block-based system, therefore, the user needs to know the location of the file in the computational device in order to access it. Therefore, the location of the file is not transparent to the user. This can make accessing a file difficult and time-consuming for the user.

DETAILED DESCRIPTION OF EMBODIMENTS OF THE INVENTION

Various embodiments of the invention provide methods, systems, and computer-readable media to retrieve files from memory or user configurable storage archive using an Image Virtual File System (IVFS). In the description herein for embodiments of the invention, numerous specific details are provided, such as examples of components and/or methods, to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that an embodiment of the invention can be practiced without one or more of the specific details, or with other apparatus, systems, assemblies, methods, components, materials, parts, and/or the like. In other instances, well-known structures, materials, or operations are not specifically shown or described in detail to avoid obscuring aspects of embodiments of the invention.Referring now to the drawings more particularly by reference numbers;FIG. 1illustrates an environment100wherein various embodiments of the invention can be performed. Environment100includes computational devices102that are connected to each other through a network104. Examples of computational devices102include, but are not limited to, computers, mobile devices and Personal Digital Assistants (PDAs). Computational devices102can be connected in various topologies, such as ring, tree, star, bus and mesh. Computational devices102share resources with each other in the form of files. The resources can be data, computational services or a combination of data and computational services. A collection of resources is referred to herein as a file. Computational devices102receive and transmit files via network104. Network104can be a wired or a wireless network.

FIG. 2illustrates a user202interacting with a computational device102a, in accordance with various embodiments of the invention. Computational device102a, hereinafter referred to as a receiving computational device, receives a request for a file, from user202. Examples of the requested file include, but are not limited to, Microcode, Tool Command Language (TCL) scripts and code-signing files. The receiving computational device comprises an Image Virtual File System (IVFS)204that serves the requested file to user202. User202may be an individual or it may be another computational device issuing a request for a file. IVFS204is a file system that stores and organizes files and data in the receiving computational device. IVFS204can work independently of virtual memory support. Moreover, IVFS204records the location of all the files and directories present in, for example, the hard disk, CD-ROM and other data storage devices in the receiving computational device. In addition, IVFS204allows user202to manipulate, navigate, access and retrieve the requested files from the receiving computational device without the need to know the exact location of the requested files in the receiving computational device. Therefore, the location of the requested file is transparent to user202.

FIG. 3illustrates various elements used for retrieving a file, in accordance with various embodiments of the invention. As stated earlier, user202can access the requested file from the receiving computational device by using IVFS204, while the exact location of the requested file is transparent to user202. IVFS204can receive the request for the requested file in the form of a filename. Further, IVFS204can map the filename to a location of the requested file in the receiving computational device with the help of a look-up table302. The requested file can be located in a cache304of the receiving computational device or in a storage device306. Cache304is a part of the memory of the receiving computational device. Cache304temporarily stores files for an easy and quick access. Storage device306can be included in the memory of the receiving computational device or a local device attached to the receiving computational device. In an embodiment of the invention, storage device306can be included in a computational device different from computational devices102and attached to the receiving computational device through network104. Moreover, storage device306can be included in a local device attached to or in the memory of a computational device different from computational devices102that is attached to the receiving computational device. Therefore, the requested file can be retrieved either from cache304or storage device306when requested by user202. Storage device306may comprise magnetic or optical storage such as is commonly used to store computer data and files. By way of example, storage device306may be a storage area network, a magnetic tape drive, a magnetic disk drive or non-volatile semiconductor memory.

FIG. 4illustrates various modules present in IVFS204of the receiving computational device, in accordance with various embodiments of the invention. Each computational device from computational devices102includes IVFS204. IVFS204includes a receiving module402, a mapping module404, a returning module406, a retrieving module408, a caching module410, a categorizing module412and a deleting module414. Receiving module402of the receiving computational device receives the request for the requested file from user202. Mapping module404maps the filename to the location of the requested file in the requesting computational device. The mapping is performed with the help of look-up table302. Look-up table302represents a table that includes the filenames of the files present in the receiving computational device along with their locations in either cache304or storage device306. Returning module406returns the requested file from cache304if the requested file is present in cache304. If the requested file is not present in cache304, then retrieving module408of the receiving computational device can retrieve the requested file from storage device306.

Caching module410saves the retrieved files, hereinafter referred to as the cached files, in cache304of the receiving computational device. Caching module410can save the retrieved files in either a compressed or a decompressed form. Therefore, cache304includes only those files that have been requested by user202. The cached files and the available space in cache304have a significant impact on the boot-up time of computational devices102. Therefore, there may be a significant reduction in the boot-up time of computational devices102. In an embodiment of the invention, many real time mobile devices such as mobile phones can also experience a significant reduction in the boot-up time. Moreover, as files are returned from cache304of the receiving computational device, the time taken by the receiving computational device to serve the request can also be reduced.

Categorizing module412categorizes the cached files in different categories. The details regarding different categories are described later with reference toFIG. 7. These categories can be used by deleting module414to delete the cached files. Deleting module414deletes the cached files on the basis of a policy-based-cache-deletion mechanism. The policy-based-cache-deletion mechanism deletes the cached files on the basis of the category assigned to them by categorizing module412. In accordance with an embodiment of the invention, the policy-based-cache-deletion mechanism is defined by user202. Further, user202can define the categories in which categorizing module412categorizes the files.

FIG. 5is a flowchart, illustrating a method for accessing the requested file from the receiving computational device, in accordance with various embodiments of the invention. At step502, receiving module402receives the request for the requested file from user202. In accordance with various embodiments, receiving module402receives the request in the form of the filename of a requested file. At step504, mapping module404maps the filename to the location of the requested file in the receiving computational device. The mapping is performed on the basis of look-up table302. The requested file may be located in either cache304or storage device306. At step506, it is checked if the requested file is present in cache304. If the requested file is present in cache304, then at step508, returning module406returns the requested file from cache304. If the requested file is not present in cache304, then, at step510, retrieving module408retrieves the requested file from storage device306. The retrieved file is further saved in cache304of the receiving computational device. Therefore, for future requests the file can be accessed from cache304, and this accelerates serving the future requests for the file.

FIG. 6is a flowchart, illustrating a method for handling the retrieved files in the receiving computational device, in accordance with various embodiments of the invention. At step602, the retrieved files are saved in cache304of the receiving computational device by caching module410. At step604, the cached files can be added to an in-memory image file system, in accordance with an embodiment of the invention. The in-memory image file system is a part of IVFS204. It is created over the cached files during the system's boot up. The in-memory image file system is based on the existing simple file system infrastructure and can be used to read the cached files from cache304. Further, at step606, the cached files can be deleted by deleting module414on the basis of the policy-based-cache-deletion mechanism. The policy-based-cache-deletion mechanism has been described with reference toFIG. 7.

Cache304is a part of the memory of the receiving computational device. Being a part, cache304has a limited memory size. This implies that cache304can save only a limited number of the retrieved files. Therefore, some cached files may have to be deleted from cache304to optimize the usage of the memory space. User202defines the basis on which the cached files are deleted. The deletion mechanism of the cached files depends on the availability of the cached files in storage device306and their importance with reference to user202. For example, a cached file may not have a copy in storage device306. User202may never want to delete the cached file from cache304for an easy access to the cached file. However, there can be some cached files that may be unimportant for user202. Therefore, user202may want to delete these cached files from cache304. In an embodiment of the invention, the deletion of the cached files is prevented when the receiving computational device is net booted or warm booted. The policy-based-cache-deletion mechanism therefore facilitates the optimization of the usage of the memory space provided for cache304.

FIG. 7is a flowchart, illustrating a method for deleting the cached files from the receiving computational device, in accordance with various embodiments of the invention. As described earlier, the cached files can be deleted from cache304on the basis of the policy-based-cache-deletion mechanism. This policy-based-cache-deletion mechanism is used to delete files based on the categories assigned to the cached files. At step702, the cached files are categorized into categories by categorizing module412. Further, at step704, deleting module414deletes the cached files from cache304on the basis of different categories assigned to them.

The number of categories and the definitions of the categories can be defined by user202. For example, user202can specify four categories. The categories can be, for example, ‘always delete’, ‘never delete’, ‘delete if a local replica is present’ and ‘delete if local replica is present under low-memory conditions’. Accordingly, cached files that are categorized as ‘always delete’, will be deleted, irrespective of any other conditions. Further, cached files that are categorized as ‘never delete’ will never be deleted, irrespective of any other condition. In accordance with an embodiment of the invention, user202can interfere with the policy-based-cache-deletion mechanism. For example, user202can delete a cached file that has been categorized as ‘never delete’. The implementation of embodiments of the invention using these categories has been described in conjunction withFIG. 8.

FIG. 8is a flowchart, illustrating a method for deleting a cached file from the receiving computational device, in accordance with an embodiment of the invention. At step802, deleting module414checks if any cached file has been assigned the category of ‘delete if a local replica is present’. If a cached file has been assigned the above-mentioned category, then at step804, deleting module414checks if the local replica of the cached file is present in storage device306. If the local replica is present, then at step806, the cached file is deleted from cache304.

FIG. 9is a flowchart, illustrating a method for deleting a cached file from the receiving computational device, in accordance with another embodiment of the invention. At step902, deleting module414checks if low-memory conditions exist. The low-memory conditions for the cached file exist when the free space available in cache304becomes less than a predefined limit. User202can set the predefined limit. For example, if the available free memory in cache304in the receiving device is low, for example, if only 2 percent of the memory of cache304is free, it is considered to be as a low-memory condition. If, at step902it is found that low-memory conditions exist, then at step904deleting module414checks if any cached file has been assigned the category of ‘delete if a local replica is present under low memory conditions’. If a cached file has been assigned the above-mentioned category, then at step906, deleting module414checks if the local replica of the cached file is present in storage device306. If the local replica of the cached file is present in storage device306, then, at step908, the cached file is deleted from cache304.

Various embodiments of the invention facilitate user202to access the requested file from either cache304or storage device306, without having to know the exact location of the requested file. The location transparency is achieved by using IVFS204, which is a file-based system.

Various embodiments of the invention can be performed without virtual memory support, as IVFS204is used independently of virtual memory support.

Various embodiments of the invention facilitate the file-caching capability of IVFS204, wherein the retrieved files are cached in cache304.

Various embodiments of the invention facilitate the optimization of usage of the memory space provided for cache304. This space usage is optimized by saving only the required files and deleting the cached files from cache304on the basis of a policy-based-cache-deletion mechanism. The policy-based-cache-deletion mechanism can be user-defined.

Various embodiments of the invention facilitate the reduction of the boot-up time of the receiving computational device. This is possible, as the files are saved in cache304only when they are retrieved.

Various embodiments of the invention prevent the deletion of the cached files when the receiving computational device is net booted or warm booted.

Various embodiments of the invention facilitate a consistent file system interface to read the requested file from flash memory. The underlying file system interface is used to access the requested file from flash memory or storage device306. The file system interface depends on the type of archive in which the requested file to be read is included. For example, if the archive file format is Tape Archive Format (TAR) then the file system that can recognize the TAR format is used to extract the requested file. However, if the archive is a standalone file stored in an Advanced Technology Attachment (ATA) disk, then the interface corresponds to a simple ATA file system ‘open( )’ call.

Although specific protocols have been used to describe embodiments, other embodiments can use other transmission protocols or standards. Use of the terms ‘peer’, ‘client’, and ‘server’ can include any type of device, operation, or other process. The present invention can operate between any two processes or entities including users, devices, functional systems, or combinations of hardware and software. Peer-to-peer networks and any other networks or systems where the roles of client and server are switched, change dynamically, or are not even present, are within the scope of the invention.

Any suitable programming language can be used to implement the routines of the present invention including C, C++, JAVA™, assembly language, etc. Different programming techniques such as procedural or object oriented can be employed. The routines can execute on a single processing device or multiple processors. Although the steps, operations, or computations may be presented in a specific order, this order may be changed in different embodiments. In some embodiments, multiple steps shown sequentially in this specification can be performed at the same time. The sequence of operations described herein can be interrupted, suspended, or otherwise controlled by another process, such as an operating system, kernel, etc. The routines can operate in an operating system environment or as stand-alone routines occupying all, or a substantial part, of the system processing.

Also in the description herein for embodiments of the present invention, a portion of the disclosure recited in the specification contains material, which is subject to copyright protection. Computer program source code, object code, instructions, text or other functional information that is executable by a machine may be included in an appendix, tables, figures or in other forms. The copyright owner has no objection to the facsimile reproduction of the specification as filed in the Patent and Trademark Office. Otherwise all copyright rights are reserved.

A ‘computer’ for purposes of embodiments of the present invention may include any processor-containing device, such as a mainframe computer, personal computer, laptop, notebook, microcomputer, server, personal data manager or ‘PIM’ (also referred to as a personal information manager), smart cellular or other phone, so-called smart card, set-top box, or any of the like. A ‘computer program’ may include any suitable locally or remotely executable program or sequence of coded instructions, which are to be inserted into a computer, well known to those skilled in the art. Stated more specifically, a computer program includes an organized list of instructions that, when executed, causes the computer to behave in a predetermined manner. A computer program contains a list of ingredients (called variables) and a list of directions (called statements) that tell the computer what to do with the variables. The variables may represent numeric data, text, audio or graphical images. If a computer is employed for presenting media via a suitable directly or indirectly coupled input/output (I/O) device, the computer would have suitable instructions for allowing a user to input or output (e.g., present) program code and/or data information respectively in accordance with the embodiments of the present invention.

A ‘computer readable medium’ for purposes of embodiments of the present invention may be any medium that can contain and store the computer program for use by or in connection with the instruction execution system apparatus, system or device. The computer readable medium can be, by way of example only but not by limitation, a semiconductor system, apparatus, system, device, propagation medium, or computer memory.

Further, at least some of the components of an embodiment of the invention may be implemented by using a programmed general-purpose digital computer, by using application specific integrated circuits, programmable logic devices, or field programmable gate arrays, or by using a network of interconnected components and circuits. Connections may be wired, wireless, by modem, and the like.

Additionally, any signal arrows in the drawings/Figures should be considered only as exemplary, and not limiting, unless otherwise specifically noted. Combinations of components or steps will also be considered as being noted, where terminology is foreseen as rendering the ability to separate or combine is unclear.