Changeset 9422

Show
Ignore:
Timestamp:
07/31/12 11:07:59 (10 months ago)
Author:
batkinson
Message:

Added gossip_debug to non-critical errors.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/next0/src/common/sidcache/sidcache.c

    r9420 r9422  
    66 
    77#include "sidcache.h" 
     8#include "pvfs2-debug.h" 
    89#include "gossip.h" 
    9 #include "pvfs2-debug.h" 
    1010 
    1111/* Length of string representation of uuid_t */ 
     
    213213        if(j == SID_NUM_ATTR) 
    214214        { 
    215             gossip_err("Attribute: %s is an invalid attribute, and it will not be added\n", attrs_strings[i]); 
     215            gossip_debug(GOSSIP_SIDCACHE_DEBUG, "Attribute: %s is an invalid attribute, \ 
     216                         and it will not be added\n", attrs_strings[i]); 
    216217            attr_positions[i] = -1; 
    217218            valid_attrs_in_file--; 
     
    300301        /* Getting the sid's uuid string representation from the input file */ 
    301302        fscanf(inpfile, "%s", tmp_sid_str); 
    302         //uuid_clear(current_sid); 
     303 
    303304        ret = uuid_parse(tmp_sid_str, current_sid); 
    304305        if(ret) 
    305306        { 
    306             gossip_err("Error parsing uuid in SID_load_cache_from_file function\n"); 
     307            /* Skips adding sid to sid cache */ 
     308            goto bad_sid; 
    307309        } 
    308310 
     
    323325 
    324326        SID_clean_up_SID_cacheval_t(&current_sid_cacheval); 
     327 
     328        bad_sid: 
     329            gossip_debug(GOSSIP_SIDCACHE_DEBUG, "Error parsing uuid in SID_load_cache_from_file function\n"); 
    325330    } 
    326331    
     
    405410    if(ret) 
    406411    { 
    407         gossip_err("Error getting sid from sid cache : %s\n", db_strerror(ret)); 
     412        gossip_debug(GOSSIP_SIDCACHE_DEBUG, "Error getting sid from sid cache : %s\n", db_strerror(ret)); 
    408413        return(ret); 
    409414    } 
     
    435440    if (ret) 
    436441    { 
    437         gossip_err("Error retrieving from sid cache\n"); 
     442        gossip_debug(GOSSIP_SIDCACHE_DEBUG, "Error retrieving from sid cache\n"); 
    438443        return ret; 
    439444    } 
     
    494499    if(new_attrs == NULL) 
    495500    { 
    496         gossip_err("The new attributes passed to SID_update_sid_in_sid_cache is NULL\n"); 
     501        gossip_debug(GOSSIP_SIDCACHE_DEBUG, "The new attributes passed to SID_update_sid_in_sid_cache is NULL\n"); 
    497502        return(-1); 
    498503    } 
     
    678683    if(!new_url) 
    679684    { 
    680         gossip_err("The url passed into SID_update_url_in_sid function is currently NULL\n"); 
     685        gossip_debug(GOSSIP_SIDCACHE_DEBUG, "The url passed into SID_update_url_in_sid function is currently NULL\n"); 
    681686        return(-1); 
    682687    } 
     
    791796    if(ret) 
    792797    { 
    793         gossip_err("Error deleting record from sid cache : %s\n", db_strerror(ret)); 
     798        gossip_debug(GOSSIP_SIDCACHE_DEBUG, "Error deleting record from sid cache : %s\n", db_strerror(ret)); 
    794799        return(ret); 
    795800    } 
     
    991996    if(ret) 
    992997    { 
    993         gossip_err("Error occurred when closing cursor in SID_dump_sid_cache function: %s\n", db_strerror(ret)); 
     998        gossip_debug(GOSSIP_SIDCACHE_DEBUG, "Error occurred when closing cursor in SID_dump_sid_cache function: %s\n", db_strerror(ret)); 
    994999        return(ret); 
    9951000    } 
     
    10241029    if (BULK_MIN_SIZE > (size_of_retrieve_kb * KILOBYTE) + (size_of_retrieve_mb * MEGABYTE)) 
    10251030    { 
    1026         gossip_err("Size of bulk retrieve buffer must be greater than 8 KB\n"); 
     1031        gossip_debug(GOSSIP_SIDCACHE_DEBUG, "Size of bulk retrieve buffer must be greater than 8 KB\n"); 
    10271032        return (-1); 
    10281033    } 
     
    10411046    if (output->data == NULL) 
    10421047    { 
    1043         gossip_err("Error sizing buffer\n"); 
     1048        gossip_debug(GOSSIP_SIDCACHE_DEBUG, "Error sizing buffer\n"); 
    10441049        return (-1); 
    10451050    } 
     
    10511056    if ((ret = dbp->cursor(dbp, NULL, dbcursorp, DB_CURSOR_BULK)) != 0) { 
    10521057        free(output->data); 
    1053         gossip_err("Error creating bulk cursor\n"); 
     1058        gossip_debug(GOSSIP_SIDCACHE_DEBUG, "Error creating bulk cursor\n"); 
    10541059        return (ret); 
    10551060    } 
     
    11121117        if (opaque_p == NULL) 
    11131118        { 
    1114             gossip_err("Error cannot fit into write buffer\n"); 
     1119            gossip_debug(GOSSIP_SIDCACHE_DEBUG, "Error cannot fit into write buffer\n"); 
    11151120            break; 
    11161121        } 
     
    11621167{ 
    11631168    int ret = 0; 
    1164  
    1165     /* Setting the global bulk next key to zero */ 
    1166     SID_zero_dbt(&bulk_next_key, NULL, NULL); 
    11671169 
    11681170    /* Setting the opening environement flags */ 
     
    12241226    u_int32_t flags = DB_CREATE; /* Database open flags. Creates the database if 
    12251227                                    it does not already exist */ 
     1228 
     1229    /* Setting the global bulk next key to zero */ 
     1230    SID_zero_dbt(&bulk_next_key, NULL, NULL); 
    12261231 
    12271232    ret = db_create(dbp,   /* Primary database pointer */ 
     
    14021407            if(ret) 
    14031408            { 
    1404                 gossip_err("Error closing cursor :  %s\n", db_strerror(ret)); 
     1409                gossip_debug(GOSSIP_SIDCACHE_DEBUG, "Error closing cursor :  %s\n", db_strerror(ret)); 
    14051410                return(ret); 
    14061411            } 
     
    14361441            if(ret) 
    14371442            { 
    1438                 gossip_err("Error closing attribute database : %s\n", db_strerror(ret)); 
     1443                gossip_debug(GOSSIP_SIDCACHE_DEBUG, "Error closing attribute database : %s\n", db_strerror(ret)); 
    14391444                return(ret); 
    14401445            } 
     
    14521457     if(ret) 
    14531458    { 
    1454         gossip_err("Error closing primary database : %s\n", db_strerror(ret)); 
     1459        gossip_debug(GOSSIP_SIDCACHE_DEBUG, "Error closing primary database : %s\n", db_strerror(ret)); 
    14551460        return(ret); 
    14561461    } 
     
    14661471    if(ret) 
    14671472    { 
    1468         gossip_err("Error closing environment :  %s\n", db_strerror(ret)); 
     1473        gossip_debug(GOSSIP_SIDCACHE_DEBUG, "Error closing environment :  %s\n", db_strerror(ret)); 
    14691474        return(ret); 
    14701475    }