1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2000-2001 Silicon Graphics, Inc.
7 /* Given an object's handle, print the filesystem handle. */
13 /*---------------------------------------------------------------------------
15 Test program used to test dm_handle_to_fshandle(). The command line is:
17 handle_to_fshandle handle
19 where handle is an object's handle.
21 ----------------------------------------------------------------------------*/
30 fprintf(stderr, "usage:\t%s handle\n", Progname);
47 Progname = strrchr(argv[0], '/');
58 (void)dm_init_service(&name);
60 if ((error = atohan(han_str, &hanp, &hlen)) != 0) {
61 fprintf(stderr, "atohan() failed, %s\n", strerror(error));
65 if (dm_handle_to_fshandle(hanp, hlen, &fshanp, &fshlen) != 0) {
66 fprintf(stderr, "dm_handle_to_fshandle failed, %s\n",
70 hantoa(fshanp, fshlen, buffer);
71 fprintf(stdout, "%s\n", buffer);
73 dm_handle_free(hanp, hlen);
74 dm_handle_free(fshanp, fshlen);