2017-08-23 20:55 GMT+03:00 Diego Calleja <[email protected]>: > 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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
