Embodiments of the invention are generally directed toward searching file systems, and more specifically to searching snapshots of file systems.
Searching a file system requires iterating through a directory hierarchy to determine if elements of the file system such as a file or directory matching a search query are present. Searching a live file system takes time, and during that time the hierarchy of the file system may change. In order to prevent file system modification while conducting a search, it must be kept in a read-only state while conducting the search. Performing a coherent search of a live file system requires that the file system remain static during the search.
When the search of documents directory 105 is finished, the search is finished, since by the time the search reaches point 113, no files or directories are present. As a result, games directory 107 is not searched.
Embodiments of the invention receive a search query from a user. In response to the search query, a snapshot of the file system in its current state is taken. A coherent search of the snapshot is performed using the search query. Results of the search are presented to a user.
In other embodiments, a subsequent snapshot of the file system is taken after the first search is finished. A difference between the first snapshot and the subsequent snapshot is computed, and this difference is searched using the search query. Results of both searches are merged and results are presented to a user.
The present invention is illustrated by way of example and not limitation in the figures of the accompanying drawings in which like references indicate similar elements.
Various embodiments and aspects of the inventions will be described with reference to details discussed below, and the accompanying drawings will illustrate the various embodiments. The following description and drawings are illustrative of the invention and are not to be construed as limiting the invention. Numerous specific details are described to provide a thorough understanding of various embodiments of the present invention. However, in certain instances, well-known or conventional details are not described in order to provide a concise discussion of embodiments of the present inventions.
Reference in the specification to one embodiment or an embodiment means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the invention. The appearance of the phrase “in one embodiment” in various places in the specification do not necessarily refer to the same embodiment.
A search of the snapshot 203 is initiated in response to the search request. At time T2, the search of snapshot 203 has completed its search of the /docs directory. Between T1 and T2, the file system has changed from file system 201 into file system 205. In file system 205, the /games directory has been moved into the /bob directory. However, snapshot 203 remains the same. As a result, the search of snapshot 203 will search the /games directory. In one embodiment, the search determines that a location of a search result has changed and identifies the current location of the search result (e.g., by reviewing a file system log, or backtracking from the search result to determine its new path).
At block 303, the method notes the current state of the file system to be searched to create a snapshot. In one embodiment, a file system with inexpensive snapshots is used. A snapshot may be inexpensive because no data is copied when the snapshot is generated. When data is subsequently changed, the new data may be written in a different location in the file system, leaving the data of the snapshot intact.
At block 305, the method performs a search through the snapshot using the search query. In one embodiment, the search is performed through the snapshot in the same manner as it would be performed through the file system. The search may iterate through the directory structure of the snapshot of the file system, checking each file and directory to determine if any file or directory matches the search query. The search may be of metadata describing a file or directory, such as size, filename, date of creation, date of last modification, etc. The search may be of the content of files. For example, the content of a word processing file or a spreadsheet may be searched. In another embodiment, since changes to the file system do not affect the snapshot, the search is coherent, in that the file system is searched as it existed when the search was initiated.
At block 307, results from the search are displayed to a user on a display device such as a monitor or LCD panel. In other embodiments, the method is implemented as a plug-in, and provides results of the search to another entity for further processing or display. For example, the results may be processed to determine if the location of a search result has changed since the snapshot was taken.
At block 507, the method takes a subsequent snapshot of the file system after the initial search has completed. The subsequent snapshot includes any changes made to the file system since the initial snapshot was taken.
At block 509, the method searches the difference between the initial snapshot and the subsequent snapshot using the search query. This has the effect of limiting the subsequent search to changes made to the file system while the initial search was running. In one embodiment, searching the difference between the two snapshots consumes significantly less time and resources than searching the entire subsequent snapshot. In one embodiment, the difference is computed by identifying which blocks are different between the initial snapshot and the subsequent snapshot. By working backward from the list of changed blocks, files that changed between the two points in time corresponding to the snapshots can be identified.
At block 511, results of the initial search and the subsequent search are merged together. The merged results may be provided for display to a user. Merged results may have some overlap. For example, the subsequent search may find a file also found in the initial search, but in a different location. In this case, the subsequent result would be included in the merged results and the initial result discarded. As another example, a download being conducted by a web browser may complete during the initial search, which may cause the downloaded file to be renamed from a temporary file in a temporary directory (i.e., a directory that may be ignored during searches) to a meaningful filename in a download directory. If the meaningful filename matches the search query, the subsequent results and thus the merged results would include the downloaded file.
After initial search 607, initial results 613 include one file matching the search query. At time 615, a subsequent snapshot of file system 603 is taken. Subsequent search 617 identifies search hit 619, which was modified during initial search 607. After subsequent search 617 is complete, subsequent results 621 include hit 619. The results are merged to generate merged results 623, which may be provided to a user for display.
As shown in
The mass storage 711 is typically a magnetic hard drive or a magnetic optical drive or an optical drive or a DVD RAM or a flash memory or other types of memory systems which maintain data (e.g. large amounts of data) even after power is removed from the system. Typically, the mass storage 711 will also be a random access memory although this is not required. While
A display controller and display device 807 provide a visual user interface for the user; this digital interface may include a graphical user interface which is similar to that shown on a Macintosh computer when running OS X operating system software. In one embodiment of the invention, the snapshot search runs entirely in the operating system kernel, for example, the kernel of the OS X operating system. The system 800 also includes one or more wireless transceivers 803 to communicate with another data processing system, such as the system 700 of
The data processing system 800 also includes one or more input devices 813 which are provided to allow a user to provide input to the system. These input devices may be a keypad or a keyboard or a touch panel or a multi touch panel. The data processing system 800 also includes an optional input/output device 815 which may be a connector for a dock. It will be appreciated that one or more buses, not shown, may be used to interconnect the various components as is well known in the art. The data processing system shown in
In one embodiment, a machine readable storage medium such as mass storage 711 or RAM 709 stores instructions which when executed by a processor such as microprocessor 705 or processing system 811, causes the processor to perform a method such as the methods illustrated in
In another embodiment, a method such as the methods illustrated in
In still another embodiment, file system 201 and snapshot 203 may be stored on mass storage 711. Instructions for snapshot generation, searching snapshots, merging search results, and displaying search results may be executed by a processor such as microprocessor 705. Search results may be displayed on a display device such as display device 713. Search queries and search requests may be input using I/O devices 715.
In the foregoing specification, the invention has been described with reference to specific exemplary embodiments thereof. It will be evident that various modifications may be made thereto without departing from the broader spirit and scope of the invention as set forth in the following claims. The specification and drawings are, accordingly, to be regarded in an illustrative sense rather than a restrictive sense.
Number | Name | Date | Kind |
---|---|---|---|
5440735 | Goldring | Aug 1995 | A |
6278452 | Huberman et al. | Aug 2001 | B1 |
6282175 | Steele et al. | Aug 2001 | B1 |
6748504 | Sawdon et al. | Jun 2004 | B2 |
6829617 | Sawdon et al. | Dec 2004 | B2 |
6959310 | Eshel et al. | Oct 2005 | B2 |
6993539 | Federwisch et al. | Jan 2006 | B2 |
7100089 | Phelps | Aug 2006 | B1 |
7403960 | Kodama | Jul 2008 | B2 |
7555504 | Bixby et al. | Jun 2009 | B2 |
7603391 | Federwisch et al. | Oct 2009 | B1 |
7707184 | Zhang et al. | Apr 2010 | B1 |
7761456 | Cram et al. | Jul 2010 | B1 |
7844582 | Arbilla et al. | Nov 2010 | B1 |
7882067 | Saika | Feb 2011 | B2 |
7958168 | Chen et al. | Jun 2011 | B2 |
8307154 | Stabrawa et al. | Nov 2012 | B2 |
8370591 | Tan et al. | Feb 2013 | B2 |
8589347 | Erofeev | Nov 2013 | B2 |
20030167380 | Green et al. | Sep 2003 | A1 |
20040088301 | Mahalingam et al. | May 2004 | A1 |
20060036655 | Lastovica, Jr. | Feb 2006 | A1 |
20060047931 | Saika | Mar 2006 | A1 |
20060143242 | Hara | Jun 2006 | A1 |
20080034013 | Cisler et al. | Feb 2008 | A1 |
20080256311 | Lee | Oct 2008 | A1 |
20080301101 | Baratto et al. | Dec 2008 | A1 |
20080320258 | Wayda et al. | Dec 2008 | A1 |
20090063422 | Kodama | Mar 2009 | A1 |
20090292681 | Wood et al. | Nov 2009 | A1 |
20090319486 | Surlaker et al. | Dec 2009 | A1 |
20110093471 | Brockway et al. | Apr 2011 | A1 |
Number | Date | Country | |
---|---|---|---|
20100312783 A1 | Dec 2010 | US |