Patent ID: 8817584

Claim:
A data storage device comprising: a storage medium storing a defect log comprising one or more defect records, wherein each of the defect records comprises record fields, and each of the record fields comprise one or more bits, wherein the defect records in the defect log are sorted by at least one of the record fields; and a controller configured to determine a match for a reference defect record comprising the record fields 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 of the mask record corresponding to the search fields of the reference defect record and a second bit value for each bit in the mask fields of the mask record which do not correspond to the search fields of the reference defect record; maintaining a marker of a current defect record in the defect log; selecting a defect record from the defect log, based on the marker of the current defect record in the defect log; generating an intermediate result by performing a first logic operation on the mask record and the selected defect record; and generating a matching result by performing a second logic operation on the intermediate result and the reference defect record.