Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1902591/?format=api
{ "id": 1902591, "url": "http://patchwork.ozlabs.org/api/patches/1902591/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-um/patch/20240222072417.3773131-2-hch@lst.de/", "project": { "id": 60, "url": "http://patchwork.ozlabs.org/api/projects/60/?format=api", "name": "User-mode Linux Development", "link_name": "linux-um", "list_id": "linux-um.lists.infradead.org", "list_email": "linux-um@lists.infradead.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20240222072417.3773131-2-hch@lst.de>", "list_archive_url": null, "date": "2024-02-22T07:24:11", "name": "[1/7] ubd: remove the ubd_gendisk array", "commit_ref": null, "pull_url": null, "state": "handled-elsewhere", "archived": false, "hash": "bdf1f25171974a6c9328d84a4289163f2a41546c", "submitter": { "id": 82, "url": "http://patchwork.ozlabs.org/api/people/82/?format=api", "name": "Christoph Hellwig", "email": "hch@lst.de" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-um/patch/20240222072417.3773131-2-hch@lst.de/mbox/", "series": [ { "id": 396078, "url": "http://patchwork.ozlabs.org/api/series/396078/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-um/list/?series=396078", "date": "2024-02-22T07:24:13", "name": "[1/7] ubd: remove the ubd_gendisk array", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/396078/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1902591/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1902591/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=NpgIgTVx;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4TgPm11Pv9z23hw\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 22 Feb 2024 18:24:26 +1100 (AEDT)", "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux))\n\tid 1rd3RQ-00000003ndV-3thR;\n\tThu, 22 Feb 2024 07:24:24 +0000", "from [2001:4bb8:19a:62b2:c70:4a89:bc61:3] (helo=localhost)\n\tby bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux))\n\tid 1rd3RN-00000003ncd-2Usl;\n\tThu, 22 Feb 2024 07:24:21 +0000" ], "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help\n\t:List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding:\n\tMIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:\n\tReply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From:\n\tResent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner;\n\tbh=iZVt+4PHBEup3fys/3++8LkDhk2PlaRb6Zd/R2NR/Ws=; b=NpgIgTVxsGZCnc6/bwp7N6F3wP\n\tX4X6MsdEDrYL8OpbXjMbPNWSPC3ReuLMT8igodvmrjuoAPpSkWw6m7qr43xFWbGSiX623NaKQGZjU\n\tg6T3qsAbOL4CFtQXulXFFeoI5007ljBMBICywNB33v3cuptQ62aA+hXzH1zzLCuRpC2D4xDzyfgZE\n\tG1DmYG9OwELmiajwOLYZlXZlmV7tOP8d1wypcSJmYdb8NfvPklF2fXsdXmDICgh5ixlUz4GMJ67iQ\n\telZAc/MS2tQ3eCcc26G/Z3R7WM64LNr0Y3R1rVYw/H6gf4p1clWZxu5/mKjs4eo39ZEMF1/B83f5k\n\tS71LYH+A==;", "From": "Christoph Hellwig <hch@lst.de>", "To": "Richard Weinberger <richard@nod.at>,\n\tAnton Ivanov <anton.ivanov@cambridgegreys.com>,\n\tJohannes Berg <johannes@sipsolutions.net>,\n\tJens Axboe <axboe@kernel.dk>", "Cc": "linux-um@lists.infradead.org,\n\tlinux-block@vger.kernel.org", "Subject": "[PATCH 1/7] ubd: remove the ubd_gendisk array", "Date": "Thu, 22 Feb 2024 08:24:11 +0100", "Message-Id": "<20240222072417.3773131-2-hch@lst.de>", "X-Mailer": "git-send-email 2.39.2", "In-Reply-To": "<20240222072417.3773131-1-hch@lst.de>", "References": "<20240222072417.3773131-1-hch@lst.de>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "linux-um@lists.infradead.org", "X-Mailman-Version": "2.1.34", "Precedence": "list", "List-Id": "<linux-um.lists.infradead.org>", "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-um>,\n <mailto:linux-um-request@lists.infradead.org?subject=unsubscribe>", "List-Archive": "<http://lists.infradead.org/pipermail/linux-um/>", "List-Post": "<mailto:linux-um@lists.infradead.org>", "List-Help": "<mailto:linux-um-request@lists.infradead.org?subject=help>", "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-um>,\n <mailto:linux-um-request@lists.infradead.org?subject=subscribe>", "Sender": "\"linux-um\" <linux-um-bounces@lists.infradead.org>", "Errors-To": "linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org" }, "content": "And add a disk pointer to the ubd structure instead to keep all\nthe per-device information together.\n\nSigned-off-by: Christoph Hellwig <hch@lst.de>\n---\n arch/um/drivers/ubd_kern.c | 13 ++++---------\n 1 file changed, 4 insertions(+), 9 deletions(-)", "diff": "diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c\nindex 48e11f073551b4..b203ebb1785125 100644\n--- a/arch/um/drivers/ubd_kern.c\n+++ b/arch/um/drivers/ubd_kern.c\n@@ -125,9 +125,6 @@ static const struct block_device_operations ubd_blops = {\n \t.getgeo\t\t= ubd_getgeo,\n };\n \n-/* Protected by ubd_lock */\n-static struct gendisk *ubd_gendisk[MAX_DEV];\n-\n #ifdef CONFIG_BLK_DEV_UBD_SYNC\n #define OPEN_FLAGS ((struct openflags) { .r = 1, .w = 1, .s = 1, .c = 0, \\\n \t\t\t\t\t .cl = 1 })\n@@ -165,6 +162,7 @@ struct ubd {\n \tunsigned no_trim:1;\n \tstruct cow cow;\n \tstruct platform_device pdev;\n+\tstruct gendisk *disk;\n \tstruct request_queue *queue;\n \tstruct blk_mq_tag_set tag_set;\n \tspinlock_t lock;\n@@ -922,7 +920,6 @@ static int ubd_add(int n, char **error_out)\n \tif (err)\n \t\tgoto out_cleanup_disk;\n \n-\tubd_gendisk[n] = disk;\n \treturn 0;\n \n out_cleanup_disk:\n@@ -1014,7 +1011,6 @@ static int ubd_id(char **str, int *start_out, int *end_out)\n \n static int ubd_remove(int n, char **error_out)\n {\n-\tstruct gendisk *disk = ubd_gendisk[n];\n \tstruct ubd *ubd_dev;\n \tint err = -ENODEV;\n \n@@ -1030,10 +1026,9 @@ static int ubd_remove(int n, char **error_out)\n \tif(ubd_dev->count > 0)\n \t\tgoto out;\n \n-\tubd_gendisk[n] = NULL;\n-\tif(disk != NULL){\n-\t\tdel_gendisk(disk);\n-\t\tput_disk(disk);\n+\tif (ubd_dev->disk) {\n+\t\tdel_gendisk(ubd_dev->disk);\n+\t\tput_disk(ubd_dev->disk);\n \t}\n \n \terr = 0;\n", "prefixes": [ "1/7" ] }