Re: [RFC v2] f2fs: extent cache: support unaligned extent

From: Chao Yu
Date: Wed Aug 04 2021 - 03:41:22 EST


On 2021/8/4 9:53, Jaegeuk Kim wrote:
+#ifdef CONFIG_F2FS_FS_COMPRESSION

Can remove this by if (unaligned)?

+ if (unaligned)
+ en->plen = ((struct extent_info_unaligned *)ei)->plen;

struct extent_info_unaligned should be covered by CONFIG_F2FS_FS_COMPRESSION.

static inline bool __is_extent_mergeable(struct extent_info *back,
- struct extent_info *front)
+ struct extent_info *front, bool unaligned)
{
+#ifdef CONFIG_F2FS_FS_COMPRESSION

This can be controlled by "bool unaligned"?

Ditto,


+ struct extent_info_unaligned *be = (struct extent_info_unaligned *)back;
+ struct extent_info_unaligned *fe = (struct extent_info_unaligned *)front;
+
+ if (unaligned && (be->ei.len != be->plen || fe->ei.len != fe->plen))
+ return false;
+#endif

Thanks,