[OpenAFS-devel] Proposal for capabilities support in Unix client 1.4.x

Jeffrey Altman jaltman@secure-endpoints.com
Wed, 17 Jun 2009 09:29:02 -0400


Felix Frank wrote:

> The way I'm currently freeing Capabilities as allocated by the client
> stub strikes me as (while conceptionally sound) spectacularly wrong -
> how is this supposed to be done?
> For a simple case as this (one lone pointer that needs freeing),
> osi_free() appears to be the most sensible thing to use after all, as
> that is what xdr ultimately does.

Frank:

Call xdr_free() to deallocate memory allocated by the XDR package.

  xdr_free(caps, j * sizeof(Capabilities));

As for the afs_setTime piece.  As you and Simon discussed, there is only
one host 'afs_setTimeHost' whose time is used to set the local time.
I believe it is a waste of effort to call GetTime on every host.  You
just need to make sure that GetTime is called on 'afs_setTimeHost' if
'afs_setTimeHost' is non-NULL or at least one of the servers such that
afs_IsPrimaryCell(sa->server->cell) is TRUE.

Jeffrey Altman