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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 39E4EC433DB for ; Wed, 20 Jan 2021 19:50:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DCCB92343E for ; Wed, 20 Jan 2021 19:50:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392712AbhATTuF (ORCPT ); Wed, 20 Jan 2021 14:50:05 -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?