On 2019/7/31 21:20, Gao Xiang wrote: > Yes, I think that is about coding style, but the legacy way we have to do > type cast as well, I think... > > struct b *ptr = tagptr_unfold_tags(tptr); > vs > struct b *ptr = (struct b *)((unsigned long)tptr & ~2); and we could do "typedef tagptr1_t tptrb;" and then use tptrb for tagged pointer rather than barely use tagptr1_t tagptr2_t ... as I mentioned in: https://lore.kernel.org/lkml/[email protected]/ I think "tptrb" is enough for developers to know the original pointer type when they coding... OTOH, I think it could be better not to directly use "struct b *" to represent the whole tagged pointer since it seems unsafe to do dereference directly.. It could introduce some potential bugs... All in all, this approach is only used for EROFS for now... If there are some better implementation, I can switch to it in the later version :) Thanks, Gao Xiang
- [PATCH v5 19/24] erofs: add erofs_allocpage() Gao Xiang
- [PATCH v5 23/24] erofs: introduce cached decompression Gao Xiang
- [PATCH v5 22/24] erofs: introduce the decompression frontend Gao Xiang
- [PATCH v5 21/24] erofs: introduce LZ4 decompression inplace Gao Xiang
- [PATCH v5 02/24] erofs: add erofs in-memory stuffs Gao Xiang
- [PATCH v5 05/24] erofs: add inode operations Gao Xiang
- [PATCH v5 14/24] erofs: introduce superblock registration Gao Xiang
- [PATCH v5 12/24] erofs: introduce tagged pointer Gao Xiang
- Re: [PATCH v5 12/24] erofs: introduce tagged pointer Jan Kara
- Re: [PATCH v5 12/24] erofs: introduce tagged pointer Gao Xiang
- Re: [PATCH v5 12/24] erofs: introduce tagged pointe... Gao Xiang
- Re: [PATCH v5 12/24] erofs: introduce tagged pointe... Gao Xiang
- [PATCH v5 04/24] erofs: add raw address_space operations Gao Xiang
- [PATCH v5 16/24] erofs: introduce workstation for decompression Gao Xiang
- [PATCH v5 17/24] erofs: introduce per-CPU buffers implementation Gao Xiang
- [PATCH v5 24/24] erofs: add document Gao Xiang
- [PATCH v5 10/24] erofs: update Kconfig and Makefile Gao Xiang
- [PATCH v5 09/24] erofs: support tracepoint Gao Xiang
- [PATCH v5 18/24] erofs: introduce pagevec for decompression subs... Gao Xiang
- [PATCH v5 15/24] erofs: introduce erofs shrinker Gao Xiang
