1
0
Fork 0
forked from len0rd/rockbox

Revert "storage: Disk Cache buffer size may need to be larger than SECTOR_SIZE"

This reverts commit dcec6828a3.

This did not solve the reported problem, and it turns out that the original
code did the right thing with respect to the device's logical sector size.

Change-Id: I5bed2520ba8f5ca01df0ddd71588d3ed69c1d77c
This commit is contained in:
Solomon Peachy 2024-11-24 00:57:40 -05:00
parent dcec6828a3
commit 7ea64a315b

View file

@ -107,31 +107,11 @@
#define SECTOR_SIZE 512 #define SECTOR_SIZE 512
#endif #endif
/* The file I/O code operates in terms of the FILESYSTEM sector size, /* this _could_ be larger than a sector if that would ever be useful */
which may be much larger than the underlying device's logical sector size. #ifdef MAX_VARIABLE_LOG_SECTOR
So we have to use the larger of the filesystem's max, the max logical, or #define DC_CACHE_BUFSIZE MAX_VARIABLE_LOG_SECTOR
the the fixed logical size. #else
*/ #define DC_CACHE_BUFSIZE SECTOR_SIZE
#if defined(MAX_VIRT_SECTOR_SIZE) && defined(MAX_VARIABLE_LOG_SECTOR)
#if (MAX_VIRT_SECTOR_SIZE < MAX_VARIABLE_LOG_SECTOR)
#error "MAX_VIRT_SECTOR_SIZE < MAX_VARIABLE_LOG_SECTOR"
#endif
#if (MAX_VIRT_SECTOR_SIZE % MAX_VARIABLE_LOG_SECTOR)
#error "MAX_VIRT_SECTOR_SIZE is not a multiple of MAX_VARIABLE_LOG_SECTOR"
#endif
#endif
#if !defined(DC_CACHE_BUFSIZE) && defined(MAX_VIRT_SECTOR_SIZE)
#define DC_CACHE_BUFSIZE MAX_VIRT_SECTOR_SIZE
#endif
#if !defined(DC_CACHE_BUFSIZE) && defined(MAX_VARIABLE_LOG_SECTOR)
#define DC_CACHE_BUFSIZE MAX_VARIABLE_LOG_SECTOR
#endif
#if !defined(DC_CACHE_BUFSIZE)
#define DC_CACHE_BUFSIZE SECTOR_SIZE
#endif #endif
#endif /* FS_DEFINES_H */ #endif /* FS_DEFINES_H */