From patchwork Thu Feb 27 21:17:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11410807 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 25B0A924 for ; Thu, 27 Feb 2020 21:47:21 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 08D5B24690 for ; Thu, 27 Feb 2020 21:47:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 08D5B24690 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id BA2D634B420; Thu, 27 Feb 2020 13:37:24 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id E28DF3489D0 for ; Thu, 27 Feb 2020 13:21:20 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id 26459A143; Thu, 27 Feb 2020 16:18:20 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 251D046C; Thu, 27 Feb 2020 16:18:20 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:17:32 -0500 Message-Id: <1582838290-17243-585-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> References: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 584/622] lustre: uapi: LU-12521 llapi: add separate fsname and instance API X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Andreas Dilger For Lustre the kernel internal cfg instance is represented by a 16 numeric value very similar but not an UUID. This value is exposed to user land since this value is used to generate the sysfs directory tree to represent virtual devices. Expose this fixed value for kernel and user land use. WC-bug-id: https://jira.whamcloud.com/browse/LU-12521 Lustre-commit: 00d14521ca1c ("LU-12521 llapi: add separate fsname and instance API") Signed-off-by: Andreas Dilger Reviewed-on: https://review.whamcloud.com/35451 Reviewed-by: Olaf Faaland-LLNL Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- fs/lustre/obdclass/obd_config.c | 2 +- include/uapi/linux/lustre/lustre_user.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/lustre/obdclass/obd_config.c b/fs/lustre/obdclass/obd_config.c index 97cb8c1..0ccdf5f 100644 --- a/fs/lustre/obdclass/obd_config.c +++ b/fs/lustre/obdclass/obd_config.c @@ -1374,7 +1374,7 @@ int class_config_llog_handler(const struct lu_env *env, lcfg->lcfg_command != LCFG_SPTLRPC_CONF && LUSTRE_CFG_BUFLEN(lcfg, 0) > 0) { inst_len = LUSTRE_CFG_BUFLEN(lcfg, 0) + - sizeof(clli->cfg_instance) * 2 + 4; + LUSTRE_MAXINSTANCE + 4; inst_name = kasprintf(GFP_NOFS, "%s-%px", lustre_cfg_string(lcfg, 0), clli->cfg_instance); diff --git a/include/uapi/linux/lustre/lustre_user.h b/include/uapi/linux/lustre/lustre_user.h index 1c36114..08589e6 100644 --- a/include/uapi/linux/lustre/lustre_user.h +++ b/include/uapi/linux/lustre/lustre_user.h @@ -829,6 +829,7 @@ static inline char *obd_uuid2str(const struct obd_uuid *uuid) } #define LUSTRE_MAXFSNAME 8 +#define LUSTRE_MAXINSTANCE 16 /* Extract fsname from uuid (or target name) of a target * e.g. (myfs-OST0007_UUID -> myfs)