Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2360690pxb; Tue, 12 Oct 2021 05:08:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweByrLlUS1q24cL3pPWXW+sGshqYB/ShRZhW2M7GI1BbZLg11dLeZibdfEQoUXGubVGaK2 X-Received: by 2002:a17:903:1c7:b0:13e:d05b:ed09 with SMTP id e7-20020a17090301c700b0013ed05bed09mr29398751plh.52.1634040503621; Tue, 12 Oct 2021 05:08:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634040503; cv=none; d=google.com; s=arc-20160816; b=p8KLs5fFIfWhDPr9kEXO/+aqxVW5+swJcsjp6VavyC6Y9oZZ1r+r3aC4Mk6XG4TR++ q21HPtt2/i5W3XNZxELPOpTkzzLrhohZgxoZvxCjYwS8R1J4j9J36pIhRPwr6vI004KF 2szxtidHMVuC9kiC6qifxt8Ne1hNHfjGBpUZCd/OJbcc9ahZLW5KAJTKRBiZXlUDyibC 0nJXcx7tMnOQjj8WILG0q3dby1uK6I/wkJAtmQ9e4cdfidAX7lo3e+a0vIrTWfCFWG9j KerJLBnupGtjfSGGRLzmIw3zHoKEsTIPIq7Cd1qABjUxGLGPGbxrLrbMuKSWoUKCkm2A D94w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ds1TpatCKmlIoP2vvOOOFQ9Th//N+SKm31s/+8rpr3E=; b=BNmNsFos8NHEnTjl+UgdO8qCLtSctcKAbfN90zWnFp/NnkNrHe0yDvGLQrVmycb8FS olU/YDEEhZRAi4z/435KaBZWH15C87L0Ittg854MQhv6t41LfnNkT+amqC+pFMlNQQ9b 6iOF+HiUksNDJbUpbnGsB4APuckRRxiDOSUMe7byoCHCpn/4E8UhQ6d1uUPvlv42iPYC TFD+e7fSyQk5/K+4uCl3qj5YZb+ZMN45QJm+AO0qdp/lebUsRpYCPZQFwa91+hL9keE4 2pIHHucmm7jJfpE2iLDD1XsKxrP5ZK81gPjTQAvINR0ZfQp7SlDOLz5+SamDfHcL/dm2 mTDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=BH3qElzX; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-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 u136si15736222pgc.587.2021.10.12.05.08.09; Tue, 12 Oct 2021 05:08:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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=BH3qElzX; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236325AbhJLMJN (ORCPT + 99 others); Tue, 12 Oct 2021 08:09:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236300AbhJLMJM (ORCPT ); Tue, 12 Oct 2021 08:09:12 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47606C061570; Tue, 12 Oct 2021 05:07: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: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=Ds1TpatCKmlIoP2vvOOOFQ9Th//N+SKm31s/+8rpr3E=; b=BH3qElzXEx1tRJTllHa9mV5zu8 1SEeR3ib9NIoBjkv7S0SS2R9Ef55OfgIG9Y0zOVqfVdie7hHGlQFFS7FENtRgE+sqxjk8iDBH+P+M 34o7ByhXO2461mQWohsf0GK7z9aAQpt6VAvqLuRBe54S7rA8JyKUqfmpRcKYxQAaZUdJTA6C4sqHG w5THzM2mwScZJFZI+jF4LaP2SI4aoU8StnKS8E41viQF+ovrE4+6qD9iIvT9+On5cU7xuwkhOjsG3 8v50BAztY+J8ahIKNM+4O2KdSooRWi+eTqxWc5+/iDUCDVG4uRWu8EnxzXeGEBD9pj8rOJ/E5lHrC OsuhFA+w==; Received: from [2001:4bb8:199:73c5:f5ed:58c2:719f:d965] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1maGXQ-006ToD-3t; Tue, 12 Oct 2021 12:06:04 +0000 From: Christoph Hellwig To: Jens Axboe , "Martin K. Petersen" Cc: "J. Bruce Fields" , Chuck Lever , linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-nfs@vger.kernel.org Subject: [PATCH 1/7] block: add a ->get_unique_id method Date: Tue, 12 Oct 2021 14:04:39 +0200 Message-Id: <20211012120445.861860-2-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012120445.861860-1-hch@lst.de> References: <20211012120445.861860-1-hch@lst.de> 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-nfs@vger.kernel.org Add a method to query query uniqueue IDs from block devices. It will be used to remove code that deeply pokes into SCSI internals in the NFS server. The implementation in the sd driver itself can also be much nicer as it can use the cached VPD page instead of always sending a command as the current NFS code does. For now the interface is kept very minimal but could be easily extended when other users like a block-layer sysfs interface for uniquue IDs shows up. Signed-off-by: Christoph Hellwig --- include/linux/blkdev.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 17705c970d7e1..81f94a7c54521 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1188,6 +1188,7 @@ struct block_device_operations { int (*report_zones)(struct gendisk *, sector_t sector, unsigned int nr_zones, report_zones_cb cb, void *data); char *(*devnode)(struct gendisk *disk, umode_t *mode); + int (*get_unique_id)(struct gendisk *disk, u8 id[16], u8 id_type); struct module *owner; const struct pr_ops *pr_ops; -- 2.30.2