Show
Ignore:
Timestamp:
09/03/09 17:24:49 (4 years ago)
Author:
bligon
Message:

Merge of Orange-Branch, Orange-FailOver?-Becky, and version 1.164 of sys-io.sm (do not unstuff on a read).
This version of Orange-FailOver?-Becky supports failover for large files only. The next iteration will
support small-io failover.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/Orange-Branch/src/proto/pvfs2-attr.h

    r7593 r7968  
    3636 
    3737/* internal attribute masks for metadata objects */ 
    38 #define PVFS_ATTR_META_DIST    (1 << 10) 
    39 #define PVFS_ATTR_META_DFILES  (1 << 11) 
     38#define PVFS_ATTR_META_DIST          (1 << 10) 
     39#define PVFS_ATTR_META_DFILES        (1 << 11) 
     40#define PVFS_ATTR_META_MIRROR_DFILES (1 << 13) 
    4041#define PVFS_ATTR_META_ALL \ 
    41 (PVFS_ATTR_META_DIST | PVFS_ATTR_META_DFILES) 
     42(PVFS_ATTR_META_DIST | PVFS_ATTR_META_DFILES | PVFS_ATTR_META_MIRROR_DFILES) 
    4243 
    4344#define PVFS_ATTR_META_UNSTUFFED (1 << 12) 
     45 
    4446 
    4547/* internal attribute masks for datafile objects */ 
     
    5961/* attributes that do not change once set */ 
    6062#define PVFS_STATIC_ATTR_MASK \ 
    61 (PVFS_ATTR_COMMON_TYPE|PVFS_ATTR_META_DIST|PVFS_ATTR_META_DFILES|PVFS_ATTR_META_UNSTUFFED) 
     63(PVFS_ATTR_COMMON_TYPE|PVFS_ATTR_META_DIST|PVFS_ATTR_META_DFILES|PVFS_ATTR_META_MIRROR_DFILES|PVFS_ATTR_META_UNSTUFFED) 
    6264 
    6365/* extended hint attributes for a metafile object */ 
     
    8385    uint32_t dfile_count; 
    8486 
     87    /* list of mirrored datafiles */ 
     88    PVFS_handle *mirror_dfile_array; 
     89    uint32_t mirror_copies_count; 
     90 
    8591    int32_t stuffed_size; 
    8692 
     
    96102    (x)->dist_size = PINT_DIST_PACK_SIZE((x)->dist); \ 
    97103} while (0) 
    98 #define encode_PVFS_metafile_attr_dfiles(pptr,x) do { int dfiles_i; \ 
    99     encode_uint32_t(pptr, &(x)->dfile_count); \ 
    100     encode_skip4(pptr,); \ 
    101     for (dfiles_i=0; dfiles_i<(x)->dfile_count; dfiles_i++) \ 
    102         encode_PVFS_handle(pptr, &(x)->dfile_array[dfiles_i]); \ 
    103     encode_PVFS_metafile_hint(pptr, &(x)->hint); \ 
    104 } while (0) 
    105 #define decode_PVFS_metafile_attr_dfiles(pptr,x) do { int dfiles_i; \ 
    106     decode_uint32_t(pptr, &(x)->dfile_count); \ 
    107     decode_skip4(pptr,); \ 
    108     (x)->dfile_array = decode_malloc((x)->dfile_count \ 
    109       * sizeof(*(x)->dfile_array)); \ 
    110     for (dfiles_i=0; dfiles_i<(x)->dfile_count; dfiles_i++) \ 
    111         decode_PVFS_handle(pptr, &(x)->dfile_array[dfiles_i]); \ 
    112     decode_PVFS_metafile_hint(pptr, &(x)->hint); \ 
     104#define encode_PVFS_metafile_attr_mirror_dfiles(pptr,x) do {            \ 
     105  int dfiles_i, copy_i, handle_i;                                       \ 
     106  encode_uint32_t(pptr, &(x)->mirror_copies_count);                     \ 
     107  encode_skip4(pptr,);                                                  \ 
     108  for (copy_i=0; copy_i<(x)->mirror_copies_count; copy_i++)             \ 
     109    for (dfiles_i=0; dfiles_i<(x)->dfile_count; dfiles_i++)             \ 
     110    {                                                                   \ 
     111       handle_i = (copy_i * (x)->dfile_count) + dfiles_i;               \ 
     112       encode_PVFS_handle(pptr, &(x)->mirror_dfile_array[handle_i]);    \ 
     113    }                                                                   \ 
     114} while (0) 
     115#define decode_PVFS_metafile_attr_mirror_dfiles(pptr,x) do {            \ 
     116  int dfiles_i, copy_i, handle_i;                                       \ 
     117  decode_uint32_t(pptr, &(x)->mirror_copies_count);                     \ 
     118  decode_skip4(pptr,);                                                  \ 
     119  (x)->mirror_dfile_array = decode_malloc((x)->dfile_count         *    \ 
     120                                          (x)->mirror_copies_count *    \ 
     121                                          sizeof(PVFS_handle));         \ 
     122  for (copy_i=0; copy_i<(x)->mirror_copies_count; copy_i++)             \ 
     123    for (dfiles_i=0; dfiles_i<(x)->dfile_count; dfiles_i++)             \ 
     124    {                                                                   \ 
     125       handle_i = (copy_i * (x)->dfile_count) + dfiles_i;               \ 
     126       decode_PVFS_handle(pptr, &(x)->mirror_dfile_array[handle_i]);    \ 
     127    }                                                                   \ 
     128} while (0) 
     129#define encode_PVFS_metafile_attr_dfiles(pptr,x) do {                   \ 
     130    int dfiles_i;                                                       \ 
     131    encode_uint32_t(pptr, &(x)->dfile_count);                           \ 
     132    encode_skip4(pptr,);                                                \ 
     133    for (dfiles_i=0; dfiles_i<(x)->dfile_count; dfiles_i++)             \ 
     134        encode_PVFS_handle(pptr, &(x)->dfile_array[dfiles_i]);          \ 
     135    encode_PVFS_metafile_hint(pptr, &(x)->hint);                        \ 
     136} while (0) 
     137#define decode_PVFS_metafile_attr_dfiles(pptr,x) do {                     \ 
     138    int dfiles_i;                                                         \ 
     139    decode_uint32_t(pptr, &(x)->dfile_count);                             \ 
     140    decode_skip4(pptr,);                                                  \ 
     141    (x)->dfile_array = decode_malloc((x)->dfile_count                     \ 
     142      * sizeof(*(x)->dfile_array));                                       \ 
     143    for (dfiles_i=0; dfiles_i<(x)->dfile_count; dfiles_i++)               \ 
     144        decode_PVFS_handle(pptr, &(x)->dfile_array[dfiles_i]);            \ 
     145    decode_PVFS_metafile_hint(pptr, &(x)->hint);                          \ 
    113146} while (0) 
    114147#endif 
     
    221254    if ((x)->mask & PVFS_ATTR_META_DFILES) \ 
    222255        encode_PVFS_metafile_attr_dfiles(pptr, &(x)->u.meta); \ 
     256    if ((x)->mask & PVFS_ATTR_META_MIRROR_DFILES) \ 
     257        encode_PVFS_metafile_attr_mirror_dfiles(pptr, &(x)->u.meta); \ 
    223258    if ((x)->mask & PVFS_ATTR_DATA_SIZE) \ 
    224259        encode_PVFS_datafile_attr(pptr, &(x)->u.data); \ 
    225260    if ((x)->mask & PVFS_ATTR_SYMLNK_TARGET) \ 
    226261        encode_PVFS_symlink_attr(pptr, &(x)->u.sym); \ 
    227     if (((x)->mask & PVFS_ATTR_DIR_DIRENT_COUNT) || ((x)->mask & PVFS_ATTR_DIR_HINT)) \ 
     262    if (((x)->mask & PVFS_ATTR_DIR_DIRENT_COUNT) || \ 
     263        ((x)->mask & PVFS_ATTR_DIR_HINT)) \ 
    228264        encode_PVFS_directory_attr(pptr, &(x)->u.dir); \ 
    229265} while (0) 
     
    248284    if ((x)->mask & PVFS_ATTR_META_DFILES) \ 
    249285        decode_PVFS_metafile_attr_dfiles(pptr, &(x)->u.meta); \ 
     286    if ((x)->mask & PVFS_ATTR_META_MIRROR_DFILES) \ 
     287        decode_PVFS_metafile_attr_mirror_dfiles(pptr, &(x)->u.meta); \ 
    250288    if ((x)->mask & PVFS_ATTR_DATA_SIZE) \ 
    251289        decode_PVFS_datafile_attr(pptr, &(x)->u.data); \ 
    252290    if ((x)->mask & PVFS_ATTR_SYMLNK_TARGET) \ 
    253291        decode_PVFS_symlink_attr(pptr, &(x)->u.sym); \ 
    254     if (((x)->mask & PVFS_ATTR_DIR_DIRENT_COUNT) || ((x)->mask & PVFS_ATTR_DIR_HINT)) \ 
     292    if (((x)->mask & PVFS_ATTR_DIR_DIRENT_COUNT) || \ 
     293        ((x)->mask & PVFS_ATTR_DIR_HINT)) \ 
    255294        decode_PVFS_directory_attr(pptr, &(x)->u.dir); \ 
    256295} while (0) 
    257296#endif 
    258 /* attr buffer needs room for larger of symlink path, meta fields or dir hints: an attrib 
    259  * structure can never hold information for not more than a symlink or a metafile or a dir object */ 
     297/* attr buffer needs room for larger of symlink path, meta fields or  
     298 * dir hints: an attrib structure can never hold information for not more  
     299 * than a symlink or a metafile or a dir object  
     300*/ 
    260301#define extra_size_PVFS_object_attr_dir  (PVFS_REQ_LIMIT_DIST_BYTES + \ 
    261302  PVFS_REQ_LIMIT_DIST_NAME + roundup8(sizeof(PVFS_directory_attr))) 
    262303 
    263 /* room for distribution, stuffed_size, and dfile array */ 
     304/* room for distribution, stuffed_size, dfile array, and mirror_dfile_array */ 
    264305#define extra_size_PVFS_object_attr_meta (PVFS_REQ_LIMIT_DIST_BYTES + \ 
    265   sizeof(int32_t) + \ 
    266   PVFS_REQ_LIMIT_DFILE_COUNT * sizeof(PVFS_handle))  
     306  sizeof(int32_t) +                                                   \ 
     307  (PVFS_REQ_LIMIT_DFILE_COUNT * sizeof(PVFS_handle)) +                \ 
     308  (PVFS_REQ_LIMIT_MIRROR_DFILE_COUNT * sizeof(PVFS_handle)))  
    267309 
    268310#define extra_size_PVFS_object_attr_symlink (PVFS_REQ_LIMIT_PATH_NAME_BYTES)