Frank Filz has uploaded this change for review.

View Change

EXPORT:  Cleanup iniital refcounting and alloc/free of exports

Make alloc_export() return a reference. In all case, put_gsh_export can
safely be used to dispose of this reference and cause the export to be
ultimately freed.

With that, insert_gsh_export only adds the sentinel reference.

Move the init_op_context_simple in build_default_root to once the
export is as set up as much as if it was being built by the config
parser.

Since there is no longer a reason to explicitly call free_export just
pull the code into _put_gsh_export.

Also make sure that free_export_resources sets up an op context if
the export being released is not the one in op_ctx. Since that export
is already on it's way to death, just remove the export from the
op context which will have the effect of release_op_context for
a temporary op context NOT calling put_gsh_export in the future - it
doesn't need to since the refcount is already 0. This also assures that
if releasing the final refcount on the export in op_ctx, that op_ctx
is now poisoned.

Change-Id: I0dcbbc4a138b0c673d1ac14f89c1a63ba832d06b
Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
---
M src/include/export_mgr.h
M src/support/export_mgr.c
M src/support/exports.c
3 files changed, 55 insertions(+), 56 deletions(-)

git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/04/491404/1

To view, visit change 491404. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: I0dcbbc4a138b0c673d1ac14f89c1a63ba832d06b
Gerrit-Change-Number: 491404
Gerrit-PatchSet: 1
Gerrit-Owner: Frank Filz <ffilzlnx@mindspring.com>
Gerrit-MessageType: newchange