From patchwork Fri Nov 8 01:56:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 11234021 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E0DAC1850 for ; Fri, 8 Nov 2019 02:00:30 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9C87B21D6C for ; Fri, 8 Nov 2019 02:00:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IjZh9Dzy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C87B21D6C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573178428; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1rAjrmhAp3usAaTOhbSJx1+/l9S2sRPL4ucE+EI2xf4=; b=IjZh9DzymVl0OZFXm/fYn4zX/lxU3D/hk/YCTDoj0aWZV1lYjRQiz0jMek+DywmLMthqqR +ffrmvqmWtfsKBk30QNPu3CFLs/L/5gY17o1TVe1cW8eR0U3JkDBDjJ/+t9kJWUyx57Ett A2w/dtTRemkFM9hESzoLInaWdFU/q+Q= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-139-83q9ep_jPzmv0uKEqaFK3w-1; Thu, 07 Nov 2019 21:00:26 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 83118800C61; Fri, 8 Nov 2019 02:00:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 575DF5C557; Fri, 8 Nov 2019 02:00:22 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0CCAF4A460; Fri, 8 Nov 2019 02:00:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xA81wIkZ000668 for ; Thu, 7 Nov 2019 20:58:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1AD2F608B6; Fri, 8 Nov 2019 01:58:18 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B21D36084E; Fri, 8 Nov 2019 01:58:13 +0000 (UTC) Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 18D9FC04BD48; Fri, 8 Nov 2019 01:57:47 +0000 (UTC) IronPort-SDR: bGbNl7xB4xhgqi7RuX6KdV6E5IelB3djHownRZ7kmRlu2/kawwAK/mxO2HGNEYrTPUPW/aoZIw dlRsUietdVFP1SnLzpO6t7a/8qfOBnKNGMq4MwiKt6qFdMY3rQSOBOrD3yDEMdjJx37plbosS1 vo5lMYQ6jYBMw4ESUKgpGaDPGJkGRH+VgSKM73Trh+qMWB0YIPPWsp7QJ0jdI8xm0rGigjHlIu rl/poWEBhTddKbyRR8q40x5uN9/IT0ACJNWKPoRm5pqOH/OJXQOE1JEI25L3tQxnk40W0WLB8G X8c= X-IronPort-AV: E=Sophos;i="5.68,279,1569254400"; d="scan'208";a="223636909" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 08 Nov 2019 09:57:49 +0800 IronPort-SDR: Sl+WdsIdaQhcHZaNrinF0it4D192qDM3ePCqf1T6tKI/DGvf5YShEVrufRUWSW26IL04zftOUs g2XB7z3TVBr0I+m7UyhO5PfKiG/kzzW16T5goiqpqXqL+RLSzmb63MwC8rY6DULrxW50alwCsO m5Qn6c+SZ5Wf0JpRSVAdfPxUAviixiz/z5xmdXfyspD/eQG4bEF3A5wseQlQg+hbU7vicPCnuO HzJLXjiVjFWgu1aaw2VTTbTS35vg4DMau8A7+1GRkUfvrAJAmIqN5neLSh5Avn7KZlenh2OhPe Ng6IEjTJ2Efy7tUssuB5Pp4v Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2019 17:52:22 -0800 IronPort-SDR: /Xjyz0Kh14ySCVzU34mSIqRZ1vmBqP7OykM734wRo0hJHoWbQl2cEq/vf0qS824wFLvW00p5vf PZLEgpFmBNiK5oMRHvYMoeyHmyyiWyjp0VrTjomF+AqgIPuJfUrcw1kmRXge5eooanwHAKO4IY T9In0tczmRSv5+EmJCYTmPgB0DbOrbL6kGLpmjJuXIVs1VgtPkWuiB+mrft01tqF5b3E6Zj4bV c52ECmRgUnXqJoIC0jok0oWJsRjy4xW4cW5BFz4d9xdZv5RfLXxwPoMO3fbGNvRISnnAqDp/oT E1Y= WDCIronportException: Internal Received: from washi.fujisawa.hgst.com ([10.149.53.254]) by uls-op-cesaip01.wdc.com with ESMTP; 07 Nov 2019 17:57:11 -0800 From: Damien Le Moal To: linux-block@vger.kernel.org, Jens Axboe , linux-scsi@vger.kernel.org, "Martin K . Petersen" , dm-devel@redhat.com, Mike Snitzer , linux-f2fs-devel@lists.sourceforge.net, Jaegeuk Kim , Chao Yu Date: Fri, 8 Nov 2019 10:56:58 +0900 Message-Id: <20191108015702.233102-6-damien.lemoal@wdc.com> In-Reply-To: <20191108015702.233102-1-damien.lemoal@wdc.com> References: <20191108015702.233102-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 08 Nov 2019 01:58:03 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 08 Nov 2019 01:58:03 +0000 (UTC) for IP:'68.232.143.124' DOMAIN:'esa2.hgst.iphmx.com' HELO:'esa2.hgst.iphmx.com' FROM:'damien.lemoal@wdc.com' RCPT:'' X-RedHat-Spam-Score: -2.399 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_MED, SPF_HELO_NONE) 68.232.143.124 esa2.hgst.iphmx.com 68.232.143.124 esa2.hgst.iphmx.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH 5/9] null_blk: clean up the block device operations X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: 83q9ep_jPzmv0uKEqaFK3w-1 X-Mimecast-Spam-Score: 0 From: Christoph Hellwig Remove the pointless stub open and release methods, give the operations vector a slightly less confusing name, and use normal alignment for the assignment operators. Signed-off-by: Christoph Hellwig Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: Chaitanya Kulkarni --- drivers/block/null_blk_main.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/block/null_blk_main.c b/drivers/block/null_blk_main.c index 40a64bdd8ea7..89d385bab45b 100644 --- a/drivers/block/null_blk_main.c +++ b/drivers/block/null_blk_main.c @@ -1442,20 +1442,9 @@ static void null_config_discard(struct nullb *nullb) blk_queue_flag_set(QUEUE_FLAG_DISCARD, nullb->q); } -static int null_open(struct block_device *bdev, fmode_t mode) -{ - return 0; -} - -static void null_release(struct gendisk *disk, fmode_t mode) -{ -} - -static const struct block_device_operations null_fops = { - .owner = THIS_MODULE, - .open = null_open, - .release = null_release, - .report_zones = null_zone_report, +static const struct block_device_operations null_ops = { + .owner = THIS_MODULE, + .report_zones = null_zone_report, }; static void null_init_queue(struct nullb *nullb, struct nullb_queue *nq) @@ -1556,7 +1545,7 @@ static int null_gendisk_register(struct nullb *nullb) disk->flags |= GENHD_FL_EXT_DEVT | GENHD_FL_SUPPRESS_PARTITION_INFO; disk->major = null_major; disk->first_minor = nullb->index; - disk->fops = &null_fops; + disk->fops = &null_ops; disk->private_data = nullb; disk->queue = nullb->q; strncpy(disk->disk_name, nullb->disk_name, DISK_NAME_LEN);