From 60df5d5e8c150d16d9c0ac06f4bd6749daa6d647 Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Wed, 21 Sep 2022 13:28:43 -0700 Subject: [PATCH] EX-5978 scripts: remove zfsobj2fid The zfsobj2fid utility is not needed on EXA cluster. Test-Parameters: trivial clientdistro=el9.0 \ env=SANITY_EXCEPT="101j 130 244a" testlist=sanity Change-Id: I40993c7c4ddef3f389c002076f5c118a9f610758 Signed-off-by: Jian Yu Reviewed-on: https://review.whamcloud.com/48621 Tested-by: jenkins Reviewed-by: Minh Diep Tested-by: Maloo Reviewed-by: Gaurang Tapase Reviewed-by: Andreas Dilger --- lustre.spec.in | 3 -- lustre/scripts/Makefile.am | 6 +--- lustre/scripts/zfsobj2fid | 76 ---------------------------------------------- 3 files changed, 1 insertion(+), 84 deletions(-) delete mode 100755 lustre/scripts/zfsobj2fid diff --git a/lustre.spec.in b/lustre.spec.in index 159273f..7a50b09 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -899,9 +899,6 @@ fi %exclude %{_sbindir}/wirecheck %exclude %{_sbindir}/wiretest %endif -%if %{with zfs} -%exclude %{_sbindir}/zfsobj2fid -%endif %if %{with pumount} %exclude %{_sbindir}/pumount %endif diff --git a/lustre/scripts/Makefile.am b/lustre/scripts/Makefile.am index 3ec741a..f3bd3c9 100644 --- a/lustre/scripts/Makefile.am +++ b/lustre/scripts/Makefile.am @@ -76,10 +76,6 @@ scriptlib_SCRIPTS = haconfig scriptlib_DATA = lc_common endif # SERVER -if ZFS_ENABLED -sbin_SCRIPTS += zfsobj2fid -endif - if ENABLE_BASH_COMPLETION bashcompletiondir = $(BASH_COMPLETION_DIR) dist_bashcompletion_DATA = bash-completion/lustre bash-completion/lctl \ @@ -92,7 +88,7 @@ EXTRA_DIST = license-status lustre_rmmod ldev lc_mon lhbadm \ lc_servip lustre_routes_config lustre_routes_conversion \ $(addsuffix .in,$(genscripts)) lfs_migrate lustre_req_history \ lustre lsvcgss lc_common haconfig Lustre.ha_v2 dkms.mkconf \ - zfsobj2fid ko2iblnd-probe ksocklnd-config statechange-lustre.sh \ + ko2iblnd-probe ksocklnd-config statechange-lustre.sh \ bash-completion/lustre bash-completion/lctl bash-completion/lfs \ umount.lustre diff --git a/lustre/scripts/zfsobj2fid b/lustre/scripts/zfsobj2fid deleted file mode 100755 index f7ae96b..0000000 --- a/lustre/scripts/zfsobj2fid +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env python2 - -# Copyright (c) 2014, Lawrence Livermore National Security, LLC. -# Produced at the Lawrence Livermore National Laboratory. -# Written by Christopher J. Morrone -# LLNL-CODE-468512 -# -# This file is part of lustre-tools-llnl. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License (as published by the -# Free Software Foundation) version 2, dated June 1991. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the IMPLIED WARRANTY OF -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# terms and conditions of the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -# Given a zfs dataset for a Lustre OST and the object number of a file -# in that dataset, this script will call zdb to retreive the Lustre FID -# and print it out in standard Lustre FID format. - -import sys -import subprocess - -def from_bytes(b): - return sum(b[i] << i*8 for i in range(len(b))) - -def main(): - if len(sys.argv) != 3: - print "Usage:", sys.argv[0], " " - return 1 - - p = subprocess.Popen(["zdb", "-e", "-vvv", sys.argv[1], sys.argv[2]], - stdout=subprocess.PIPE) - pout, perr = p.communicate() - - b = bytearray() - found_fid = False - for line in pout.split('\n'): - part = line.split() - if not part or part[0] != 'trusted.fid': - continue - fid = part[2] - found_fid = True - while len(fid) > 0: - val = fid[0] - fid = fid[1:] - if val == '\\': - val = fid[0:3] - fid = fid[3:] - b.append(int(val, 8)) - else: - b.append(ord(val)) - break - - if not found_fid: - print "FID not found on", sys.argv[1], sys.argv[2] - return 1 - - print '[' \ - + hex(from_bytes(b[0:8])) \ - + ':' \ - + hex(from_bytes(b[8:12])) \ - + ':' \ - + hex(from_bytes(b[12:16])) \ - + ']' - - return 0 - -if __name__ == '__main__': - sys.exit(main()) -- 1.8.3.1