Re: [f2fs-dev] [PATCH v3 09/12] f2fs: cache: use compress cache
From: Chao Yu
Date: Wed Aug 26 2026 - 23:25:00 EST
On 8/27/26 04:04, Daeho Jeong wrote:
>> -static void f2fs_truncate_cache(struct f2fs_cached_block *entry,
>> +void f2fs_truncate_cache(struct f2fs_cached_block *entry,
>> bool drop_dirty)
>
> -> __f2fs_truncate_cache() without locking?
Or, I guess you mean we need a cleanup here?
What about:
void f2fs_truncate_cache(struct f2fs_cached_block *entry, bool drop_dirty)
{
if (!entry->cache)
return;
f2fs_do_truncate_cache(entry, drop_dirty);
}
static void f2fs_truncate_cache_locked(struct f2fs_cached_block *entry, bool drop_dirty)
{
f2fs_lock_cache(entry);
f2fs_truncate_cache(entry, drop_dirty);
f2fs_unlock_cache(entry);
}
f2fs_truncate_cache() was exported for using in other .c file, in the meantime,
static f2fs_truncate_cache_locked() can be used inside cache.c.
Thanks,