| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
btrfs_read() was really just a function to read data linearly while
using the metadata cache. Move it to cache.c and rename it
cache_read() so other filesystems can make use of it as well.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
|
|
|
| |
Most of file system drivers initialize the cache themselves.
The problem is that the same cache could be again initialized later,
then invalidating the previous one. This patch fixes this.
Problem found while auditing the code.
Signed-off-by: Raphael S. Carvalho <raphael.scarv@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The initialization of the cache doubly-linked list had
head->next->prev instead of head->prev->next; this entry is supposed
to initialize the ->next entry of the last entry in the list (which
points back to the head node.)
For clarity, consistently use "head" to refer to the head node; the
mixing of "head" and "dev->cache_head" needlessly obfuscated the code.
The wild pointer reference caused crashes on some systems.
Reported-by: Jan Safrata <jsafrata@centrum.cz>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
|
| |
Fix the cache initialization; in particular make sure dev->cache_head
actually gets set. Also, just use a plain division to figure out how
many entries we can fit in the cache.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
| |
Correct the return value from _get_cache_block(), and add a method for
locking a block permanently in the cache.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
|
|
|
| |
- instead of get_cache_block() returning a descriptor, have
get_cache() returning const void *.
- have a subfunction to allow getting a block without reading it
from disk, and returning the cache descriptor. This will be
used in ext2 to pre-seed block 0 with all zero.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
Move filesystem-related C files into the fs/ directory.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|