Show
Ignore:
Timestamp:
08/26/10 19:46:51 (3 years ago)
Author:
shuangy
Message:

1. add dist-dir-struct to root handle and lost+found handle
2. add dirdata bucket selection to several state machines, however, sys-rename and sys-readdir are not finished yet. There might be other state machines missing.
3. compilable, not expect to run correctly yet.
4. more to change.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/Orange-Elaine-Distr-Dir-Branch/src/client/sysint/mgmt-remove-dirent.sm

    r8480 r8483  
    2626#include "PINT-reqproto-encode.h" 
    2727#include "pvfs2-internal.h" 
     28#include "dist-dir-utils.h" 
    2829 
    2930extern job_context_id pint_client_sm_context; 
     
    183184    int ret = -PVFS_EINVAL; 
    184185    PINT_sm_msgpair_state *msg_p = NULL; 
     186    PVFS_dist_dir_hash_type dirdata_hash; 
     187    int dirdata_server_index; 
    185188 
    186189    js_p->error_code = 0; 
     190 
     191    /* find the hash value and the dist dir bucket */ 
     192    dirdata_hash = PINT_encrypt_dirdata(sm_p->u.mgmt_remove_dirent.entry); 
     193    gossip_debug(GOSSIP_REMOVE_DEBUG, " encrypt dirent %s into hash value %llu.\n", 
     194            sm_p->u.mgmt_remove_dirent.entry, 
     195            llu(dirdata_hash)); 
     196 
     197    dirdata_server_index =  
     198        PINT_find_dist_dir_bucket(dirdata_hash, 
     199            &sm_p->getattr.attr.u.dir.dist_dir_attr, 
     200            sm_p->getattr.attr.u.dir.dist_dir_bitmap); 
     201    gossip_debug(GOSSIP_REMOVE_DEBUG, " selecting bucket No.%d from dist_dir_bitmap.\n", 
     202            dirdata_server_index); 
     203 
    187204 
    188205    PINT_msgpair_init(&sm_p->msgarray_op); 
    189206    msg_p = &sm_p->msgarray_op.msgpair; 
    190207 
    191     /* TODO: Need to find the correct dirent_handle */ 
    192208    /* TODO: Need to call PINT_free_object_attr? */ 
    193209     PINT_SERVREQ_MGMT_REMOVE_DIRENT_FILL( 
     
    196212        sm_p->parent_ref.fs_id, 
    197213        sm_p->parent_ref.handle, 
    198         sm_p->getattr.attr.u.dir.dirdata_handles[0], 
     214        sm_p->getattr.attr.u.dir.dirdata_handles[dirdata_server_index], 
    199215        sm_p->u.mgmt_remove_dirent.entry, 
    200216        sm_p->hints);