LU-2674 osp: set proper connection flag

Set proper connection flag for the osp-on-ost.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: Idf80df593f22309565c92630f5c04fc3781e3d34
Reviewed-on: http://review.whamcloud.com/5167
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-1445 osp: Use FID to track precreate cache.

Change last_used/pre_used/pre_created_id to real fid, so
to track precreate cache with real fid.

For simplicity, precreate/orphan_cleanup between osp and
OFD must be within the same sequence.

Precreate process will be:

1. OSP will request one sequence from OST initially.

2. During precreation, osp will allocate a group of fids
for the precreation request within the current sequence,
then send the request to OST(OFD) with these fids.

3. When getting the precreate request, OST will precreate
the objects by those fids in the request.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: Ib7f1016321c064656158c54f4475922a199e19b3
Reviewed-on: http://review.whamcloud.com/4789
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
LU-1445 osp: rollover to the new seq synchronously

For simplicity, OSP will track only one sequence for precreation,
so it will need

1. Stop precreation when the current sequence is about to used up,
until all of the precreation objects has been used up.

2. ofd will precreate objects synchronously when the current sequence
is about to used up.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I4c0de8f2869c9a8e7a4b0d2abe06041e84885b2e
Reviewed-on: http://review.whamcloud.com/4790
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
LU-1445 osd: add fld look up in osd.

Lookup FLDB during oi_insert, so we know it is MDT or
OST objects. And it also needs to init FLD service
on OFD as well, so object on OST can lookup FLDB
as well.

Change fci_lock to read/write lock, since fld_cache_lookup
will become the hot path after FLD lookup is added in OSD
layer.

Change-Id: I79ef723de603214b7136a51c36f0cb63513b5640
Signed-off-by: Wang Di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/4330
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
LU-1445 osd: Add multiple sequence support for osd-zfs

Add osd_seq_list for osd-zfs, then it can allocate new sequence
after FID on OST is landed.

Test-Parameters: mdtfilesystemtype=zfs ostfilesystemtype=zfs
Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I66bae3987a1ae167aa48a3a1d4b6e50f300f1dd8
Reviewed-on: http://review.whamcloud.com/4837
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
LU-1445 fld: allow fld lookup during recovery

Allow fld lookup during recovery process, so OST can send fld
lookup req to MDT0 during recovery phase, instead of waiting
the recovery is done.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I69990eb4225d98f20ce2dc197cd3c16b5c6f9617
Reviewed-on: http://review.whamcloud.com/4919
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
LU-1445 mdt: allow lightweight connection even if no OST

MDT should allow lightweight connection from OST even if there
is no OST being activated, because OST might need do FLD lookup
during recovery phase.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: Ica44aafdbcbf29f10d314bc65de8c1f5ff5d2940
Reviewed-on: http://review.whamcloud.com/4920
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
LU-1506 ldlm: correct lock res build for FID on OST

Because 1.8/2.1/2.2 client always put oid to res[0] and
oseq to res[1], OFD will do the same to avoid incompatible
problems.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: Ic4cf66b1bc23631af42530787796510653f82a61
Reviewed-on: http://review.whamcloud.com/3081
Tested-by: Hudson
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>