[OpenAFS-devel] afs_syscall_pioctl
Nickolai Zeldovich
kolya@MIT.EDU
Tue, 12 Nov 2002 17:11:31 -0500
> I'm looking at afs_syscall_pioctl and I can't figure out how it could
> possibly work, except by accident. I think all calls to afs_HandlePioctl
> require a VTOAFS() on the first arg. That's what the old Transarc code did.
It looks like you're absolutely correct -- we should call VTOAFS() on
the first arg of afs_HandlePioctl. However, it's pretty simple to see
why it worked all this time:
#define VTOAFS(V) ((struct vcache *)(V))
which is #ifndef AFS_OBSD_ENV. I looked back over various versions of
Transarc AFS from 3.1b to 3.6p1, and didn't find any version that called
VTOAFS() or equivalent in afs_syscall_pioctl. They did have a special
case for Ultrix, as far back as 3.1b, where they called afs_gntovn()
beforehand. But the VTOAFS() macro was only added in OpenAFS (in delta
convert-vcache-casts-to-macros-20020325), which explains why it's not
used everywhere it should be.
-- kolya