OpenAFS Master Repository branch, master, updated. openafs-devel-1_5_76-2319-ge202822

Gerrit Code Review gerrit@openafs.org
Sun, 8 Apr 2012 18:14:50 -0700 (PDT)


The following commit has been merged in the master branch:
commit e202822b8efd7511f8652064cd8831c0a049dce6
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.
    
    Change-Id: I8b56f320c05c5d4270daf409d57514cbe8d076f5
    Reviewed-on: http://gerrit.openafs.org/7005
    Reviewed-by: Derrick Brashear <shadow@dementix.org>
    Tested-by: Derrick Brashear <shadow@dementix.org>

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

-- 
OpenAFS Master Repository