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 X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D125C433E7 for ; Wed, 14 Oct 2020 15:21:39 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 77E9F21582 for ; Wed, 14 Oct 2020 15:21:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b="Ooxt2aUt"; dkim=temperror (0-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="FNWkK1/w" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 77E9F21582 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kroah.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94) (envelope-from ) id 1kSiag-0003aN-Ot; Wed, 14 Oct 2020 11:21:22 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kSiad-0003aI-Pp for kernelnewbies@kernelnewbies.org; Wed, 14 Oct 2020 11:21:20 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id AD59FB47; Wed, 14 Oct 2020 11:21:15 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 14 Oct 2020 11:21:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=ECaos4y85V5WF0E9FsOYv9dj201 CLYwzeiishNRlDLg=; b=Ooxt2aUtaieVCWaz/MRWWlTnVVeAiLyQc5r9b9RpvLO lhjhQpXnyUZI1/muHvzLvNO4vwKUY6S+dfkhBXue26O9GoTyZQySRq9MuMGVaz85 JjNedolxnA2e8YgBwdXThcseymfwUICjBDwcgvtRSPr5WC05m2X7FHstISFrIZdg GNB4quUfihD9QUM+Y3ffVrref9A8zH8zK9LV3edfHnAJWepIIxtVaGWFFNMFysrk zulDraTGccX1hquYU4oqpcowUTNhMHeCzSel77KHbCA66T+KgaxP1tIlezSoV4eZ 9Nb6ZM9q2lVzLNQVbXEGhctldJLIDGLlA12r/cOSi4w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=ECaos4 y85V5WF0E9FsOYv9dj201CLYwzeiishNRlDLg=; b=FNWkK1/wqYgc7x9HfZek4m yr0KLCxkAFztkmoX+0+J2HNUuq1UNR6IA+6VFYPgE/zh44m8wmUo+XZG+qNLBS5m 1sldMc5rTc6AGoL6ECPIXlh6Bc1qihN6CvX/DckmXN9p4xJGODcEqnb+yXJPlDeZ +8Cp7prjBruhZUD44InbP4w/1ru4dkcCI6EssVzC0gyEj0bq3zFcHBU+qbe3Vvn4 b+uQ0dOgCEIW+e0DsjHxXDPzp9l4yxTb1o5w236J87rM+qdkX8XAWWgBuDIu2s0i aleAyegCnU8ZgCVXPIBMz/9p8WR06eUO7S2BB+Cojru24ZkAbW9gIOv2wQVzqPjA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedriedugdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjsehttdertd dttddvnecuhfhrohhmpefirhgvghcumffjuceoghhrvghgsehkrhhorghhrdgtohhmqeen ucggtffrrghtthgvrhhnpeevueehjefgfffgiedvudekvdektdelleelgefhleejieeuge egveeuuddukedvteenucfkphepkeefrdekiedrjeegrdeigeenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomh X-ME-Proxy: Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) by mail.messagingengine.com (Postfix) with ESMTPA id ACD083064610; Wed, 14 Oct 2020 11:21:14 -0400 (EDT) Date: Wed, 14 Oct 2020 17:21:50 +0200 From: Greg KH To: jim.cromie@gmail.com Subject: Re: opaque "pointer" API, model, best practice ? Message-ID: <20201014152150.GA3764480@kroah.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Cc: kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Wed, Oct 14, 2020 at 09:09:11AM -0600, jim.cromie@gmail.com wrote: > hi all, > > is there an api / usage model / or best practice > for opaque "handles" ? "it depends" :) What are you wanting to do exactly? > Im aware of 1 case: > the handle returned by zs_malloc > I have tried to use it, and have run into locking conflicts > when trying to keep the memory zs_mapped > longer than the duration of a function. > OTOH, if I map and unmap within the function, things work, > but this is unacceptable overhead. > > so I figure I should read some good code, > rather than keep hacking at bad code. Again, what are you trying to do? greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies