[OpenAFS-devel] @sys as list patch in CVS

Ted McCabe ted@MIT.EDU
Tue, 5 Jun 2001 12:08:45 -0400


At 11:37 AM -0400 6/5/01, Derek Atkins wrote:
>How does one insert the list into the kernel?
>
>-derek

Using the same pioctl as before.  The new interpretation of the data 
passed is consistent with the old, so the changed pioctl is fully 
backward compatible.  To illustrate:

Passing data (old-way) uses the format of:
first sizeof(afs_int32) bytes: non-zero indicates there's a sysname 
following, zero sent to pioctl indicates pioctl outputs the sysname.
remaining bytes: a null terminated string.

The old code always used the first number as a boolean, setting it 1 
or 0, and checking non-zero vs 0.  So modifying to support lists was 
relatively easy as follows:

Passing data (new-way) uses a format of:
first sizeof(afs_int32) bytes: count of sysnames to be set, zero to 
output the list
remaining bytes: multiple null terminated strings, stored consecutively.

    --Ted