mountd: Add lookup_export_parent()
authorChuck Lever <chuck.lever@oracle.com>
Fri, 19 Oct 2012 14:29:28 +0000 (10:29 -0400)
committerSteve Dickson <steved@redhat.com>
Mon, 22 Oct 2012 13:44:02 +0000 (09:44 -0400)
commit88f0f36abfa9abd6d4a9994fef19ee95c89c5c2f
tree706b92053f1ec6d40ced6839824705ee375edfdd
parentfb62e4dcce82cd46e9129d8325fff3e0640941e9
mountd: Add lookup_export_parent()

In a moment I will be adding some logic that needs to know an
junction's parent export.

Here's a function that can discover an export's parent.  It takes
the target export's pathname, chops off the rightmost component, and
tries a lookup_export().  If that succeeds, we have our answer.
If not, it chops off the next rightmost component and tries again,
until the root is reached.

At the same time, infrastructure is added to pass the parent export
down into the functions that convert locations into a new junction
export entry.  For now the parent export remains unused.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
utils/mountd/cache.c