From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B0235C433EF for ; Thu, 17 Feb 2022 01:49:51 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Jzd7154Kgz3cBs for ; Thu, 17 Feb 2022 12:49:49 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=115.124.30.132; helo=out30-132.freemail.mail.aliyun.com; envelope-from=jefflexu@linux.alibaba.com; receiver=) Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Jzd6s3DC1z30Md for ; Thu, 17 Feb 2022 12:49:37 +1100 (AEDT) X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R271e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04407; MF=jefflexu@linux.alibaba.com; NM=1; PH=DS; RN=15; SR=0; TI=SMTPD_---0V4fQwYM_1645062566; Received: from 30.225.24.49(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0V4fQwYM_1645062566) by smtp.aliyun-inc.com(127.0.0.1); Thu, 17 Feb 2022 09:49:27 +0800 Message-ID: Date: Thu, 17 Feb 2022 09:49:26 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH v4 05/23] cachefiles: introduce new devnode for on-demand read mode Content-Language: en-US To: Greg KH References: <20220215111335.123528-1-jefflexu@linux.alibaba.com> From: JeffleXu In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-erofs@lists.ozlabs.org, willy@infradead.org, linux-kernel@vger.kernel.org, dhowells@redhat.com, joseph.qi@linux.alibaba.com, linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org, gerry@linux.alibaba.com, torvalds@linux-foundation.org Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" 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