Re: [PATCH v5 12/24] erofs: introduce tagged pointer

2019-07-31 Thread Gao Xiang
On 2019/7/31 21:20, Gao Xiang wrote: >struct b *ptr = tagptr_unfold_tags(tptr); > vs >struct b *ptr = (struct b *)((unsigned long)tptr & ~2); Sorry ... a too stupid typo issue, I mean struct b *ptr = tagptr_unfold_ptr(tptr); vs struct b *ptr = (struct b *)((unsigned long)tptr & ~3)

Re: [PATCH v5 12/24] erofs: introduce tagged pointer

2019-07-31 Thread Gao Xiang
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

Re: [PATCH v5 12/24] erofs: introduce tagged pointer

2019-07-31 Thread Gao Xiang
Hi Jan, On 2019/7/31 21:01, Jan Kara wrote: > On Tue 30-07-19 15:14:01, Gao Xiang wrote: >> Currently kernel has scattered tagged pointer usages >> hacked by hand in plain code, without a unique and >> portable functionset to highlight the tagged pointer >> itself and wrap these hacked code in ord

Re: [PATCH v5 12/24] erofs: introduce tagged pointer

2019-07-31 Thread Jan Kara
On Tue 30-07-19 15:14:01, Gao Xiang wrote: > Currently kernel has scattered tagged pointer usages > hacked by hand in plain code, without a unique and > portable functionset to highlight the tagged pointer > itself and wrap these hacked code in order to clean up > all over meaningless magic masks.

[PATCH v5 12/24] erofs: introduce tagged pointer

2019-07-30 Thread Gao Xiang
Currently kernel has scattered tagged pointer usages hacked by hand in plain code, without a unique and portable functionset to highlight the tagged pointer itself and wrap these hacked code in order to clean up all over meaningless magic masks. This patch introduces simple generic methods to fold