Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4614802rwd; Tue, 23 May 2023 09:57:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6sdBq15Byz3FLzEXPvZ66Ht5GmPNZDrQkk2MRqNbHamOLddUD/0DN6IgKw756GSJq0keBf X-Received: by 2002:a17:90b:eca:b0:24d:ef23:fe28 with SMTP id gz10-20020a17090b0eca00b0024def23fe28mr12396547pjb.49.1684861043585; Tue, 23 May 2023 09:57:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684861043; cv=none; d=google.com; s=arc-20160816; b=B4WCduchWF+j1cRj9Jd4YmxKHApg87dIB2AN7BQnH1zR55C38+Kox176G8wFp7mXUA O7+UMfh5QxuNPf5RDPfDEyWmkaPuBMXnaN4vTR4Nijiu51qldoBeeS14sEheBWOzKPVc nkckEhCQ9rQY1RRcTCZKAgyN6IHo8EwkrvBZjsbLFKnuhpXlv8fq187eMm/k7CTCnqK5 +zLRjB6c4tc93dkRP+en4iMp1ynXsbGn9Z5lraPOz296SQQBfOrBDhFRri3WDACLSKcw 7N1v31y5SvdKlCVkWj9YVmr5OSUxEt3QkiFPvtfLJfu/ofGwba+y0Um8DvA4MPRAABaD eq5w== 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; bh=K3EMNNGlTZuYQJrvyvOENR+PpdBzLBVxLhbFOjcQtI8=; b=zj08Pd5Qdxpb1UGLMD9s+10KvFP0QZOx29VCiABAUrpNjR0nJSmohi6z6U2oKjGaEC 9CJXF5gySTclCY17LdYTWLahZO0Im7IzaIIKRxYAEA7QLy2fFXRM9uvxDz05csMisIOa 0MEnDe7QxM8ptoJEpgj7+RQzsWWjExc6MtOiEHcLaiVsbQWa9iK6LwbMcI0vZKQV7mh3 /9oARnVIjBg9R5MAk7mVjyP17Y8Y8TE+vEHa0NIMlk8owYJgxkYKUnnds2YBrXx2VIuk zpBLte2PuBJh5cMgqRafplF5Vt9bNLQJESfMhm/DlveNETFRitWj5hDTZE7WYQYNWCIL nB+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k16-20020a637b50000000b005285dfbf364si6863856pgn.262.2023.05.23.09.57.09; Tue, 23 May 2023 09:57:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237837AbjEWQuK (ORCPT + 99 others); Tue, 23 May 2023 12:50:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237829AbjEWQuI (ORCPT ); Tue, 23 May 2023 12:50:08 -0400 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63E4ACD for ; Tue, 23 May 2023 09:49:18 -0700 (PDT) Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-75affe9d7feso10328585a.0 for ; Tue, 23 May 2023 09:49:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684860557; x=1687452557; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=K3EMNNGlTZuYQJrvyvOENR+PpdBzLBVxLhbFOjcQtI8=; b=MMmBq0Xu3x6VAbsvAAUAnQVUqxbmsK21ppFzj7xhXEs4MVAlIsKR6cIW2He5c95smc FJXLR1j8HmyaaeYTL532BvZyg3qb82edMUxhHE6Znr78Tx60urBQ5pUIkBn1MQxulYXY Ber3Z/lC7EEooQpT6HOZb3/lsu8l9OSCu1qGDUi3XzXh4t3+u/BkgVkxTsRXbAgoqxT8 iE2TucaYpixcp/mAbvFDG6tcUSyXSJr4uaGa7ndJ3x37uGe5srlc3HkT/iaVXJ5bHDJQ akWz+fKINSAi2Nw4XuzwDBdFwG3wv3DXr6TaFi7Blic2T6nCc+GlokqgZsgxNoWYKt3F eP5Q== X-Gm-Message-State: AC+VfDwaTUD1L0SKJayvQuLw7OQUDjUTfPU/L0PGJGOfoDgeblLKBcFk UbO0sU2kdKcNyWXAPpbjU1C1 X-Received: by 2002:a37:458b:0:b0:75b:23a0:de95 with SMTP id s133-20020a37458b000000b0075b23a0de95mr4318585qka.19.1684860557503; Tue, 23 May 2023 09:49:17 -0700 (PDT) Received: from localhost (pool-68-160-166-30.bstnma.fios.verizon.net. [68.160.166.30]) by smtp.gmail.com with ESMTPSA id m5-20020ae9e005000000b007578b6d060bsm2619050qkk.126.2023.05.23.09.49.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 09:49:17 -0700 (PDT) Date: Tue, 23 May 2023 12:49:16 -0400 From: Mike Snitzer To: Christoph Hellwig Cc: Jens Axboe , Greg Kroah-Hartman , "Rafael J. Wysocki" , Joern Engel , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Pavel Machek , dm-devel@redhat.com, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-mtd@lists.infradead.org, linux-pm@vger.kernel.org Subject: Re: [PATCH 19/24] dm: remove dm_get_dev_t Message-ID: References: <20230523074535.249802-1-hch@lst.de> <20230523074535.249802-20-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230523074535.249802-20-hch@lst.de> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 23 2023 at 3:45P -0400, Christoph Hellwig wrote: > Open code dm_get_dev_t in the only remaining caller, and propagate the > exact error code from lookup_bdev and early_lookup_bdev. > > Signed-off-by: Christoph Hellwig > --- > drivers/md/dm-table.c | 20 ++++---------------- > include/linux/device-mapper.h | 2 -- > 2 files changed, 4 insertions(+), 18 deletions(-) > > diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c > index 05aa16da43b0d5..e997f4322a9967 100644 > --- a/drivers/md/dm-table.c > +++ b/drivers/md/dm-table.c > @@ -323,20 +323,6 @@ static int upgrade_mode(struct dm_dev_internal *dd, fmode_t new_mode, > return 0; > } > > -/* > - * Convert the path to a device > - */ > -dev_t dm_get_dev_t(const char *path) > -{ > - dev_t dev; > - > - if (lookup_bdev(path, &dev) && > - early_lookup_bdev(path, &dev)) > - return 0; > - return dev; > -} > -EXPORT_SYMBOL_GPL(dm_get_dev_t); > - > /* > * Add a device to the list, or just increment the usage count if > * it's already present. > @@ -359,8 +345,10 @@ int dm_get_device(struct dm_target *ti, const char *path, fmode_t mode, > if (MAJOR(dev) != major || MINOR(dev) != minor) > return -EOVERFLOW; > } else { > - dev = dm_get_dev_t(path); > - if (!dev) > + r = lookup_bdev(path, &dev); > + if (r) > + r = early_lookup_bdev(path, &dev); > + if (r) > return -ENODEV; > } > if (dev == disk_devt(t->md->disk)) OK, but you aren't actually propagating the exact error code. Did you intend to change the return from -ENODEV to r? Mike