Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp796954pxj; Thu, 13 May 2021 17:53:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydTm9fzBX14IAD76BdLv6O8stuC5bxK2DhOXIicsKXAK40nmh6QJibuLLDPxFSlpox063Y X-Received: by 2002:aa7:d818:: with SMTP id v24mr8852070edq.290.1620953602719; Thu, 13 May 2021 17:53:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620953602; cv=none; d=google.com; s=arc-20160816; b=zADVyBrVLHJr9WUK3+OPOVy7L0FhJdV0PJSQfNBWkvYiFDIuS9zC85HIT5R8ba3lWC rKFmMIplVpLesqRtgk3YnmnaTtPZEqM70LG/HIemZVIVVo2oM3YYjfKEJk5jFIPeh1Pw 58r9FcvdCrCyps3n6KnWFTQxFoVECLF6dnUt4u4g3iQriOYMm+3vU3i3g67KEg+wE4IK u0K/9z//dn1UwjYpkhXAVWhdQ+w/HBj8HG3WG69WgBS1S08GcOAG3zLOZDPRPU6SiTCq 8YU5xSnrXE+0rkaR36FdZfw+v4AOJQwJ9D1IW6JOEQcnboooIK2wEJ271QWEFz5vM6fe kZtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=M01C2fZMqcHUcLVFtRi4PocgfBCLnoPYqt52x2I+p50=; b=x4e2Hjkp1zoiBS3xv/FrWwQUmI2OLCtFArC4oeUMwVK5J4c0vomrVhXztTzVJ+blVj un5/hsEasCUePt30Sa0XMpEZbf9rwNSPupkKg8WhFVm9uBTu7wlTkPspR0JL5UTuWxxK gcPEBWrC/V9nJ83pr3OcJKfs5uXC7bzv+sGzPSNYOurOwz5HiW/sk71g9JmRbtWGYEIN 8Sw8gg/4kGWIyQXSESIidwIz60EViWF4uMUFqJjzbXGRW/aQApldcnhVgjYyoI63goBw LHfOE23f/dTNxz6rMvgmAQlOI2yNuGmh75nuQ1lfTW+oHVb+nUsqZymHX/MJdKCHkRjb eJNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mrGBJBiu; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h6si1843978ejq.486.2021.05.13.17.52.51; Thu, 13 May 2021 17:53:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mrGBJBiu; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233437AbhEMVTg (ORCPT + 99 others); Thu, 13 May 2021 17:19:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233421AbhEMVTd (ORCPT ); Thu, 13 May 2021 17:19:33 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3B52C061574 for ; Thu, 13 May 2021 14:18:21 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id k10so10569828ejj.8 for ; Thu, 13 May 2021 14:18:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=M01C2fZMqcHUcLVFtRi4PocgfBCLnoPYqt52x2I+p50=; b=mrGBJBiukLLBTr13cWEBLfXJDXued3EVhwJ83I6jjp4O5v/9wq8i7BIb2XYEk3f0S8 Jcs/8fj2E49r648OSArycLj2Mxk8YLQZOR/FoW15VnjDNS6YuvZMrHIvlF4YNCGqjMQp eqMKPt9JwQaR9FOM+LX4VjCDl/AgvSKS8YpGgATmQFBWb46/pi9bpj5EzKMmu07ASujn hj2MYtiSR+Kx5p0Rpf5G4uiRpdkoRmRgpYFHRYtXIwS9DE8Cs8QEYwmic07TO87OSvp7 wanlAMuMBIny66OHBsQRSJPVWHoCMQh8e13BJw/oXMU/Jgeh/BMKufQzAFQgbzjiKBfd XxZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M01C2fZMqcHUcLVFtRi4PocgfBCLnoPYqt52x2I+p50=; b=EQcVu3ZP5IH78A0xI8ly4p4UL/8c0yio213QdT6PnrMb1OeiUTYZvqQXjozRkCnp4k VZs/vRj8ec9vRsMbsyk+7AHbzsThr+nhf98puEfQ5S/DWVrLFHET1oFE/Ah3S2OimnB6 GM+NOhha2FNq9rBg4sEdhZkEFhTfyqaIAYQbol5zy0pCEYJZfKmXAsm1BrmK6oUd5TWJ wLqU58ab838CGrAWpL+r9D30NNzt9M+dVR9gj7ONQVEiWnUI6s3Pj7xWzbuOjfgG3gXa HprZNuyxUP1AkrXAWwcYvzBrN/UxOcP1S98nu/U9UGF9xsWJE49WSZ4EW8j1LjI/RZEW M7/Q== X-Gm-Message-State: AOAM530O+4zlqBiKD5aIXwp0IrVxtaLdA09LKtCC9hnxbSTxm2pVHCuX YnSjJpKUS6F8GDPnDoerIZnfq7hoQU3WIIzws88= X-Received: by 2002:a17:906:e105:: with SMTP id gj5mr46953790ejb.388.1620940700503; Thu, 13 May 2021 14:18:20 -0700 (PDT) MIME-Version: 1.0 References: <20210426171947.99233-1-olga.kornievskaia@gmail.com> <20210426171947.99233-10-olga.kornievskaia@gmail.com> <20210427044214.vlbmbfdh5dpq4vhl@gmail.com> In-Reply-To: <20210427044214.vlbmbfdh5dpq4vhl@gmail.com> From: Olga Kornievskaia Date: Thu, 13 May 2021 17:18:09 -0400 Message-ID: Subject: Re: [PATCH v3 09/13] sunrpc: add a symlink from rpc-client directory to the xprt_switch To: Dan Aloni Cc: Trond Myklebust , Anna Schumaker , linux-nfs Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Tue, Apr 27, 2021 at 12:42 AM Dan Aloni wrote: > > On Mon, Apr 26, 2021 at 01:19:43PM -0400, Olga Kornievskaia wrote: > > From: Olga Kornievskaia > > > > An rpc client uses a transport switch and one ore more transports > > associated with that switch. Since transports are shared among > > rpc clients, create a symlink into the xprt_switch directory > > instead of duplicating entries under each rpc client. > > > > Signed-off-by: Olga Kornievskaia > > > >.. > > @@ -188,6 +204,11 @@ void rpc_sysfs_client_destroy(struct rpc_clnt *clnt) > > struct rpc_sysfs_client *rpc_client = clnt->cl_sysfs; > > > > if (rpc_client) { > > + char name[23]; > > + > > + snprintf(name, sizeof(name), "switch-%d", > > + rpc_client->xprt_switch->xps_id); > > + sysfs_remove_link(&rpc_client->kobject, name); > > Hi Olga, > > If a client can use a single switch, shouldn't the name of the symlink > be just "switch"? This is to be consistent with other symlinks in > `sysfs` such as the ones in block layer, for example in my > `/sys/block/sda`: > > bdi -> ../../../../../../../../../../../virtual/bdi/8:0 > device -> ../../../5:0:0:0 > Jumping back to this comment because now that I went back to try to modify the code I'm having doubts. We still need numbering of xprt switches because they are different for different mounts. So xprt_switches directory would still have switch-0 for say a mount to server A and then switch-0 for a mount to server B. While yes I see that for a given rpc client that's making a link into a xprt_switches directory will only have 1 link. And "yes" the name of the link could be "switch". But isn't it more informative to keep this to be the same name as the name of the directory under the xprt_switches? > > -- > Dan Aloni