pkoutoupis / rapiddisk

An Advanced Linux RAM Drive and Caching kernel modules. Dynamically allocate RAM as block devices. Use them as stand alone drives or even map them as caching nodes to slower local disk drives. Access those volumes locally or export them across an NVMe Target network. Manage it all from a web API.
http://www.rapiddisk.org
GNU General Public License v2.0
298 stars 49 forks source link

Optimizing search function for rapiddisk cache targets. #172

Closed pkoutoupis closed 1 year ago

pkoutoupis commented 1 year ago

Reducing the amount of loops and directory scans.

pkoutoupis commented 1 year ago

@matteotenca Thoughts?

pkoutoupis commented 1 year ago

I will review you PR shortly. Thank you.

matteotenca commented 1 year ago

I will review you PR shortly. Thank you.

@pkoutoupis I don't know if it really makes more sense than this one solution of yours. It just avoids gotos: when I was very young and I knew only BASIC, on Sinclair ZX 81 and ZX Spectrum, and moved to the structured programming paradigm on Amiga in C and (A)REXX, I learnt that goto is Evil. But for example, here it says that in a case such as ours, in this function, goto is Good:

https://en.wikipedia.org/wiki/Goto#Common_usage_patterns

So... my PR is more about an inner battle to decide what is Good and what is Evil :-D