Exemplo n.º 1
0
static void
test_txattrwalk (void)
{
    Npfcall *fc, *fc2;

    if (!(fc = np_create_txattrwalk(1, 2, "abc")))
        msg_exit ("out of memory");
    fc2 = _rcv_buf (fc, P9_TXATTRWALK,  __FUNCTION__);

    assert (fc->u.txattrwalk.fid == fc2->u.txattrwalk.fid);
    assert (fc->u.txattrwalk.attrfid == fc2->u.txattrwalk.attrfid);
    assert (np_str9cmp (&fc->u.txattrwalk.name, &fc2->u.txattrwalk.name) == 0);

    free (fc);
    free (fc2);
}
Exemplo n.º 2
0
Arquivo: xattr.c Projeto: 8l/diod
ssize_t
npc_xattrwalk (Npcfid *fid, Npcfid *attrfid, char *name)
{
	Npfcall *tc = NULL, *rc = NULL;
	ssize_t ret = -1;

	if (!(tc = np_create_txattrwalk (fid->fid, attrfid->fid, name))) {
		np_uerror (ENOMEM);
		goto done;
	}
	if (fid->fsys->rpc(fid->fsys, tc, &rc) < 0)
		goto done;
	ret = rc->u.rxattrwalk.size;
done:
	if (tc)
		free (tc);
	if (rc)
		free (rc);
	return ret;
}