Whamcloud - gitweb
LU-11025 dne: change dir layout via dt_layout_change 34/37634/5
authorLai Siyao <lai.siyao@whamcloud.com>
Fri, 14 Feb 2020 09:37:58 +0000 (17:37 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 31 Mar 2020 06:59:09 +0000 (06:59 +0000)
commitb2eef3dd2f042b629b8bb25dc963ad5c7da86f22
tree01cc5c425b7ebd034a27c8b0df2416ea4f70c19d
parent0a1cf8da806962d663f23ed813764e4011a36ee7
LU-11025 dne: change dir layout via dt_layout_change

This patch includes following changes:

* Use existing mo_layout_change()/dt_layout_change() interface to
  change directory layout, which is cleaner and easier to add new
  features. The supported layout change operations are:
  1. MD_LAYOUT_DETACH: detach stripes from directory master object.
  2. MD_LAYOUT_ATTACH: attach stripes after target's.
  3. MD_LAYOUT_SHRINK: destroy stripes from specific offset.

* Previously layout change is done in MDD layer if striped directory
  is remote, however LOD can handle remote striped directory the same
  as local one, NB, remember to initialize index operations before
  altering directory layout. In this way layer violation can be
  avoided.

* Use setxattr(XATTR_NAME_LMV, LU_XATTR_CREATE) to create stripes
  for directories, and '0' or 'LU_XATTR_REPLACE' to set or replace
  directory LMV instead of setxattr(XATTR_NAME_LMV".set").

Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: Iac226f9e0e504f19837e14e93cee2542a2cb5e3d
Reviewed-on: https://review.whamcloud.com/37634
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/md_object.h
lustre/lfsck/lfsck_namespace.c
lustre/lfsck/lfsck_striped_dir.c
lustre/lod/lod_internal.h
lustre/lod/lod_object.c
lustre/mdd/mdd_dir.c
lustre/mdd/mdd_internal.h
lustre/mdd/mdd_object.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_xattr.c