Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp526547pxx; Thu, 29 Oct 2020 08:12:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1cfjXWUAs1lBys/bqfc42WzgDIUBKM+e8InuTeVCL0DeHXluNnNeAcqkDd64GTin065yJ X-Received: by 2002:a05:6402:1765:: with SMTP id da5mr4357701edb.155.1603984369319; Thu, 29 Oct 2020 08:12:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603984369; cv=none; d=google.com; s=arc-20160816; b=WpGCL9tVRhiGJBsO9PkrJa5mxVAl5M0CTwsx/69DV3e84o0ZQmWS2lQOeF9ptmxAfE JnKjXNqAY9o+txxpI3ASUPRYl80ZOIZrgHTk2eb+9ItGG1dyKBjZHO9jhfSCPx7ZapN3 M3FnKuY+wtORLsGxMaCzGE4IOuCfofVrqGxXKArgFfQ/M2e0pxH1K1lJi7bU8PZD3sMn +hanicLUXxPHdiIVjs/qP5Krfyp2ukYkyKeTmkatR0Dj3NL5ixQW3Cf7bqGwXZl8d7XZ 8urYWMepveZN8+xjY0kVgNrKWbkIeCdoWUMH8VDfR6d2x327InObbKoetheFxVhej3Ch FsKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=5UpmUUK4HkD04BYNwcucPUw7TY2FGi/Q9CTm0VHziQI=; b=Xr6hEoIK9CWUEjOD4swa+UkxG4NVSUBcvaOLf8c4MKw6hKBYIlKpGc9EAus4fliQuk VP8t7PlWLi2pCZhVqCzNB5FKfBdPotjvP//PmYMqb9E2Lprhn4XXkGdyoYfVUCLwaLtW 1KwqLRWgzFhDgUmUqel3M/E9bpQktHRobNgVR89OXJaEP2feZQ7O2c3biiTX+Z5bJ+B4 aepXoHrtNkpfT5wLJWlFPPDYTp/fj5E5pg1rHp6U9tLmKQm91H8TcaUJMQjpQvRyK0gr zEJkoZQZcrNLq523QlynAGO6VM8dXDX8Gapia7Vl2SeEyqWXy2Y0ySOzKjxRe+Mia+WY VRWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=tWqW+P04; 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 z26si1305764ejl.280.2020.10.29.08.12.24; Thu, 29 Oct 2020 08:12:49 -0700 (PDT) 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=tWqW+P04; 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 S1728067AbgJ2PK7 (ORCPT + 99 others); Thu, 29 Oct 2020 11:10:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727842AbgJ2PK7 (ORCPT ); Thu, 29 Oct 2020 11:10:59 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFFBBC0613CF; Thu, 29 Oct 2020 08:01:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=5UpmUUK4HkD04BYNwcucPUw7TY2FGi/Q9CTm0VHziQI=; b=tWqW+P040RkCrD1rrAjfY9sgJz KO8cA88SpwWBoN64XQ280vwozNesIh3dcpQJpE35kJ2w27SzFJsAB+oKGDucHwW1mlIL/KXQN4E8t Wf4aEjeT7KdmYarQE0o9bu7BXPVKL8zVZWtaPVcQ7G6uxaw20SPZ7ih8McI6uCnkTg0n6Yx6BMd04 3UFRG/Fvp0JKgNdAOIPMhF6wJNoX+XzLM46OYLJTx8S1oOIJnNepiGSXqfNUdJgXcOPFylGAlXQnH TLDhpV+f/EiqEYkmK6i4VQ/atrEf0ndvU7ptSXv1mJXKZQQGHFflGrHFzE6vO2drxVUStwdqcWpRQ FJKpifxA==; Received: from 089144193201.atnat0002.highway.a1.net ([89.144.193.201] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kY9Q6-0005M0-BQ; Thu, 29 Oct 2020 15:00:55 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Denis Efremov , "David S. Miller" , Song Liu , Al Viro , Finn Thain , Michael Schmitz , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, linux-raid@vger.kernel.org, linux-scsi@vger.kernel.org, linux-m68k@lists.linux-m68k.org Subject: simplify gendisk lookup and remove struct block_device aliases v4 Date: Thu, 29 Oct 2020 15:58:23 +0100 Message-Id: <20201029145841.144173-1-hch@lst.de> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Hi all, this series removes the annoying struct block_device aliases, which can happen for a bunch of old floppy drivers (and z2ram). In that case multiple struct block device instances for different dev_t's can point to the same gendisk, without being partitions. The cause for that is the probe/get callback registered through blk_register_regions. This series removes blk_register_region entirely, splitting it it into a simple xarray lookup of registered gendisks, and a probe callback stored in the major_names array that can be used for modprobe overrides or creating devices on demands when no gendisk is found. The old remapping is gone entirely, and instead the 4 remaining drivers just register a gendisk for each operating mode. In case of the two drivers that have lots of aliases that is done on-demand using the new probe callback, while for the other two I simply register all at probe time to keep things simple. Note that the m68k drivers are compile tested only. Changes since v3: - keep kobj_map for char dev lookup for now, as the testbot found some very strange and unexplained regressions, so I'll get back to this later separately - fix a commit message typo Changes since v2: - fix a wrong variable passed to ERR_PTR in the floppy driver - slightly adjust the del_gendisk cleanups to prepare for the next series touching this area Changes since v1: - add back a missing kobject_put in the cdev code - improve the xarray delete loops