From owner-svn-src-projects@freebsd.org Wed Jun 14 01:59:42 2017 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F25DC771A0 for ; Wed, 14 Jun 2017 01:59:42 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F47074906; Wed, 14 Jun 2017 01:59:42 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5E1xfcf008326; Wed, 14 Jun 2017 01:59:41 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5E1xfBQ008325; Wed, 14 Jun 2017 01:59:41 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201706140159.v5E1xfBQ008325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 14 Jun 2017 01:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r319927 - projects/pnfs-planb-server-stable11/usr.bin/pnfsdsfile X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jun 2017 01:59:42 -0000 Author: rmacklem Date: Wed Jun 14 01:59:41 2017 New Revision: 319927 URL: https://svnweb.freebsd.org/changeset/base/319927 Log: Fix pnfsdsfile to use the file name now in the extended attribute. Modified: projects/pnfs-planb-server-stable11/usr.bin/pnfsdsfile/pnfsdsfile.c Modified: projects/pnfs-planb-server-stable11/usr.bin/pnfsdsfile/pnfsdsfile.c ============================================================================== --- projects/pnfs-planb-server-stable11/usr.bin/pnfsdsfile/pnfsdsfile.c Wed Jun 14 01:57:21 2017 (r319926) +++ projects/pnfs-planb-server-stable11/usr.bin/pnfsdsfile/pnfsdsfile.c Wed Jun 14 01:59:41 2017 (r319927) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include static void usage(void); -static void nfsrv_putfhname(fhandle_t *fhp, char *bufp); /* * This program displays the location information of a data storage file @@ -51,22 +50,13 @@ static void nfsrv_putfhname(fhandle_t *fhp, char *bufp int main(int argc, char *argv[]) { - fhandle_t fh; - char buf[sizeof(fh) * 2 + 1], hostn[NI_MAXHOST + 1]; + char hostn[NI_MAXHOST + 1]; struct pnfsdsfile dsfile; if (argc != 2) usage(); /* - * The file's name is a hexadecimal representation of the MetaData - * Server's file handle. - */ - if (getfh(argv[1], &fh) < 0) - err(1, "Getfh of %s failed", argv[1]); - nfsrv_putfhname(&fh, buf); - - /* * The host address and directory where the data storage file is * located is in the extended attribute "pnfsd.dsfile". */ @@ -79,21 +69,7 @@ main(int argc, char *argv[]) dsfile.dsf_sin.sin_len, hostn, sizeof(hostn), NULL, 0, 0) < 0) err(1, "Can't get hostname\n"); - printf("%s\tds%d/%s\n", hostn, dsfile.dsf_dir, buf); -} - -/* - * Generate a file name based on the file handle and put it in *bufp. - */ -static void -nfsrv_putfhname(fhandle_t *fhp, char *bufp) -{ - int i; - uint8_t *cp; - - cp = (uint8_t *)fhp; - for (i = 0; i < sizeof(*fhp); i++) - sprintf(&bufp[2 * i], "%02x", *cp++); + printf("%s\tds%d/%s\n", hostn, dsfile.dsf_dir, dsfile.dsf_filename); } static void