mirror of
https://git.openafs.org/openafs.git
synced 2025-02-01 05:57:43 +00:00
STABLE14-fs-getfid-20060123
add a fs subcommand to get a fid (cherry picked from commit db98b697fe4e1b38ac5e73d60dd101b2506e12a4)
This commit is contained in:
parent
33589811b6
commit
6867198aa1
@ -69,7 +69,7 @@ static char tspace[1024];
|
||||
static struct ubik_client *uclient;
|
||||
|
||||
static int GetClientAddrsCmd(), SetClientAddrsCmd(), FlushMountCmd();
|
||||
static int RxStatProcCmd(), RxStatPeerCmd();
|
||||
static int RxStatProcCmd(), RxStatPeerCmd(), GetFidCmd();
|
||||
|
||||
extern char *hostutil_GetNameByINet();
|
||||
extern struct hostent *hostutil_GetHostByName();
|
||||
@ -3437,6 +3437,11 @@ defect 3069
|
||||
ts = cmd_CreateSyntax("setcbaddr", CallBackRxConnCmd, 0, "configure callback connection address");
|
||||
cmd_AddParm(ts, "-addr", CMD_SINGLE, CMD_OPTIONAL, "host name or address");
|
||||
|
||||
/* try to find volume location information */
|
||||
ts = cmd_CreateSyntax("getfid", GetFidCmd, 0,
|
||||
"get fid for file(s)");
|
||||
cmd_AddParm(ts, "-path", CMD_LIST, CMD_OPTIONAL, "dir/file path");
|
||||
|
||||
code = cmd_Dispatch(argc, argv);
|
||||
if (rxInitDone)
|
||||
rx_Finalize();
|
||||
@ -3794,3 +3799,25 @@ RxStatPeerCmd(struct cmd_syndesc *as, char *arock)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
GetFidCmd(struct cmd_syndesc *as, char *arock)
|
||||
{
|
||||
struct ViceIoctl blob;
|
||||
struct cmd_item *ti;
|
||||
for (ti = as->parms[0].items; ti; ti = ti->next) {
|
||||
struct VenusFid vfid;
|
||||
|
||||
blob.out_size = sizeof(struct VenusFid);
|
||||
blob.out = (char *) &vfid;
|
||||
blob.in_size = 0;
|
||||
|
||||
if (0 == pioctl(ti->data, VIOCGETFID, &blob, 1)) {
|
||||
printf("File %s (%u.%u.%u) contained in volume %u\n",
|
||||
ti->data, vfid.Fid.Volume, vfid.Fid.Vnode, vfid.Fid.Unique,
|
||||
vfid.Fid.Volume);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user