Date: Wed, 14 Jun 2017 01:57:21 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r319926 - projects/pnfs-planb-server/usr.bin/pnfsdsfile Message-ID: <201706140157.v5E1vL5b008051@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Wed Jun 14 01:57:21 2017 New Revision: 319926 URL: https://svnweb.freebsd.org/changeset/base/319926 Log: Fix pnfsdsfile so that it uses the filename now in the extended attribute. Modified: projects/pnfs-planb-server/usr.bin/pnfsdsfile/pnfsdsfile.c Modified: projects/pnfs-planb-server/usr.bin/pnfsdsfile/pnfsdsfile.c ============================================================================== --- projects/pnfs-planb-server/usr.bin/pnfsdsfile/pnfsdsfile.c Wed Jun 14 00:40:33 2017 (r319925) +++ projects/pnfs-planb-server/usr.bin/pnfsdsfile/pnfsdsfile.c Wed Jun 14 01:57:21 2017 (r319926) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include <fs/nfs/nfsrvstate.h> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706140157.v5E1vL5b008051>