From patchwork Tue Jul 30 21:00:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 815578 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57A99186E2E for ; Tue, 30 Jul 2024 21:01:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722373293; cv=none; b=BktDY+0AodbGJcxm8vsBnaZBIMRYodiATYUNGvOYzxnhHZj0PbNWDlh8cF8KQ4UOPvzWXWdkqEoQl5oLZnlF4wGwJcQYQr0q+90sh6XZwgc7NYo1j+sXjIWSse56bXDrWQRLKUDCFkSlDZAC8e05fMZf5zMy7Ddwtca/P5t8S8s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722373293; c=relaxed/simple; bh=DIYns7sOpWGlxsMZctLGbqA3+geaRrpDHk/RW0OnYgc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uyLAN9U4meyl29qD60KvEbDvbCs5opa+pcV+QH0COaquARnV8zpM2JuOOeiKE/dkgw74j79mXJKLuOQAQpiQ3kP/PU9bcpsz0K2D5Zcw3NuVzGIns0e4ufDKVNijvgr+57xe52c89Xg9OezBRTkzX0IIJncypDtcSviv4kTieNQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=hYDUox6c; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="hYDUox6c" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4WYSMC575Hz6CmQwN; Tue, 30 Jul 2024 21:01:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1722373283; x=1724965284; bh=BtBCf 44TfWZBCjg679irYhvMDUYvD4YdQj0HqflK2jQ=; b=hYDUox6c/X40IeIJTACeY gRJh3idiGCP3Vu1ym5tM5sv3PgEycKHlcm7PT9a7mTNMPEjhwLYVCTRsuziJR/a7 s7zkI1KUVc/MUbfBGpTEO80pgkd61iBjdAbcDsItl4K0zh5HEhB2pwFM8HrQOGA2 +s+7LF1Kho1INEmelENaA2BLmNxzv0w2KZJDVI/QtA0Xy/CW0Jm3UT5mG07YKy+S HtHAiLeo2qAFaJ96fo5zYQBRvzAntEv8lojLTQbSheXlMmxEMis7Yt0H/Bs5RoVb dN5STRmGEIMn0+msZ4QsF5dHD9A8YmkLNpKOXyk0Ed2MKaFkzxFgEA+y8yYXC13G g== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id 3mDcrbhrhPZ9; Tue, 30 Jul 2024 21:01:23 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4WYSM5664Gz6CmM6V; Tue, 30 Jul 2024 21:01:21 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Christoph Hellwig , Damien Le Moal , Hannes Reinecke , Bart Van Assche , "James E.J. Bottomley" Subject: [PATCH 5/6] scsi: sd: Move the sd_fops definition Date: Tue, 30 Jul 2024 14:00:40 -0700 Message-ID: <20240730210042.266504-6-bvanassche@acm.org> X-Mailer: git-send-email 2.46.0.rc2.264.g509ed76dc8-goog In-Reply-To: <20240730210042.266504-1-bvanassche@acm.org> References: <20240730210042.266504-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Move the sd_fops definition such that the sd_unlock_native_capacity() forward declaration can be removed. Signed-off-by: Bart Van Assche Reviewed-by: Damien Le Moal --- drivers/scsi/sd.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index cefc40de6ee8..3f4df58f2bbc 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -104,7 +104,6 @@ MODULE_ALIAS_SCSI_DEVICE(TYPE_ZBC); #define SD_MINORS 16 static int sd_revalidate_disk(struct gendisk *); -static void sd_unlock_native_capacity(struct gendisk *disk); static DEFINE_IDA(sd_index_ida); @@ -2140,21 +2139,6 @@ static void scsi_disk_free_disk(struct gendisk *disk) put_device(&sdkp->disk_dev); } -static const struct block_device_operations sd_fops = { - .owner = THIS_MODULE, - .open = sd_open, - .release = sd_release, - .ioctl = sd_ioctl, - .getgeo = sd_getgeo, - .compat_ioctl = blkdev_compat_ptr_ioctl, - .check_events = sd_check_events, - .unlock_native_capacity = sd_unlock_native_capacity, - .report_zones = sd_zbc_report_zones, - .get_unique_id = sd_get_unique_id, - .free_disk = scsi_disk_free_disk, - .pr_ops = &sd_pr_ops, -}; - /** * sd_eh_reset - reset error handling callback * @scmd: sd-issued command that has failed @@ -3845,6 +3829,21 @@ static void sd_unlock_native_capacity(struct gendisk *disk) sdev->host->hostt->unlock_native_capacity(sdev); } +static const struct block_device_operations sd_fops = { + .owner = THIS_MODULE, + .open = sd_open, + .release = sd_release, + .ioctl = sd_ioctl, + .getgeo = sd_getgeo, + .compat_ioctl = blkdev_compat_ptr_ioctl, + .check_events = sd_check_events, + .unlock_native_capacity = sd_unlock_native_capacity, + .report_zones = sd_zbc_report_zones, + .get_unique_id = sd_get_unique_id, + .free_disk = scsi_disk_free_disk, + .pr_ops = &sd_pr_ops, +}; + /** * sd_format_disk_name - format disk name * @prefix: name prefix - ie. "sd" for SCSI disks