Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3800260ybl; Mon, 27 Jan 2020 10:40:55 -0800 (PST) X-Google-Smtp-Source: APXvYqyo9OIXoaad6Z4pv9S/bT3yCC3JdoW5J84tnjsVaT3NhIe4HwtsOowtVXdQ+Y57rDezCZ3g X-Received: by 2002:a05:6808:681:: with SMTP id k1mr263939oig.143.1580150455325; Mon, 27 Jan 2020 10:40:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580150455; cv=none; d=google.com; s=arc-20160816; b=ngJzOPSvpA17XkZnp3H6lcyhzVP7w8hAFrhJwQDotHEgz0oOXQTCgUMQerKpHZpuLM FVlij2eFPM9ptbwJiIaECrINXBEBqhpUO1Selpyvj2ay68roekNd/qiLU2AbicysuiOT ZUhSWSoroj9gb2ml3LQ3pz0RUqlYszzP7MuT1zHVVVkqxHZQHHT/Ath6Utp8q3RNYMQ6 PInl3RqkW6ORVYLFkU/IWBZLJ7Mg1McsiWhgqpCyxFsOHRUebmmd2ao1Naimh5FHhjHK PcP/uBqk3vhmk8T0WjqWf835rcpd9a7af19xWOCwlLcmAS+gfsFhgSJG0p6gbY+CFRet HR4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=K6lw4MhaH7Ogvg8HgLliyQ6gk+RgP5XZqIOCx3ipbOk=; b=KyJbWe3OSXaCruXmg6FEsmTbZmAKClzBxtlklIQnLrsyTOjWHVYyqUvp/FCJZgTJZx LoXYpUCcmH3g/2bh6CncHG68stpTO0ChCy4HMai89Ovwl+f+m4FNni/jKKdFpliKWaQO E5eY7ae4eEHat9dmtUJJ29rDI9Yk+8pG88uHyjuA/0aDFBc2hmADhKwX2W6kvv7CUS+Z Yvpacw1SiR7aAbXm05iqerngrtDtN/7uBk6imMAxWP+JA9G5E5pn72ngXEsi/NH6S33E GwkYmqjOuNiyY37qk5+mxZnttPbX7+g0TbcrB0g0EcQeUe5VAIk3Vbg6BIVgdGVmTKju a0Hw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y20si7673429otq.190.2020.01.27.10.40.43; Mon, 27 Jan 2020 10:40:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726101AbgA0Sjv (ORCPT + 99 others); Mon, 27 Jan 2020 13:39:51 -0500 Received: from mx2.suse.de ([195.135.220.15]:52722 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725845AbgA0Sju (ORCPT ); Mon, 27 Jan 2020 13:39:50 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 802C2B15B; Mon, 27 Jan 2020 18:39:48 +0000 (UTC) Date: Mon, 27 Jan 2020 18:39:52 +0000 From: Luis Henriques To: Ilya Dryomov Cc: Jeff Layton , Sage Weil , "Yan, Zheng" , Gregory Farnum , Ceph Development , LKML Subject: Re: [RFC PATCH 1/3] libceph: add non-blocking version of ceph_osdc_copy_from() Message-ID: <20200127183952.GA22545@suse.com> References: <20200127164321.17468-1-lhenriques@suse.com> <20200127164321.17468-2-lhenriques@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 27, 2020 at 06:47:02PM +0100, Ilya Dryomov wrote: > On Mon, Jan 27, 2020 at 5:43 PM Luis Henriques wrote: > > > > A non-blocking version of ceph_osdc_copy_from will allow for callers to > > send 'copy-from' requests in bulk and wait for all of them to complete in > > the end. > > > > Signed-off-by: Luis Henriques > > --- > > include/linux/ceph/osd_client.h | 12 ++++++++ > > net/ceph/osd_client.c | 54 +++++++++++++++++++++++++-------- > > 2 files changed, 53 insertions(+), 13 deletions(-) > > > > diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h > > index 5a62dbd3f4c2..7916a178d137 100644 > > --- a/include/linux/ceph/osd_client.h > > +++ b/include/linux/ceph/osd_client.h > > @@ -537,6 +537,18 @@ int ceph_osdc_copy_from(struct ceph_osd_client *osdc, > > u32 truncate_seq, u64 truncate_size, > > u8 copy_from_flags); > > > > +struct ceph_osd_request *ceph_osdc_copy_from_nowait( > > + struct ceph_osd_client *osdc, > > + u64 src_snapid, u64 src_version, > > + struct ceph_object_id *src_oid, > > + struct ceph_object_locator *src_oloc, > > + u32 src_fadvise_flags, > > + struct ceph_object_id *dst_oid, > > + struct ceph_object_locator *dst_oloc, > > + u32 dst_fadvise_flags, > > + u32 truncate_seq, u64 truncate_size, > > + u8 copy_from_flags); > > + > > /* watch/notify */ > > struct ceph_osd_linger_request * > > ceph_osdc_watch(struct ceph_osd_client *osdc, > > diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c > > index b68b376d8c2f..7f984532f37c 100644 > > --- a/net/ceph/osd_client.c > > +++ b/net/ceph/osd_client.c > > @@ -5346,23 +5346,24 @@ static int osd_req_op_copy_from_init(struct ceph_osd_request *req, > > return 0; > > } > > > > -int ceph_osdc_copy_from(struct ceph_osd_client *osdc, > > - u64 src_snapid, u64 src_version, > > - struct ceph_object_id *src_oid, > > - struct ceph_object_locator *src_oloc, > > - u32 src_fadvise_flags, > > - struct ceph_object_id *dst_oid, > > - struct ceph_object_locator *dst_oloc, > > - u32 dst_fadvise_flags, > > - u32 truncate_seq, u64 truncate_size, > > - u8 copy_from_flags) > > +struct ceph_osd_request *ceph_osdc_copy_from_nowait( > > + struct ceph_osd_client *osdc, > > + u64 src_snapid, u64 src_version, > > + struct ceph_object_id *src_oid, > > + struct ceph_object_locator *src_oloc, > > + u32 src_fadvise_flags, > > + struct ceph_object_id *dst_oid, > > + struct ceph_object_locator *dst_oloc, > > + u32 dst_fadvise_flags, > > + u32 truncate_seq, u64 truncate_size, > > + u8 copy_from_flags) > > { > > struct ceph_osd_request *req; > > int ret; > > > > req = ceph_osdc_alloc_request(osdc, NULL, 1, false, GFP_KERNEL); > > if (!req) > > - return -ENOMEM; > > + return ERR_PTR(-ENOMEM); > > > > req->r_flags = CEPH_OSD_FLAG_WRITE; > > > > @@ -5381,11 +5382,38 @@ int ceph_osdc_copy_from(struct ceph_osd_client *osdc, > > goto out; > > > > ceph_osdc_start_request(osdc, req, false); > > - ret = ceph_osdc_wait_request(osdc, req); > > + return req; > > > > out: > > ceph_osdc_put_request(req); > > - return ret; > > + return ERR_PTR(ret); > > +} > > +EXPORT_SYMBOL(ceph_osdc_copy_from_nowait); > > + > > +int ceph_osdc_copy_from(struct ceph_osd_client *osdc, > > + u64 src_snapid, u64 src_version, > > + struct ceph_object_id *src_oid, > > + struct ceph_object_locator *src_oloc, > > + u32 src_fadvise_flags, > > + struct ceph_object_id *dst_oid, > > + struct ceph_object_locator *dst_oloc, > > + u32 dst_fadvise_flags, > > + u32 truncate_seq, u64 truncate_size, > > + u8 copy_from_flags) > > +{ > > + struct ceph_osd_request *req; > > + > > + req = ceph_osdc_copy_from_nowait(osdc, > > + src_snapid, src_version, > > + src_oid, src_oloc, > > + src_fadvise_flags, > > + dst_oid, dst_oloc, > > + dst_fadvise_flags, > > + truncate_seq, truncate_size, > > + copy_from_flags); > > + if (IS_ERR(req)) > > + return PTR_ERR(req); > > + return ceph_osdc_wait_request(osdc, req); > > I don't think we need a blocking version. Change ceph_osdc_copy_from() > and keep the name -- no need for async or nowait suffixes. Yeah, since the only user is copy_file_range we definitely don't need the original version. I'll include this change in the next iteration. Cheers, -- Lu?s