OpenAFS Master Repository branch, openafs-devel-1_7_x, updated. openafs-devel-1_7_9-8-gb3e2e07

Gerrit Code Review gerrit@openafs.org
Tue, 10 Apr 2012 07:42:25 -0700 (PDT)


The following commit has been merged in the openafs-devel-1_7_x branch:
commit b3e2e07ef0b7784f7184b1a6f86ebb452eeb8815
Author: Simon Wilkinson <sxw@your-file-system.com>
Date:   Thu Jan 5 10:51:06 2012 +0000

    rxgen: Tidy up server side freeing
    
    The way in which rxgen handles freeing of objects allocated by the RPC
    stub has evolved over the years. Originally, there appears to have been
    a "somefrees" parameter which was used to track whether objects required
    freeing or not. However, this parameter has fallen in to disuse, as
    support for typedefs and unions were added, and which parameters
    require freed is now tracked within the description structures
    themselves. So, get rid of somefrees, as it is now just confusing.
    
    The generated code to free a set of RPC arguments currently looks
    something like:
    
    fail:
            z_xdrs->x_op = XDR_FREE;
            if (!xdr_string(z_xdrs, &Name, AFSNAMEMAX)) goto fail1;
            if (!xdr_string(z_xdrs, &OfflineMsg, AFSOPAQUEMAX)) goto fail1;
            if (!xdr_string(z_xdrs, &Motd, AFSOPAQUEMAX)) goto fail1;
            if (rx_enable_stats) {
                rx_RecordCallStatistics(z_call, RXAFS_STATINDEX,
                    19, RXAFS_NO_OF_STAT_FUNCS, 0);
            }
    
            return z_result;
    fail1:
            if (rx_enable_stats) {
                rx_RecordCallStatistics(z_call, RXAFS_STATINDEX,
                    19, RXAFS_NO_OF_STAT_FUNCS, 0);
            }
    
            return RXGEN_SS_XDRFREE;
    
    Which isn't very efficient, or easy to modify. So, change the code
    generator to produce code that looks like:
    
    fail:
            z_xdrs->x_op = XDR_FREE;
            if ((!xdr_string(z_xdrs, &Name, AFSNAMEMAX))
                || (!xdr_string(z_xdrs, &OfflineMsg, AFSOPAQUEMAX))
                || (!xdr_string(z_xdrs, &Motd, AFSOPAQUEMAX)))
                    z_result = RXGEN_SS_XDRFREE;
    
            if (rx_enable_stats) {
                rx_RecordCallStatistics(z_call, RXAFS_STATINDEX,
                    19, RXAFS_NO_OF_STAT_FUNCS, 0);
            }
    
            return z_result;
    
    This does the same thing, but is easier to read and is more consistent
    with the way that we structure marshalling and unmarshalling.
    
    Reviewed-on: http://gerrit.openafs.org/7005
    Reviewed-by: Derrick Brashear <shadow@dementix.org>
    Tested-by: Derrick Brashear <shadow@dementix.org>
    (cherry picked from commit e202822b8efd7511f8652064cd8831c0a049dce6)
    
    Change-Id: I13699150f4adf9f46c2ae26fef5af7fd72aa3756
    Reviewed-on: http://gerrit.openafs.org/7156
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

 src/rxgen/rpc_parse.c |   97 +++++++++++++++++--------------------------------
 1 files changed, 33 insertions(+), 64 deletions(-)

-- 
OpenAFS Master Repository