On 2/17/22 1:48 AM, Greg KH wrote:
> On Wed, Feb 16, 2022 at 08:49:35PM +0800, JeffleXu wrote:
>>>> +struct cachefiles_req_in {
>>>> + uint64_t id;
>>>> + uint64_t off;
>>>> + uint64_t len;
>>>
>>> For structures that cross the user/kernel boundry, you have to use the
>>> correct types. For this it would be __u64.
>>
>> OK I will change to __xx style in the next version.
>>
>> By the way, I can't understand the disadvantage of uintxx_t style.
>
> The "uint*" types are not valid kernel types. They are userspace types
> and do not transfer properly in all arches and situations when crossing
> the user/kernel boundry. They are also in a different C "namespace", so
> should not even be used in kernel code, although a lot of people do
> because they are used to writing userspace C code :(
OK. "uint*" types are defined in ISO C library, while it seems that
linux kernel doesn't expect any C library [1].
[1] https://kernelnewbies.org/FAQ/LibraryFunctionsInKernel
Thanks for explaining it.
--
Thanks,
Jeffle
--
Linux-cachefs mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/linux-cachefs
- [Linux-cachefs] [PATCH v3 07/22] erofs: export erofs_map_blocks(... Jeffle Xu
- [Linux-cachefs] [PATCH v3 09/22] erofs: register global fscache ... Jeffle Xu
- [Linux-cachefs] [PATCH v3 05/22] cachefiles: introduce new devno... Jeffle Xu
- Re: [Linux-cachefs] [PATCH v3 05/22] cachefiles: introduce ... JeffleXu
- Re: [Linux-cachefs] [PATCH v3 05/22] cachefiles: introd... Greg KH
- [Linux-cachefs] [PATCH v4 05/23] cachefiles: introduce ... Jeffle Xu
- Re: [Linux-cachefs] [PATCH v4 05/23] cachefiles: in... Greg KH
- Re: [Linux-cachefs] [PATCH v4 05/23] cachefiles... JeffleXu
- Re: [Linux-cachefs] [PATCH v4 05/23] cache... Greg KH
- Re: [Linux-cachefs] [PATCH v4 05/23] c... JeffleXu
- [Linux-cachefs] [PATCH v3 12/22] erofs: add erofs_fscache_read_p... Jeffle Xu
- [Linux-cachefs] [PATCH v3 01/22] fscache: export fscache_end_ope... Jeffle Xu
- [Linux-cachefs] [PATCH v3 13/22] erofs: register cookie context ... Jeffle Xu
- [Linux-cachefs] [PATCH v3 11/22] erofs: add anonymous inode mana... Jeffle Xu
- [Linux-cachefs] [PATCH v3 15/22] erofs: implement fscache-based ... Jeffle Xu
- [Linux-cachefs] [PATCH v3 14/22] erofs: implement fscache-based ... Jeffle Xu
- [Linux-cachefs] [PATCH v3 10/22] erofs: add cookie context helpe... Jeffle Xu
- [Linux-cachefs] [PATCH v3 17/22] erofs: register cookie context ... Jeffle Xu
- [Linux-cachefs] [PATCH v3 18/22] erofs: implement fscache-based ... Jeffle Xu
