Changeset 8557

Show
Ignore:
Timestamp:
10/11/10 18:50:58 (3 years ago)
Author:
shuangy
Message:

in lookup, compare server names to decide local or remote instead of rely on dist_dir_attr.server_no.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/Orange-Elaine-Distr-Dir-Branch/src/server/lookup.sm

    r8549 r8557  
    707707    struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); 
    708708    PVFS_dist_dir_hash_type dirdata_hash; 
     709    server_configuration_s *config = get_server_config_struct(); 
     710    char dirdata_server_name[1024]; 
    709711 
    710712    /* Need to see if directory entry is on this server. If not prepare 
     
    728730        s_op->u.lookup.segp, (int) strlen(s_op->u.lookup.segp)); 
    729731 
    730     if (s_op->u.lookup.dirdata_server_index == 
    731         s_op->u.lookup.attr.u.dir.dist_dir_attr.server_no) 
    732     { 
     732    /* find the server name of the dirdata handle */ 
     733    PINT_cached_config_get_server_name(dirdata_server_name, 1024,  
     734            s_op->u.lookup.attr.u.dir.dirdata_handles[s_op->u.lookup.dirdata_server_index],  
     735            s_op->req->u.lookup_path.fs_id); 
     736 
     737    if ( !strcmp(dirdata_server_name, config->host_id) ) 
     738    { 
     739        gossip_debug(GOSSIP_SERVER_DEBUG, 
     740                "lookup: local server !!!\n"); 
    733741        js_p->error_code = LOCAL_DIRENT; 
    734742    } 
    735743    else 
    736744    { 
     745        gossip_debug(GOSSIP_SERVER_DEBUG, 
     746                "lookup: remote server !!!\n"); 
    737747        js_p->error_code = REMOTE_DIRENT; 
    738748    }