util/nvmutil: greatly optimise cmd_copy()
similar to the last change by concept. we now write individual 4KB blocks per part 0 and 1, at the end of nvmutil, based on pointer values gbe and gbe2 instead of running memcpy, simply overwrite the pointer this results in less I/O, thus more speedfsdg20230625
parent
6e5828e4a8
commit
effcb942ce
|
@ -379,16 +379,14 @@ cmd_swap(void)
|
||||||
void
|
void
|
||||||
cmd_copy(void)
|
cmd_copy(void)
|
||||||
{
|
{
|
||||||
int src = (part << 12);
|
|
||||||
|
|
||||||
int destPart = (part ^ 1);
|
|
||||||
int dest = (destPart << 12);
|
|
||||||
|
|
||||||
if (validChecksum(part)) {
|
if (validChecksum(part)) {
|
||||||
memcpy((gbe + dest), (gbe + src), SIZE_4KB);
|
if (part)
|
||||||
|
gbe = gbe2;
|
||||||
|
else
|
||||||
|
gbe2 = gbe;
|
||||||
|
|
||||||
gbeFileModified = 1;
|
gbeFileModified = 1;
|
||||||
nvmPartModified[destPart] = 1;
|
nvmPartModified[part ^ 1] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue