Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp3583598rwo; Fri, 4 Aug 2023 07:07:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGn+VJ4BHVIXZ8JCOgSQCbGJfE86NT7uT+6avIWqowifu/N0NceCfqsz/dJia0/ZhHKJ4UL X-Received: by 2002:a17:902:7287:b0:1b8:b2c6:7e8d with SMTP id d7-20020a170902728700b001b8b2c67e8dmr1591841pll.66.1691158041066; Fri, 04 Aug 2023 07:07:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691158041; cv=none; d=google.com; s=arc-20160816; b=ws6mFLJ5kIDh38e5XCcbDay+pSSuPU5WUPs1ejlBoLZ3vFCn9QrJ7ThdAd5vdznDHv AFwJNgAdrVfWTTtfNjjQ+SPJj3h14nt+jU2iaKv3fKf8fDCKJFBGUTRVDuanJGsoVJ9R WyjKlV6kU//2PxFEDW9/kUb/5HSUREU90N4cQVhGFw0yromNk6htNBn499D/COENKryM y71Nc4TI2adh/9xriz9gcDrRCiCepJgqOkWjv7rSb16RwmEcEQr8a54pMUhuPPsGjL0Q Q1ROkoyhaNPKtxZUGOaxogWC0bv5/QzhO+snQe6ECpRaelQf9ul5jNFSio1O+Hfj8vSj QT4w== 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=jzu8fasV+aKxrhKzf7SpDRjT/Fb/KvqzXURcAl/1eC8=; fh=2+k2UmE8LvafU5qNzgAjM/Dn4M5GGukEmX+hFN4rQ+Y=; b=Tx2dwg9yveHKI161y1V+jliVilpiwoQKTDkLyV4EPENgbA7YDTIG8tVpcHlu/AGlM3 iZ1jkWqfIVNnRs2w/0cl0UdkLnKYv0zQsggE50DTB0V1dugUa7zPyTqlcV9/ltH0tel1 Blx1FUQUMOC8cF6VkB/Cv3NsUNSoMDBNtR3GHMbDUimXCSoQr7a+RS6y8svGKh74rE0i zXGETxQVQCCYprz9HsP8E6Y459Dgy/qrzZJc4514zGo//tLlWPGQYVjvYLhXPEAq9IRf o3QOkn0/EESoivst71OeroJOAujTH+QuOjt9oUpa/eVlkbkMAz2Jci4BV+vrKCPemL1r Mcgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TJYHQBOD; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k4-20020a170902d58400b001bbae3ae2bcsi1814088plh.413.2023.08.04.07.07.08; Fri, 04 Aug 2023 07:07:21 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TJYHQBOD; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230197AbjHDNRh (ORCPT + 99 others); Fri, 4 Aug 2023 09:17:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230313AbjHDNQk (ORCPT ); Fri, 4 Aug 2023 09:16:40 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FBB74ECE for ; Fri, 4 Aug 2023 06:14:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691154846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jzu8fasV+aKxrhKzf7SpDRjT/Fb/KvqzXURcAl/1eC8=; b=TJYHQBODQRnKWoZ33NruCb2usMtvheibGLK/Vpb0mb/7t4NGz0ngl+jgkZeUIKNfOWEsaW QXrKZkiG16zJn0ex1q1QhgEB7h4wnYhz3YTpIoylO9bimdCm/84JH9Bjly7WYgPqHTp6Gs vtvlUDJr20Y2pE6nUJ4vlpHFIpN0SpI= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-611-KDnOmyoHPMCfaw7z8GudnA-1; Fri, 04 Aug 2023 09:14:03 -0400 X-MC-Unique: KDnOmyoHPMCfaw7z8GudnA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C08613C0FCB0; Fri, 4 Aug 2023 13:14:02 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93B07492B03; Fri, 4 Aug 2023 13:14:01 +0000 (UTC) From: David Howells To: Ilya Dryomov , Xiubo Li Cc: David Howells , Jeff Layton , Dongsheng Yang , ceph-devel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 16/18] ceph: Remove CEPH_OS_DATA_TYPE_PAGES and its attendant helpers Date: Fri, 4 Aug 2023 14:13:25 +0100 Message-ID: <20230804131327.2574082-17-dhowells@redhat.com> In-Reply-To: <20230804131327.2574082-1-dhowells@redhat.com> References: <20230804131327.2574082-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 --- include/linux/ceph/osd_client.h | 20 ++---------- net/ceph/osd_client.c | 57 +-------------------------------- 2 files changed, 3 insertions(+), 74 deletions(-) diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index 3099f923c241..1a1137787487 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h @@ -103,23 +103,13 @@ struct ceph_osd { enum ceph_osd_data_type { CEPH_OSD_DATA_TYPE_NONE = 0, CEPH_OSD_DATA_TYPE_DATABUF, - CEPH_OSD_DATA_TYPE_PAGES, CEPH_OSD_DATA_TYPE_ITER, }; struct ceph_osd_data { enum ceph_osd_data_type type; - union { - struct ceph_databuf *dbuf; - struct { - struct page **pages; - u64 length; - u32 offset; - bool pages_from_pool; - bool own_pages; - }; - struct iov_iter iter; - }; + struct ceph_databuf *dbuf; + struct iov_iter iter; }; struct ceph_osd_req_op { @@ -451,12 +441,6 @@ void ceph_osdc_clear_abort_err(struct ceph_osd_client *osdc); struct ceph_osd_req_op *osd_req_op_init(struct ceph_osd_request *osd_req, unsigned int which, u16 opcode, u32 flags); -extern void osd_req_op_raw_data_in_pages(struct ceph_osd_request *, - unsigned int which, - struct page **pages, u64 length, - u32 offset, bool pages_from_pool, - bool own_pages); - extern void osd_req_op_extent_init(struct ceph_osd_request *osd_req, unsigned int which, u16 opcode, u64 offset, u64 length, diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 0fe16fdc760f..70f81a0b62c0 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -122,21 +122,6 @@ static void ceph_osd_data_init(struct ceph_osd_data *osd_data) osd_data->type = CEPH_OSD_DATA_TYPE_NONE; } -/* - * Consumes @pages if @own_pages is true. - */ -static void ceph_osd_data_pages_init(struct ceph_osd_data *osd_data, - struct page **pages, u64 length, u32 offset, - bool pages_from_pool, bool own_pages) -{ - osd_data->type = CEPH_OSD_DATA_TYPE_PAGES; - osd_data->pages = pages; - osd_data->length = length; - osd_data->offset = offset; - osd_data->pages_from_pool = pages_from_pool; - osd_data->own_pages = own_pages; -} - static void ceph_osd_iter_init(struct ceph_osd_data *osd_data, struct iov_iter *iter) { @@ -181,19 +166,6 @@ void osd_req_op_raw_data_in_databuf(struct ceph_osd_request *osd_req, } EXPORT_SYMBOL(osd_req_op_raw_data_in_databuf); -void osd_req_op_raw_data_in_pages(struct ceph_osd_request *osd_req, - unsigned int which, struct page **pages, - u64 length, u32 offset, - bool pages_from_pool, bool own_pages) -{ - struct ceph_osd_data *osd_data; - - osd_data = osd_req_op_raw_data_in(osd_req, which); - ceph_osd_data_pages_init(osd_data, pages, length, offset, - pages_from_pool, own_pages); -} -EXPORT_SYMBOL(osd_req_op_raw_data_in_pages); - void osd_req_op_extent_osd_databuf(struct ceph_osd_request *osd_req, unsigned int which, struct ceph_databuf *dbuf) @@ -205,19 +177,6 @@ void osd_req_op_extent_osd_databuf(struct ceph_osd_request *osd_req, } EXPORT_SYMBOL(osd_req_op_extent_osd_databuf); -void osd_req_op_extent_osd_data_pages(struct ceph_osd_request *osd_req, - unsigned int which, struct page **pages, - u64 length, u32 offset, - bool pages_from_pool, bool own_pages) -{ - struct ceph_osd_data *osd_data; - - osd_data = osd_req_op_data(osd_req, which, extent, osd_data); - ceph_osd_data_pages_init(osd_data, pages, length, offset, - pages_from_pool, own_pages); -} -EXPORT_SYMBOL(osd_req_op_extent_osd_data_pages); - /** * osd_req_op_extent_osd_iter - Set up an operation with an iterator buffer * @osd_req: The request to set up @@ -285,8 +244,6 @@ static u64 ceph_osd_data_length(struct ceph_osd_data *osd_data) switch (osd_data->type) { case CEPH_OSD_DATA_TYPE_NONE: return 0; - case CEPH_OSD_DATA_TYPE_PAGES: - return osd_data->length; case CEPH_OSD_DATA_TYPE_ITER: return iov_iter_count(&osd_data->iter); default: @@ -297,13 +254,6 @@ static u64 ceph_osd_data_length(struct ceph_osd_data *osd_data) static void ceph_osd_data_release(struct ceph_osd_data *osd_data) { - if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGES && osd_data->own_pages) { - int num_pages; - - num_pages = calc_pages_for((u64)osd_data->offset, - (u64)osd_data->length); - ceph_release_page_vector(osd_data->pages, num_pages); - } ceph_osd_data_init(osd_data); } @@ -881,12 +831,7 @@ static void ceph_osdc_msg_data_add(struct ceph_msg *msg, { u64 length = ceph_osd_data_length(osd_data); - if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGES) { - BUG_ON(length > (u64) SIZE_MAX); - if (length) - ceph_msg_data_add_pages(msg, osd_data->pages, - length, osd_data->offset, false); - } else if (osd_data->type == CEPH_OSD_DATA_TYPE_ITER) { + if (osd_data->type == CEPH_OSD_DATA_TYPE_ITER) { ceph_msg_data_add_iter(msg, &osd_data->iter); } else { BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_NONE);