Renamed/reverted file->buffer -> file->cache
And the related config options: - cfg->file_buffer_size -> cfg->file_cache_size - file->cfg->buffer_size -> file->cfg->cache_size - file->cfg->buffer -> file->cfg->cache_buffer The original motivation to rename this to file->buffer was to better align with what other filesystems call this, but I think this is a case where internal consistency is more important than external consistency. file->cache better matches lfs->pcache and lfs->rcache, and makes it easier to read code involving both file->cache and other user-provided buffers. Keeping the upstream name also helps with continuity.
This commit is contained in:
+52
-52
@@ -487,8 +487,8 @@ code = '''
|
||||
[cases.test_fsync_rrrr]
|
||||
defines.R = 4
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -536,8 +536,8 @@ code = '''
|
||||
defines.R = 4
|
||||
defines.N = 20
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -603,8 +603,8 @@ defines.SYNC = [0, 1, 2, 3]
|
||||
# FLUSH=3 => flush via LFS_M_FLUSH
|
||||
defines.FLUSH = [0, 1, 2, 3]
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -698,8 +698,8 @@ defines.SYNC = [0, 1, 2, 3]
|
||||
defines.FLUSH = [0, 1, 2, 3]
|
||||
defines.N = 20
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -807,8 +807,8 @@ defines.SYNC = [0, 1, 2, 3]
|
||||
# FLUSH=3 => flush via LFS_M_FLUSH
|
||||
defines.FLUSH = [0, 1, 2, 3]
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -897,8 +897,8 @@ defines.SYNC = [0, 1, 2, 3]
|
||||
defines.FLUSH = [0, 1, 2, 3]
|
||||
defines.N = 20
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -996,8 +996,8 @@ defines.SYNC = [0, 1, 2, 3]
|
||||
# FLUSH=3 => flush via LFS_M_FLUSH
|
||||
defines.FLUSH = [0, 1, 2, 3]
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -1103,8 +1103,8 @@ defines.SYNC = [0, 1, 2, 3]
|
||||
defines.FLUSH = [0, 1, 2, 3]
|
||||
defines.N = 20
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -1223,8 +1223,8 @@ defines.SYNC = [0, 1, 2, 3]
|
||||
# FLUSH=3 => flush via LFS_M_FLUSH
|
||||
defines.FLUSH = [0, 1, 2, 3]
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -1329,8 +1329,8 @@ defines.SYNC = [0, 1, 2, 3]
|
||||
defines.FLUSH = [0, 1, 2, 3]
|
||||
defines.N = 20
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -1448,8 +1448,8 @@ defines.SYNC = [0, 1, 2, 3]
|
||||
defines.FLUSH = [0, 1, 2, 3]
|
||||
defines.N = 40
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -1589,8 +1589,8 @@ defines.SYNC = [0, 1, 2, 3]
|
||||
defines.FLUSH = [0, 1, 2, 3]
|
||||
defines.N = 40
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -2299,8 +2299,8 @@ defines.SYNC = [0, 1, 2]
|
||||
# FLUSH=2 => flush via LFS_O_FLUSH
|
||||
defines.FLUSH = [0, 1, 2]
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -2393,8 +2393,8 @@ defines.SYNC = [0, 1, 2]
|
||||
defines.FLUSH = [0, 1, 2]
|
||||
defines.N = 20
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -2501,8 +2501,8 @@ defines.SYNC = [0, 1, 2]
|
||||
# FLUSH=2 => flush via LFS_O_FLUSH
|
||||
defines.FLUSH = [0, 1, 2]
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -2587,8 +2587,8 @@ defines.SYNC = [0, 1, 2]
|
||||
defines.FLUSH = [0, 1, 2]
|
||||
defines.N = 20
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -2687,8 +2687,8 @@ defines.SYNC = [0, 1, 2]
|
||||
# FLUSH=2 => flush via LFS_O_FLUSH
|
||||
defines.FLUSH = [0, 1, 2]
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -2796,8 +2796,8 @@ defines.SYNC = [0, 1, 2]
|
||||
defines.FLUSH = [0, 1, 2]
|
||||
defines.N = 20
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -2914,8 +2914,8 @@ defines.RW = 4
|
||||
defines.FLUSH = [0, 1, 2]
|
||||
defines.N = 40
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -3064,8 +3064,8 @@ defines.RW = 4
|
||||
defines.FLUSH = [0, 1, 2]
|
||||
defines.N = 40
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -3805,8 +3805,8 @@ defines.SYNC = [0, 1, 2]
|
||||
# FLUSH=2 => flush via LFS_O_FLUSH
|
||||
defines.FLUSH = [0, 1, 2]
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -3901,8 +3901,8 @@ defines.SYNC = [0, 1, 2]
|
||||
defines.FLUSH = [0, 1, 2]
|
||||
defines.N = 20
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -4010,8 +4010,8 @@ defines.SYNC = [0, 1, 2]
|
||||
# FLUSH=2 => flush via LFS_O_FLUSH
|
||||
defines.FLUSH = [0, 1, 2]
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -4104,8 +4104,8 @@ defines.SYNC = [0, 1, 2]
|
||||
defines.FLUSH = [0, 1, 2]
|
||||
defines.N = 20
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -4210,8 +4210,8 @@ defines.RW = 4
|
||||
defines.FLUSH = [0, 1, 2]
|
||||
defines.N = 40
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -4369,8 +4369,8 @@ defines.RW = 4
|
||||
defines.FLUSH = [0, 1, 2]
|
||||
defines.N = 40
|
||||
defines.SIZE = [
|
||||
'FILE_BUFFER_SIZE/2',
|
||||
'2*FILE_BUFFER_SIZE',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
|
||||
Reference in New Issue
Block a user