Abstract:
A disk drive including a disk storing a defect log including one or more defect records, wherein each of the defect records comprises record fields, and a controller configured to determine a match for a reference defect record by at least selecting one or more record fields of the reference defect record as search fields, setting the search fields in the reference defect record, generating a mask record comprising mask fields corresponding to the record fields, setting a first bit value for each bit in the mask fields corresponding to the search fields and a second bit value for each bit in the mask fields which do not correspond to the search fields, selecting a defect record from the defect log, generating an intermediate result by performing a first logic operation, and generating a matching result by performing a second logic operation.

Description:
BACKGROUND 
     A disk drive comprises a disk which may contain defects from a manufacture of the disk or through wear and tear over time. Such defects may make portions of the disk unusable and are mapped in a defect log to prevent accidental storage of data in the defect. 
     To identify the defects, the defect log contains defect records. Each of the defect records contain record fields. In some situations such as during failure analysis or to determine whether to perform defect management, it may be beneficial to search for a specific defect record in the defect log, or many defect records which match certain search criteria. To search the defect records in the defect log, selected record fields in each of the defect records are searched to determine when the desired defect records have been found. 
     However, conventional searching of the defect log utilizes many iterations to complete the search. The large number of iterations can increase a time utilized to display the search results. Furthermore it can utilize a large number of resources to display the search results. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
       The features and advantages of the present embodiments will become more apparent from the detailed description set forth below when taken in conjunction with the drawings, wherein: 
         FIG. 1  depicts a disk drive according to an embodiment; 
         FIG. 2  depicts a reference defect record comprising record fields according to an embodiment; 
         FIG. 3  depicts a defect log comprising defect records according to an embodiment; 
         FIG. 4  depicts a defect record comprising record fields according to an embodiment; 
         FIG. 5  depicts a process according to an embodiment; 
         FIG. 6  depicts a reference defect record comprising record fields according to an embodiment; 
         FIG. 7  depicts a mask record comprising mask fields according to an embodiment; 
         FIG. 8  depicts a logic operation being performed on a selected defect record and a mask record according to an embodiment; 
         FIG. 9  depicts an intermediate result according to an embodiment; 
         FIG. 10  depicts a logic operation being performed on an intermediate result and a reference defect record according to an embodiment; 
         FIG. 11  depicts a matching result according to an embodiment; and 
         FIG. 12  depicts a process according to an embodiment. 
     
    
    
     DETAILED DESCRIPTION 
     In an embodiment, as shown in  FIG. 1 , a disk drive  100  includes a controller  102 , a memory  104 , and a disk  106 . In an embodiment, the disk  106  stores a defect process firmware  108  and a defect log  132 . In an embodiment, the disk  106  is a persistent memory while the memory  104  is a non-persistent memory. In an embodiment, the disk  106  is a rotating disk such as a magnetic rotating disk. In an embodiment, the memory  104  is a random-access memory such as a DRAM. 
     In an embodiment, the defect process firmware  108  is loaded from the disk  106  onto the memory  104 . When executed, the defect process firmware  108  causes the controller  102  to perform a defect process on the disk drive  100 . 
     In an embodiment, as shown in  FIG. 2  a reference defect record  110  is utilized for the defect process. The reference defect record  110  comprises one or more record fields  112   a - 112   j . In an embodiment, as shown in  FIG. 3 , the defect log  132  includes defect records  116  such as defect records  116   a ,  116   b ,  116   c ,  116   d , and  116   e . Although the defect records  116   a - 116   e  are shown, the defect log  132  can comprise more or less defect records. In an embodiment, the defect records  116  form a linked list. In an embodiment, the defect records  116 , such as the defect record  116   a , also comprise the record fields  112   a - 112   j , as shown in an embodiment in  FIG. 4 . In an embodiment, the defect records  116  need not comprise the record fields  112   a - 112   j , but instead could comprise more or less record fields. In an embodiment, each of the record fields  112   a - 112   j  comprises 16 bits. In an embodiment, each of the record fields  112   a - 112   j  comprises 32 bits. 
     In an embodiment, the record fields  112   a - 112   j  comprise a head number field, a cylinder value field, a sequence field, a defect type field, a start wedge field, an end wedge field, a wedge in error field, a zone number field, an error code field, a partition ID field, a cluster ID field, a process test module ID field, a flags field, a thermal asperity (“TA”) count field, a number of errors field, or a fail value field. Also, in an embodiment, the record fields  112   a - 112   j  may comprise additional fields instead of, or in addition to, the fields disclosed above which may be useful for identifying a defect on the disk  106 . The head number field, the cylinder field, the sequence field, the defect type field, the start wedge field, and the end wedge field can form, for example, a record key. 
     In an embodiment, the cylinder value field comprises cylinder values. The cylinder value field comprises, for example, a cylinder highest significant bit (“HSB”) value, a cylinder middle significant bit (“MSB”) value, and/or a cylinder least significant bit (“LSB”) value. Furthermore, in an embodiment, the defect records  116  in the defect log  132  are sorted by the cylinder values in the cylinder value field. 
     In an embodiment, the defect process comprises one or more blocks shown in  FIG. 5 . In block S 502 , the record fields comprising the head number field, the cylinder value field, and the cluster ID field are selected as search fields for the reference defect record  110  as shown in an embodiment in  FIG. 2 . Therefore, the record fields selected as search fields need not correspond only to fields which comprise the record key. Instead, the record fields selected may correspond to fields which are part of the record key, fields which are not part of the record key, or any combination thereof. In the embodiment shown in  FIG. 2 , the record fields  112   a ,  112   d , and  112   g  correspond to the head number field, the cylinder value field, and the cluster ID field. 
     Thus, the record fields  112   a ,  112   d , and  112   g  are selected as the search fields as indicated by the “xxxx” values. The “xxxx” values merely indicate that the record fields are selected and do not indicate a specific value stored in the record fields  112   a ,  112   d , and  112   g  or that the values stored in the record fields  112   a ,  112   d , and  112   g  are identical to each other. The record fields  112   b ,  112   c ,  112   e ,  112   f ,  112   h ,  112   i , and  112   j  are not selected as indicated by the “yyyy” values. Similarly, the “yyyy” values merely indicate that the record fields  112   b ,  112   c ,  112   e ,  112   f ,  112   h ,  112   i , and  112  are not selected and do not indicate a specific value stored in the record fields  112   b ,  112   c ,  112   e ,  112   f ,  112   h ,  112   i , and  112   j . In an embodiment, the record fields selected as the search fields can be searched at a same time instead of on an individual basis, which can reduce an amount of time and iterations required for searching. 
     In an embodiment, although the record fields  112   a ,  112   d , and  112   g  are selected as search fields, one or more of the record fields  112   a - 112   j  may be selected as the search fields instead of the record fields  112   a ,  112   d , and  112   g.    
     In block S 502 , the record fields  112   a ,  112   d , and  112   g  selected as search fields are set. In an embodiment, when the record fields  112   a ,  112   d , and  112   g  are set, the bit values for each bit in the record fields  112   a ,  112   d , and  112   g  are maintained as shown in an embodiment in  FIG. 6 . Furthermore, the bits for the other record fields which are not selected as search fields are set to a bit value of “0.” For example, each bit in the record fields  112   b ,  112   c ,  112   e ,  112   f ,  112   h ,  112   i , and  112   j  are set to a bit value of “0” as indicated by each of the record fields  112   b ,  112   c ,  112   e ,  112   f ,  112   h ,  112   i , and  112   j  having a value of “0000” in a hexadecimal format. The value “0000” represents 16 bits with each bit having a bit value of “0.” For example, the value “0000” is “0000000000000000” in binary. 
     In block S 506 , a mask record  120  comprising mask fields  118   a - 118   j  is generated, as shown in an embodiment in  FIG. 7 . In the embodiment shown in  FIG. 7 , the mask fields  118   a - 118   j  correspond to the record fields  112   a - 112   j . Each bit in the mask fields  118   a - 118   j  corresponding to the search fields of the reference defect record  110  is set to a first bit value. For example, the mask fields  118   a ,  118   d , and  118   g  correspond to the record fields  112   a ,  112   d , and  118   g , which were selected as the search fields. Thus, each bit in the mask fields  118   a ,  118   d , and  118   g  is set to a first bit value of “1” as shown by the value “FFFF” in a hexadecimal format. In an embodiment, the value “FFFF” represents 16 bits, with each bit having a bit value of “1.” For example, the value “FFFF” is “1111111111111111” in binary. In contrast, each bit in the mask fields  118   b ,  118   c ,  118   e ,  118   f ,  118   h ,  118   i , and  118   j , which do not correspond to the search fields are set to a second bit value of “0” as shown by the value “0000” in a hexadecimal format. 
     In block S 508 , a search record position is set to NULL. In an embodiment, the search record position is a marker of a current defect record for analysis in the defect log  132 . In block S 510 , a search for a defect record in the defect log  132  which matches the reference defect record  110  begins. In block S 512 , the next record in the defect log  132  from the previous search record position is retrieved and set as the current defect record. For example, if the search record position was set to NULL, then the next defect record would be the first defect record in the defect log  132 . For example, as shown in an embodiment in  FIG. 3 , the first defect record would be the defect record  116   a . Thus, the defect record  116   a  would be set as the current defect record. However, if the search record position was set to the defect record  116   a , then the next defect record would be the defect record  116   b . The defect record  116   b  would then be set as the current defect record. 
     In block S 514 , a determination is made as to whether the cylinder value in the current defect record is greater than the cylinder value in the reference defect record  110 . For illustrative purposes, the current cylinder value in block S 514  (the cylinder value in the current defect record in block S 514 ) can be considered a first cylinder value. If the cylinder value in the current defect record (first cylinder value) is greater than the cylinder value in the reference defect record  110 , then the previous defect record from the current defect record is retrieved from the defect log  132  in block S 516 . Furthermore, the previous defect record from the current defect record is set as the current defect record. For example, if the current defect record is the defect record  116   b , then the previous defect record, the defect record  116   a , will be set as the current defect record. Similarly, if the current defect record is the defect record  116   c , then the previous defect record, the defect record  116   b , will be set as the current defect record. Otherwise the process proceeds to block S 522 , which will be described below. 
     If the cylinder value in the current defect record is less than the cylinder value in the reference defect record  110  in block S 518 , then there are no records found as indicated in block S 520 . Otherwise, the process proceeds to block S 522 . For illustrative purposes, the current cylinder value in block S 518  (the cylinder value in the current defect record in block S 518 ) can be considered a second cylinder value. 
     In block S 522 , a determination is made as to whether the cylinder value in the current defect record matches the cylinder value in the reference defect record  110 . In an embodiment, the cylinder value in the current defect record in block S 522  is the first cylinder value (block S 514 ) or the second cylinder value (block S 518 ). If there is a match, the process proceeds to block S 524  where the position of the current defect record is saved as the search record position. Otherwise, the process repeats at block S 512 . 
     For blocks S 526 -S 536 , the current defect record is assumed to be the defect record  116   a  for illustrative purposes only. In block S 526 , a bitwise AND operation is performed on the current defect record and the mask record  120 . For example, as seen in  FIG. 8  a bitwise AND operation is performed between the defect record  116   a  and the mask record  120 . This generates an intermediate result  124  comprising intermediate result fields  122   a - 122   j  as shown in an embodiment in  FIG. 9 . 
     As can be seen in the embodiment shown in  FIG. 9 , the intermediate result fields  122   a ,  122   d , and  122   g  maintain the same values as the record fields  112   a ,  112   d , and  112   f  in the defect record  116   a . However, each bit in the other intermediate result fields  122   b ,  122   c ,  122   e ,  122   f ,  122   h ,  122   i , and  122   j  have a bit value of “0” instead of the values indicated by “aaaa” of the record fields  112   b ,  112   c ,  112   e ,  112   f ,  112   h ,  112   i , and  112   j  in the defect record  116   a . In an embodiment, the bitwise AND operation passes through the values in the record fields  112   a ,  112   d , and  112   f , but not the values in the record fields  112   b ,  112   c ,  112   e ,  112   f ,  112   h ,  112   i , and  112   j  in the defect record  116   a.    
     In block S 528 , a bitwise XOR operation is performed on the reference defect record  110  and the intermediate result  124  as seen in an embodiment shown in  FIG. 10 . This generates a matching result  128  comprising matching result fields  126   a - 126   j  as seen in an embodiment in  FIG. 11 . 
     In block S 530 , a determination is made regarding whether each bit in the matching result fields  126   a - 126   j  of the matching result  128  has a bit value of “0.” In block S 532 , the matching result  128  indicates that the current defect record matches the reference defect record  110  when each bit in the matching result fields  126   a - 126   j  of the matching result  128  has a bit value of “0.” In an embodiment, defect management may not be performed based on the reference defect record  110  since the defect may already have been identified in the defect log  132 . 
     The matching result  128  indicates that the current defect record does not match the reference defect record  110  when at least one bit in the matching result fields  126   a - 126   j  of the matching result  128  has a bit value of “1.” When the current defect record does not match the reference defect record  110 , the process proceeds to block S 534  where a determination is made as to whether the end of the defect log  132  has been reached. If the end of the defect log  132  has not been reached, then the process repeats at block S 512 . 
     Otherwise, if the end of the defect log  132  has been reached, then the reference defect record  110  has not been found in the defect log  132 . In such a case, in block S 536  a search criteria in the reference defect record  110  is updated so that another search may be performed. Furthermore, in an embodiment, the search record position is set to NULL again so that the search can recommence from the first defect record in the defect log  132 . In an embodiment, defect management may also be performed based on the reference defect record  110  since the defect has not been previously identified. 
     In an embodiment, the defect process comprises one or more blocks shown in  FIG. 12 . In block S 1202 , one or more record fields of the reference defect record  110  is selected as search fields. For example, the record fields  112   a ,  112   d , and  112   g  are selected as search fields as indicated by the “xxxx” value in an embodiment shown in  FIG. 2 . The other record fields  112   b ,  112   c ,  112   e ,  112   f ,  112   h , and  112   i  are not selected as search fields as indicated by the “yyyy” value. 
     In block S 1204 , the search fields in the reference defect record  110  is set as shown in an embodiment in  FIG. 6 . For example, the bit values for the search fields (record fields  112   a ,  112   d , and  112   g ) are maintained, while each bit of the record fields  112   b ,  112   c ,  112   e ,  112   f ,  112   h ,  112   i , and  112   j , which were not selected as the search fields, is set to a bit value of “0.” 
     In block S 1206 , a mask record  120  comprising mask fields  118   a - 118   j  corresponding to the record fields  112   a - 112   j  is generated as shown in an embodiment in  FIG. 7 . In block S 1208  each bit in the mask fields of the mask record  120  corresponding to the search fields of the reference defect record  110  is set to a first bit value, and each bit in the mask fields of the mask record  120  which do not correspond to the search fields of the reference defect record  110  is set to a second bit value. 
     For example, each bit in the mask fields  118   a ,  118   d , and  118   g  of the mask record  120  corresponding to the search fields of the reference defect record  110  is set to a first bit value as shown in an embodiment in  FIG. 7 . Furthermore, each bit in the mask fields  118   b ,  118   c ,  118   e ,  118   f ,  118   h ,  118   i , and  118   j , is set to a second bit value as shown in an embodiment in  FIG. 7 . In an embodiment the first bit is “1” and the second bit value is “0.” Thus, each of the mask fields  118   a ,  118   d , and  118   g  has a value of “FFFF” and each of the mask fields  118   b ,  118   c ,  118   e ,  118   f ,  118   h ,  118   i , and  118   j  has a value of “0000.” 
     In block S 1210 , a defect record, such as the defect record  116   a , is selected from the defect log  132 . In block S 1212 , an intermediate result  124  is generated by preforming a first logic operation on the mask record  120  and the selected defect record, such as the defect record  116   a , as shown in embodiments in  FIGS. 8 and 9 . In an embodiment, the first logic operation is a bitwise AND operation. 
     In block S 1214  a matching result  128  is generated by preforming a second logic operation on the intermediate result  124  and the reference defect record  110  as shown in embodiments in  FIGS. 10 and 11 . In an embodiment, the second logic operation is a bitwise XOR operation. 
     In an embodiment, although the above examples utilize the controller  102  to implement the defect process, the defect process could also be implemented using processors in addition to or instead of the controller  102 . 
     Those of ordinary skill would appreciate that the various illustrative logical blocks, modules, and algorithm parts described in connection with the examples disclosed herein may be implemented as electronic hardware, computer software, or combinations of both. Furthermore, the embodiments can also be embodied on a non-transitory machine readable medium causing a processor or computer to perform or execute certain functions. 
     To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and process parts have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed apparatus and methods. 
     The parts of a method or algorithm described in connection with the examples disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The parts of the method or algorithm may also be performed in an alternate order from those provided in the examples. A software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, an optical disk, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an Application Specific Integrated Circuit (ASIC). 
     The previous description of the disclosed examples is provided to enable any person of ordinary skill in the art to make or use the disclosed methods and apparatus. Various modifications to these examples will be readily apparent to those skilled in the art, and the principles defined herein may be applied to other examples without departing from the spirit or scope of the disclosed method and apparatus. The described embodiments are to be considered in all respects only as illustrative and not restrictive and the scope of the disclosure is, therefore, indicated by the appended claims rather than by the foregoing description. All changes which come within the meaning and range of equivalency of the claims are to be embraced within their scope.