diff options
| author | lbmkplaceholder <placeholder@lbmkplaceholder.com> | 2022-12-23 10:28:25 +0000 | 
|---|---|---|
| committer | lbmkplaceholder <placeholder@lbmkplaceholder.com> | 2022-12-23 10:28:25 +0000 | 
| commit | effcb942ceef282536d1da7de584357bdda5f9f3 (patch) | |
| tree | aad18f5abea3d3c2ea60d8aeeecff61319757bba | |
| parent | 6e5828e4a8d11ce7f6d8a4868a6e0afa54e6ebf0 (diff) | |
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 speed
| -rw-r--r-- | util/nvmutil/nvmutil.c | 12 | 
1 files changed, 5 insertions, 7 deletions
| diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index b80616ae..9a70634e 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -379,16 +379,14 @@ cmd_swap(void)  void  cmd_copy(void)  { -	int src = (part << 12); - -	int destPart = (part ^ 1); -	int dest = (destPart << 12); -  	if (validChecksum(part)) { -		memcpy((gbe + dest), (gbe + src), SIZE_4KB); +		if (part) +			gbe = gbe2; +		else +			gbe2 = gbe;  		gbeFileModified = 1; -		nvmPartModified[destPart] = 1; +		nvmPartModified[part ^ 1] = 1;  	}  } | 
