Re: [PATCH v5 4/6] Btrfs: heuristic add detection of zeroed sample

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2017-08-23 20:55 GMT+03:00 Diego Calleja <diegocg@xxxxxxxxx>:
> El miércoles, 23 de agosto de 2017 2:26:48 (CEST) Timofey Titovets escribió:
>> +     for (i = 0; i < workspace->sample_size; i += sizeof(zero)) {
>> +             if (memcmp(&workspace->sample[i], &zero, sizeof(zero)))
>> +                     return false;
>
> Instead of just checking for 0, wouldn't it be a better idea to check
> for any kind of repetitions?
>
> As in, iterate over the sample and memcmp() each part of sample with
> the previous one. The cost would be the same, and it would detect not
> just zeros, but any kind of repeated data. Is there any reason I'm
> missing for not doing this?

Thank you, i was not think about that,
That approach seems better, i will update the patch.

-- 
Have a nice day,
Timofey.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html





[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux