linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Ilya Dryomov <idryomov@gmail.com>, Xiubo Li <xiubli@redhat.com>
Cc: David Howells <dhowells@redhat.com>,
	Jeff Layton <jlayton@kernel.org>,
	Dongsheng Yang <dongsheng.yang@easystack.cn>,
	ceph-devel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [RFC PATCH 09/18] ceph: Convert notify_id_pages to a ceph_databuf
Date: Fri,  4 Aug 2023 14:13:18 +0100	[thread overview]
Message-ID: <20230804131327.2574082-10-dhowells@redhat.com> (raw)
In-Reply-To: <20230804131327.2574082-1-dhowells@redhat.com>

Convert linger->notify_id_pages to a ceph_databuf

Signed-off-by: David Howells <dhowells@redhat.com>
---
 include/linux/ceph/osd_client.h |  2 +-
 net/ceph/osd_client.c           | 18 +++++++-----------
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index 0b02e272acc2..780bd49d2734 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -348,7 +348,7 @@ struct ceph_osd_linger_request {
 	void *data;
 
 	struct ceph_pagelist *request_pl;
-	struct page **notify_id_pages;
+	struct ceph_databuf *notify_id_buf;
 
 	struct page ***preply_pages;
 	size_t *preply_len;
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index aa9d07221149..02c35785ec28 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -2825,11 +2825,8 @@ static void linger_release(struct kref *kref)
 	WARN_ON(!list_empty(&lreq->pending_lworks));
 	WARN_ON(lreq->osd);
 
-	if (lreq->request_pl)
-		ceph_pagelist_release(lreq->request_pl);
-	if (lreq->notify_id_pages)
-		ceph_release_page_vector(lreq->notify_id_pages, 1);
-
+	ceph_pagelist_release(lreq->request_pl);
+	ceph_databuf_release(lreq->notify_id_buf);
 	ceph_osdc_put_request(lreq->reg_req);
 	ceph_osdc_put_request(lreq->ping_req);
 	target_destroy(&lreq->t);
@@ -3210,9 +3207,9 @@ static void send_linger(struct ceph_osd_linger_request *lreq)
 			refcount_inc(&lreq->request_pl->refcnt);
 			osd_req_op_notify_init(req, 0, lreq->linger_id,
 					       lreq->request_pl);
-			ceph_osd_data_pages_init(
+			ceph_osd_databuf_init(
 			    osd_req_op_data(req, 0, notify, response_data),
-			    lreq->notify_id_pages, PAGE_SIZE, 0, false, false);
+			    lreq->notify_id_buf);
 		}
 		dout("lreq %p register\n", lreq);
 		req->r_callback = linger_commit_cb;
@@ -4995,10 +4992,9 @@ int ceph_osdc_notify(struct ceph_osd_client *osdc,
 	}
 
 	/* for notify_id */
-	lreq->notify_id_pages = ceph_alloc_page_vector(1, GFP_NOIO);
-	if (IS_ERR(lreq->notify_id_pages)) {
-		ret = PTR_ERR(lreq->notify_id_pages);
-		lreq->notify_id_pages = NULL;
+	lreq->notify_id_buf = ceph_databuf_alloc(1, PAGE_SIZE, GFP_NOIO);
+	if (!lreq->notify_id_buf) {
+		ret = -ENOMEM;
 		goto out_put_lreq;
 	}
 


  parent reply	other threads:[~2023-08-04 13:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-04 13:13 [RFC PATCH 00/18] ceph, rbd: Collapse all the I/O types down to something iov_iter-based David Howells
2023-08-04 13:13 ` [RFC PATCH 01/18] iov_iter: Add function to see if buffer is all zeros David Howells
2023-08-04 13:13 ` [RFC PATCH 02/18] ceph: Rename alignment to offset David Howells
2023-08-04 13:13 ` [RFC PATCH 03/18] ceph: Add a new data container type, ceph_databuf David Howells
2023-08-04 13:13 ` [RFC PATCH 04/18] ceph: Convert ceph_mds_request::r_pagelist to a databuf David Howells
2023-08-04 13:13 ` [RFC PATCH 05/18] rbd: Use ceph_databuf for rbd_obj_read_sync() David Howells
2023-08-04 13:13 ` [RFC PATCH 06/18] ceph: Change ceph_osdc_call()'s reply to a ceph_databuf David Howells
2023-08-04 13:13 ` [RFC PATCH 07/18] ceph: Unexport osd_req_op_cls_request_data_pages() David Howells
2023-08-04 13:13 ` [RFC PATCH 08/18] ceph: Remove osd_req_op_cls_response_data_pages() David Howells
2023-08-04 13:13 ` David Howells [this message]
2023-08-04 13:13 ` [RFC PATCH 10/18] rbd: Switch from using bvec_iter to iov_iter David Howells
2023-08-04 13:13 ` [RFC PATCH 11/18] ceph: Remove bvec and bio data container types David Howells
2023-08-04 13:13 ` [RFC PATCH 12/18] ceph: Convert some page arrays to ceph_databuf David Howells
2023-08-04 13:13 ` [RFC PATCH 13/18] ceph: Convert users of ceph_pagelist " David Howells
2023-08-04 13:13 ` [RFC PATCH 14/18] ceph: Remove ceph_pagelist David Howells
2023-08-04 13:13 ` [RFC PATCH 15/18] ceph: Convert ceph_osdc_notify() reply to ceph_databuf David Howells
2023-08-04 13:13 ` [RFC PATCH 16/18] ceph: Remove CEPH_OS_DATA_TYPE_PAGES and its attendant helpers David Howells
2023-08-04 13:13 ` [RFC PATCH 17/18] ceph: Remove CEPH_MSG_DATA_PAGES and its helpers David Howells
2023-08-04 13:13 ` [RFC PATCH 18/18] ceph: Don't use data_pages David Howells
2023-08-28  1:32   ` Xiubo Li
2023-08-28  1:30 ` [RFC PATCH 00/18] ceph, rbd: Collapse all the I/O types down to something iov_iter-based Xiubo Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230804131327.2574082-10-dhowells@redhat.com \
    --to=dhowells@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dongsheng.yang@easystack.cn \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiubli@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).