Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp484794pxb; Wed, 20 Jan 2021 11:51:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwzQGOOlmdPQmbvwLpNMtQsrxSdK6PqMebyj3JncGrdfUnZ1btpi9u0/BdHKK017k9ILHEv X-Received: by 2002:a17:907:1050:: with SMTP id oy16mr2049624ejb.424.1611172319179; Wed, 20 Jan 2021 11:51:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611172319; cv=none; d=google.com; s=arc-20160816; b=VoClXytC4wqyTVI78l9qgqafGz2XNs7q7N3TvSB+jQyZ50hT87GNKdYqZW9qa4kkgq KovJnBy43/tk4y2HtvvoP+Brw5QfRGJs+6cwp1qtCJlBfKkVD9wKwDXGVNYQdyLHYyOP cWGdJR3qv+PshowK1yPHYEkOqRV+b/MOaYt7hjgUiBoq249MBzfM5bmc1h7ogM6FVNzr RjYZPMVmT/kDoPFTmPePX5PJE7RrPDbk2G/Oa2t5+dy9uqTgfLV8vJa6ts6vAjJJRDaF gC29txDc93InoWy9wk4WSLiJRhiwMEhSu22eAdoVAAtRzrqbpfxK2H+Vd8rwBZAbEseE 4g4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YO65qeuBlA/Px+uGMMtu2IuI+NS6eKWvr/uQdksGWHk=; b=ziv1f2gfP+6lDmMEa3NmJ7q/y9oxLTaYoO8VfNcZ3emP7tOE/6zIXQ9nDqEdKUhqwn to5L123JJyqSPMsRqeNqcQtci77V505MCaqdIsV0WzEmg4nzVi5aUbS8zjSQnq6mvW6B jI3DreOEcxo/7R+Iks9Q5Xt383NrYFaG4oWcueAmoL/wbqMBmpOpIa3Cdphy7uzQLok1 L2K/WxQhSc6K0Rzy71gvHBH3+YakjqceqH91Q9E+VNCyAmJ+xTpDzxTm2YkyIdEVvoSG DPyuphPM+gPrN0kQNm8Ch0bACHYhYUhnBBsjxOJ9q1BxaeZ1FRv3VX4BAWR/c55UlaMA HOcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ZYDNsDli; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mj8si945443ejb.586.2021.01.20.11.51.35; Wed, 20 Jan 2021 11:51:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ZYDNsDli; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392791AbhATTtt (ORCPT + 99 others); Wed, 20 Jan 2021 14:49:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392741AbhATTsF (ORCPT ); Wed, 20 Jan 2021 14:48:05 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF0C1C061575 for ; Wed, 20 Jan 2021 11:47:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=YO65qeuBlA/Px+uGMMtu2IuI+NS6eKWvr/uQdksGWHk=; b=ZYDNsDliyOykuxcU6CwW9AORNj ZzPzRXjpZ4vAseB9D1pGl/v+qNQQTd9OgLgVGnHxs0IYXMTzdUFNoY/83XdgFLMYKqtwmYsmLC+3N T8ti0RrUuYHx2n6d4EuFca1Ny+AQ7fARvLk6EMdX6h4B8tNVxPDxZO9+2OkFRY1Lr8OpckAc1obUt GBEOaH+rkalJhuHqexjqMEZtLgE13JQawomCk9KlSJ219bLbR0L/jJ4R12Uc1Qvz3upn0DrXGT5xI XQXV9cwjphk57JfdCHXtQpPNSpTWWXpVO2R3u71K4dQ1ezoik1ozlEivZlaBKTR4VpOkyF2vfCCrE upz1ZNAA==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1l2JQf-00G8fi-Js; Wed, 20 Jan 2021 19:46:15 +0000 Date: Wed, 20 Jan 2021 19:46:09 +0000 From: Christoph Hellwig To: Dan Williams Cc: gregkh@linuxfoundation.org, logang@deltatee.com, Hans Verkuil , Alexandre Belloni , Alexander Viro , linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org Subject: Re: [PATCH 1/3] cdev: Finish the cdev api with queued mode support Message-ID: <20210120194609.GA3843758@infradead.org> References: <161117153248.2853729.2452425259045172318.stgit@dwillia2-desk3.amr.corp.intel.com> <161117153776.2853729.6944617921517514510.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <161117153776.2853729.6944617921517514510.stgit@dwillia2-desk3.amr.corp.intel.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The subject doesn't make any sense to me. But thn again queued sound really weird. You just have a managed API with a refcount and synchronization, right? procfs and debugfs already support these kind of managed ops, kinda sad to duplicate this concept yet another time. > +static long cdev_queued_ioctl(struct file *file, unsigned int cmd, unsigned long arg) Overly long line. > +__must_check int __cdev_register_queued(struct cdev *cdev, struct module *owner, > + dev_t dev, unsigned count, > + const struct cdev_operations *qops) > +{ > + int rc; > + > + if (!qops->ioctl || !owner) > + return -EINVAL; Why is the ioctl method mandatory?