Many protocols such as the universal serial bus (USB) mass storage protocol implement block-level input/output (I/O) to attach removable storage devices to computing devices. The block-level I/O reads and writes raw disk sectors unlike a file-level protocol such as the file transfer protocol (FTP). As such, the existing protocols are limited. For example, with the existing systems, the removable storage devices and the computing devices must share the same file system format such as the file allocation table (FAT) file system. Additionally, the removable storage device may be connected to only one computing device at a time.
The existing systems are not suitable for complex devices such as mobile telephones and personal digital assistants that desire to expose internal memory to a host device via USB. For example, both the operating system on the mobile telephone and the operating system on the host device cannot manage the memory simultaneously. Additionally, with the existing systems, the mobile telephone is limited to implementing a file system format common to most host devices, which may not be appropriate for the mobile telephone.
Embodiments of the invention create a virtualized storage device on a file system. Block-level storage units corresponding to the file system are defined for a storage volume associated with a computing device. Responsive to receipt of a block-level command, the computing device identifies a file system operation corresponding to the block-level command. The computing device performs the file system operation for the storage volume.
This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used as an aid in determining the scope of the claimed subject matter.
Corresponding reference characters indicate corresponding parts throughout the drawings.
Embodiments of the invention provide a virtual storage volume 110 for a file system 108 on a first computing device 102 such as shown in
In some embodiments, the high-compatibility rate of common file systems such as the file allocation table (FAT) file system over a block-level protocol is leveraged by exposing a simulated FAT-formatted block device (e.g., the virtual storage volume 110). While some embodiments are described with reference to the FAT file system, universal serial bus (USB) mass storage protocol, or other specific file systems or protocols, other file systems and protocols are contemplated. Embodiments of the invention are operable with any file system 108 or block-level protocol or I/O mechanism. Further, while some embodiments of the invention are illustrated and described herein with reference to a mobile computing device such as a mobile computing device 402 (see
Referring again to
The virtual storage volume 110 enables file sharing between the first computing device 102 and the second computing device 104 so that the file system 108 is accessible to both devices 102, 104 simultaneously. Further, by monitoring the incoming block-level I/O from the second computing device 104, the virtual storage volume 110 prevents the second computing device 104 from corrupting the data stored in the storage volumes 106. Additionally, because of the existence of the virtual storage volume 110, the second computing device 104 does not need to understand the format of the file system 108 of the first computing device 102. Aspects of the invention also enable the first computing device 102 to implement encryption for the file system 108 and storage volumes 106. In such an embodiment, the virtual storage volume 110 supports the encryption and decryption of data to and from the file system 108.
In an example, the first computing device 102 is the mobile computing device 402, the storage volumes 106 include internal flash and a removable media card, and the second computing device 104 comprises a host such as a laptop or desktop. In this example, the mobile computing device 402 may expose the internal flash and removable media card as a single virtual storage volume or as separate virtual storage volumes. Further to this example, the mobile computing device 402 receives the block-level commands as a small computer system interface (SCSI) command over a universal serial bus (USB). Yet further, both the mobile computing device 402 and the host are able to access the internal flash and the removable media card at the same time.
Referring next to
The memory area 206 further stores computer-executable components including a map component 210, an interface component 212, a translation component 214, and a monitor component 216. While the memory area 206 is shown as a different element from the storage volumes 106 in
The map component 210 defines the block-level storage units corresponding to the file system 108 for the storage volume 106 associated with the computing device 202. For example, the map component 210 creates and exposes cluster chains corresponding to the file system units. The map component 210 further defines metadata describing the files and directories in the file system 108. In some embodiments, the map component 210 defines the block-level storage units corresponding to selected file system units only. The selected file system units may be chosen based on various criteria or explicit configuration input from a user. For example, the user may identify the particular files (e.g., a subset of all the files) and directories to be exposed to other devices via the virtual storage volume 110.
The interface component 212 receives a block-level command from, for example, a computing device such as the second computing device 104 in
In an embodiment, the processor 204 is transformed into a special purpose microprocessor by executing computer-executable instructions or by otherwise being programmed. For example, the processor 204 executes computer-executable instructions for performing the operations illustrated in
In other embodiments (not shown), the block-level storage units correspond to only a subset of the file system units associated with the file system 108. For example, the subset may be identified explicitly by the user as configuration input, or the subset may be programmatically identified based on pre-defined criteria such as the location of the files within the file system 108 (e.g., in a protected directory such as a directory containing operating system files).
If block-level commands are received from the second computing device 104 at 304, the file system operation corresponding to the received block-level command is identified at 306 based on the defined block-level storage units. The identified file system operation is provided to the file system 108 at 308 for execution on the storage volume 106 of the first computing device 102.
Referring next to
In the example of
The cluster I/O mapper 414 receives incoming block-level I/O from the host computing device 404, and separates the received I/O into the virtual metadata 410 and the file data 412. For example, if the received I/O corresponds to a command to create a new file, the cluster I/O mapper 414 updates the virtual file metadata, translates the command to a file-level operation, and provides the file-level operation to the file system 108. In a similar example, if the received I/O corresponds to a command to create a new directory, the cluster I/O mapper 414 updates the virtual directory metadata, translates the command to a file-level operation, and provides the file-level operation to the file system 108. As another example, if the received I/O corresponds to file data 412 (or payload data), the cluster I/O mapper 414 maps the received I/O to file-level I/O and provides the file-level I/O to the file system 108.
In an embodiment, the cluster I/O mapper 414 is a FAT virtualization layer that describes a set of files to be shared with the host computing device 404 and manages the mapping of names, sizes, and data of files and directories to those stored on the mobile computing device 402 independent of the file system format internal to the mobile computing device 402. The FAT virtualization layer simulates, emulates, or otherwise presents cluster chains corresponding to one or more files in the file system 108. If the host computing device 404 makes modifications to the FAT, the changes are communicated to the cluster I/O mapper 414. The cluster chains of the virtual FAT are mapped to the actual file contents on the storage device. The cluster chains are allocated in random access memory (RAM) or separate files. The size of the virtual FAT, and the storage volume 106 exposed, depend on the quantity of files being shared and the amount of free space available for the host computing device 404 to create new files. In some embodiments, the virtual FAT data is written to disk or saved as a memory-mapped file to reduce RAM usage.
In the FAT virtualization layer example, virtual directories include specially allocated cluster chains containing FAT directory entries generated by the mobile computing device 402. Each file exposed to the host computing device 404 is given an entry in one of the virtualized directories. If the host computing device 404 creates new files, those changes are translated to new file creation on the mobile computing device 402. Depending at least on the complexity of the system, the mobile computing device 402 may expose a single virtual directory containing all files to be shared, or the mobile computing device 402 may map files to multiple virtual directories. Virtual directory data may be allocated in RAM for higher performance or written to disk to reduce RAM usage.
Write operations performed by the host computing device 404 are monitored and interpreted by the FAT virtualization layer so the write operations may be translated to file-level operations to be performed on the mobile computing device 402. For example, the virtual FAT is monitored for new allocations: the host computing device 404 may create or delete new files and directories, extend or truncate existing files and directories, and/or potentially re-map existing cluster chains to new clusters. Further, each virtual directory is monitored for file name, timestamp, and attribute changes as well as file creation and deletion.
Referring next to
A computer or computing device such as described herein has one or more processors or processing units, system memory, and some form of computer readable media. By way of example and not limitation, computer readable media comprise computer storage media and communication media. Computer storage media include volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Communication media typically embody computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism and include any information delivery media. Combinations of any of the above are also included within the scope of computer readable media.
Although described in connection with an exemplary computing system environment, embodiments of the invention are operational with numerous other general purpose or special purpose computing system environments or configurations. The computing system environment is not intended to suggest any limitation as to the scope of use or functionality of any aspect of the invention. Examples of well known computing systems, environments, and/or configurations that may be suitable for use with aspects of the invention include, but are not limited to, personal computers, server computers, hand-held or laptop devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, mobile telephones, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
Embodiments of the invention may be described in the general context of computer-executable instructions, such as program modules, executed by one or more computers or other devices. The computer-executable instructions may be organized into one or more computer-executable components or modules. Generally, program modules include, but are not limited to, routines, programs, objects, components, and data structures that perform particular tasks or implement particular abstract data types. Aspects of the invention may be implemented with any number and organization of such components or modules. For example, aspects of the invention are not limited to the specific computer-executable instructions or the specific components or modules illustrated in the figures and described herein. Other embodiments of the invention may include different computer-executable instructions or components having more or less functionality than illustrated and described herein.
The embodiments illustrated and described herein as well as embodiments not specifically described herein but within the scope of aspects of the invention constitute exemplary means for virtualizing the block-level storage volume 106 on top of the file system 108 on the mobile computing device 402, and exemplary means for simulating cluster chains for the file system units.
The order of execution or performance of the operations in embodiments of the invention illustrated and described herein is not essential, unless otherwise specified. That is, the operations may be performed in any order, unless otherwise specified, and embodiments of the invention may include additional or fewer operations than those disclosed herein. For example, it is contemplated that executing or performing a particular operation before, contemporaneously with, or after another operation is within the scope of aspects of the invention.
When introducing elements of aspects of the invention or the embodiments thereof, the articles “a,” “an,” “the,” and “said” are intended to mean that there are one or more of the elements. The terms “comprising,” “including,” and “having” are intended to be inclusive and mean that there may be additional elements other than the listed elements.
Having described aspects of the invention in detail, it will be apparent that modifications and variations are possible without departing from the scope of aspects of the invention as defined in the appended claims. As various changes could be made in the above constructions, products, and methods without departing from the scope of aspects of the invention, it is intended that all matter contained in the above description and shown in the accompanying drawings shall be interpreted as illustrative and not in a limiting sense.