Skip to content
  • Lai Siyao's avatar
    LU-11025 dne: support directory restripe · 2e2b16c2
    Lai Siyao authored
    
    
    This patch adds directory restripe support:
    * 'lfs setdirstripe -m -1 -c <stripe_count>' on an existed directory
      will change this directory layout, if 'stripe_count' is larger than
      current count, new stripes are allocated after current stripes,
      otherwise merge stripes of this directory, NB, if stripe count is
      unchanged, but hash type changed, it's treated as merging, but
      rehashing actually.
    * mdt_restripe() ia added to restripe directory.
    * mdd_dir_declare_layout_split() is added to split directory, which
      handles both plain and striped directory split.
    * lod_dir_declare_layout_split() will handle the internal of directory
      split.
    * directory merge is simple compared to split, which just records
      target stripe count in LMV, and update it.
    
    NB. this patch only restripe directory, but doesn't add the code to
    migrate sub files, which will be implemented in the following patch.
    
    Signed-off-by: default avatarLai Siyao <lai.siyao@whamcloud.com>
    Change-Id: I526f7423b909eb83cf8723e65981d713b3e42499
    Reviewed-on: https://review.whamcloud.com/36898
    Tested-by: default avatarjenkins <devops@whamcloud.com>
    Tested-by: default avatarMaloo <maloo@whamcloud.com>
    Reviewed-by: default avatarAndreas Dilger <adilger@whamcloud.com>
    Reviewed-by: default avatarHongchao Zhang <hongchao@whamcloud.com>
    Reviewed-by: default avatarYingjin Qian <qian@ddn.com>
    Reviewed-by: default avatarOleg Drokin <green@whamcloud.com>
    2e2b16c2