LU-1934 echo: echo client to work over OFD

- echo client doesn't call obd_alloc/free_memmd() to underlaying
  device but implement own methods
- Use real lu_env in the prep/commitrw calls
- fill OBD_BRW_ASYNC flag for async writes

Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
Change-Id: Ic02d4c2ad08693cd47d8dff5e8a86812a1534763
Reviewed-on: http://review.whamcloud.com/4146
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: wangdi <di.wang@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1943 zfs-osd: different fixes for zfs

- echo_create_md_object() to mark la_mode is valid

- ofd_statfs() to set avail/free blocks to 2 when the counters
  are converted to 4K units. otherwise with zfs 2 blocks of size
  128K can be > 0.01% leading to failures in sanity/27*

- zfs-osd to initialize LMA

- zfs-osd's osd_attr_get() to calculate size of directory from
  blocks and do not use cached size (as we don't control it as
  with regular files)

- zfs-osd to track enabled/disabled status for SA and follow it

- take from orion additional locking in osd_object_sa_dirty_add()
  and osd_object_sa_dirty_rele()

- lu_cache_shrink() do not purge objects if __GFP_FS is not set
  this should prevent deadlock when used with zfs backend

- ost_checksum_bulk() to allocate new page to simulate corruption,
  otherwise it corrupts zfs's internal buffers which do not rely
  on PageUptoDate flag

- t-f to modprobe zfs module if osd-zfs is in use

Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Change-Id: I027483162735cd0fb4be9fa8bd12c2f2dc43b44a
Reviewed-on: http://review.whamcloud.com/4141
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
LU-2075 fld: use predefined FIDs

and let OSD do mapping to the names internally.

Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Change-Id: Ibfaf9ae210d91dd32c3bb0a21c1078042596197a
Reviewed-on: http://review.whamcloud.com/4158
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: wangdi <di.wang@whamcloud.com>
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-2068 build: Respect "--without-ldiskfs" option

The "--without-ldiskfs" configure option was not properly
being respected by a few of the Makefiles. This change is
an attempt to remedy this issue. Now, one should be able
to disable building ldiskfs and the related lvfs and osd
code with "--without-ldiskfs".

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Change-Id: I502e125639a60f62a37e3f95ecc943dedc37f5ea
Reviewed-on: http://review.whamcloud.com/4148
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-1337 build: fix build on powerpc64

Previous LU-1337 commit ca512093cd29e79ff8a43d4cd921058163305784
broke the build on powerpc64 by changing the way system type is
looked up, but failing to adjust the sed pattern to match the
$target_cpu name.

Change-Id: Ie0c8166f80c5361a8e89ab447c2025a31824914d
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/4149
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-2078 ofd: drop locking in ofd_sync

Improve concurrency by dropping the write lock around
dt_object_sync(). This is safe because all consistency
related to a single object is supposed to be maintained
by the osd internally.  In this case:

  1) osd_object_sync() doesn't rely on the object at all:
     global sync is called
  2) even if object is being destroyed at the same time -
     we're holding a reference, so we're safe
  3) dt_version_get() -> osd_xattr_get() has own internal
     locking, protecting xattr consistency to improve
     concurrency

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Prakash Surya <surya1@llnl.gov>
Change-Id: I60c5b6a1d10afc717a24e7471071f1e2fdb89c29
Reviewed-on: http://review.whamcloud.com/4117
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-1537 libcfs: 64-bit values are l64 on powerpc

The Linux kernel defines 64-bit values as 'long' rather than 'long long'
for user space applications on powerpc. Previously Lustre would assume
64-bit values were 'long long', which would cause compilation errors for
user space application when compiled on powerpc machines. This change
removes this assumption, correctly defining 64-bit types on powerpc.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Change-Id: I99f210e9402d3b2aea1a1ee5458b670387f65323
Reviewed-on: http://review.whamcloud.com/3127
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1749 llog: MDT should work if cancel llog failed with -ESTALE

Cancel catlog may be stale, in this case MDT should continue to work.

Signed-off-by: Lai Siyao <laisiyao@whamcloud.com>
Change-Id: Ib8cad1e2c935e73da0805875e3163f1a59edaeb5
Reviewed-on: http://review.whamcloud.com/3708
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1943 echo: echo_client to get attributes like MDT does

with changes in MDT/MDD the echo_client start working not-correctly,
it uses always 0-stiped files because gets mdsize == 0 from MDD.

- All attributes should be taken explicitely from MDD. Introduce
echo_attr_get_complex() and use it.
- don't use md_getsize_max(), it is not supported anymore.
- fix error handling issues
- remove obsoleted code

Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
Change-Id: I6f1277018d4b8716aa2e799e99aea6402c04b605
Reviewed-on: http://review.whamcloud.com/4164
Tested-by: Hudson
Reviewed-by: wangdi <di.wang@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-2076 osp: fix typo in osp2fsname

Fix name converstion problem for ospname-->fsname.

Signed-off-by: Wang Di <di.wang@whamcloud.com>
Change-Id: I402639e0b5bce49af844e7979b290267e689c9dc
Reviewed-on: http://review.whamcloud.com/4157
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
LU-1855 build: fix 'out-of-bounds access' errors

Fix 'out-of-bounds access' defects found by Coverity version 6.0.3:
Out-of-bounds access (OVERRUN_STATIC)
Overrunning static array by passing it to a
function which indexes it at a higher byte position.

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: Ic0fd90787ef969c786e9b0149df83491cdddc631
Reviewed-on: http://review.whamcloud.com/3902
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>