Whamcloud - gitweb
LU-3569 ofd: packing ost_idx in IDIF 53/7053/10
authorFan Yong <fan.yong@intel.com>
Sun, 24 Nov 2013 08:59:00 +0000 (16:59 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 9 Jan 2014 23:47:30 +0000 (23:47 +0000)
commitda12d3ba35bbb86c8e5860a5ed161a55f01b69d5
treebea8a0af049f96db320d3727764a445f717f4d6e
parente02e613f411d4273c9c1c99ee88121e641ddb4c2
LU-3569 ofd: packing ost_idx in IDIF

For a normal FID, we can know on which target the related object
is allocated via querying FLDB; but it is not true for an IDIF.

To locate the OST via the given IDIF, when the IDIF is generated,
we pack the OST index in it. Then for any given FID, in spite of
it is a normal FID or not, we has the method to know which target
it belongs to. That is useful for LFSCK.

For old IDIF, the OST index is not part of the IDIF, means that
different OSTs may have the same IDIFs, that may cause the IFID
in LMA does not match the read FID. Under such case, we need to
make some compatible check to avoid to trigger unexpected.

tgt_validate_obdo() converts the ostid contained in the RPC body
to fid and changes the "struct ost_id" union, then the users can
access ost_id::oi_fid directly without call ostid_to_fid() again.

It also contains some other fixing and cleanup.

Test-Parameters: testlist=sanity-scrub
Signed-off-by: wang di <di.wang@intel.com>
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I228f2f6cd9310193a1724046cee15e3b2103c8e2
Reviewed-on: http://review.whamcloud.com/7053
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
17 files changed:
lustre/include/lu_target.h
lustre/include/lustre/lustre_idl.h
lustre/include/lustre_fid.h
lustre/lfsck/lfsck_engine.c
lustre/lfsck/lfsck_internal.h
lustre/lfsck/lfsck_lib.c
lustre/lod/lod_lov.c
lustre/lod/lod_object.c
lustre/obdclass/llog_swab.c
lustre/ofd/ofd_dev.c
lustre/ofd/ofd_fs.c
lustre/ofd/ofd_io.c
lustre/ofd/ofd_lvb.c
lustre/ofd/ofd_obd.c
lustre/ofd/ofd_objects.c
lustre/osd-ldiskfs/osd_handler.c
lustre/target/tgt_handler.c