opr: Add opr_containerof
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 22 Oct 2011 08:45:10 +0000 (09:45 +0100)
committerDerrick Brashear <shadow@dementix.org>
Sat, 12 Nov 2011 14:46:52 +0000 (06:46 -0800)
commit1a056d24a79242db09963dd0b0c2193c5034b61b
tree670014108e29cade8a01f9537e1fa0db48c97519
parentb15b4b15822bee87720bb0d78c2ce54051180339
opr: Add opr_containerof

Add the opr_containerof macro, which can be used to find the base
address of a structure which contains a member whose location is known.

This formulation is heavily used throughout OpenAFS to determine the
base address of structures containing queue pointers - this provides
a central definition, rather than coding it from scratch each time.

Change-Id: I2a32a214252ad304238f740ad92579e5bb7287be
Reviewed-on: http://gerrit.openafs.org/5836
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/opr/opr.h