LU-5164 osd: Limit lu_object cache

For OSDs like ZFS to perform optimally it's import that they be allowed
to manage their own cache.  This maximizes the likelyhood that the ARC
will prefetch and cache the right buffers.  In the existing ZFS OSD
code a cached LU object pins buffers in the ARC preventing them from
being dropped.  As the LU cache grows it can consume the entire ARC
preventing buffers for other objects, such as the OIs, from being
cached and severely impacting the performance for FID lookups.

By default this patch will only limit the LU cache for ZFS OSDs.

NOTES:

* Setting LU_CACHE_NR_ZFS_LIMIT to 0 results in an LBUG on the MDS.
  This may be because an object is being used without a reference.
  Setting a minimum value of 256 was arbitrary, ideally we would
  set this value to 0.

* In order to be able to quickly determine the number of objects in
  the hash table the CFS_HASH_COUNTER flag is added.  This adds an
  atomic_inc/dec to the hash insert/remove paths but is not expected
  to have any measurable impact of performance.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Change-Id: Ia64838d50395f1d22e558631adbfa39d44e91606
Patch-Set: 3
Reviewed-on: http://review.whamcloud.com/10237
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>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4929 lfs: Add lfs dirstripe to the manpage

Add lfs-setdirstripe.1, lfs-getdirstripe and
lfs-mkdir.1 to the manpage.

Add -m mode to "lfs mkdir" help, and also mention lfs
setdirstripe can only be done on MDT0 with adminitrator
right.

lfs getdirstripe should honor -O MDTUUID to list the
stripe information of subdirectories located on that MDT.

Remove unnecessary error message in cb_getstripe.

Fix the default getdirstripe behavior, which should list all of
its subdirectories stripe pattern, like lfs getstripe.

Fix format of LMV stripe information.

Change-Id: I7ee6ef3d6df5df50e35f5874a27e176884d79704
Signed-off-by: Wang Di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/10643
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5150 mdc: Handle empty but non-zero acl xattr

We have found that posix_acl_access can have a value
of \002\000\000\000.  In that case body->aclsize is
non-zero, but the there are no actuall acls stored
in the xattr.

In mdc_unpack_acl(), it only checks IS_ERR() on the
pointer returned by posix_acl_from_xattr(), it does not
check for NULL.  Because of the above situation, the
xattr aclsize can be non-zero, but posic_acl_from_xattr()
still returns NULL.  Passing NULL to posix_acl_valid()
crashes the kernel.

We add a check to properly handle the NULL return value.

Change-Id: Ib4f623642b86db2c88923a27cd9e77c870f301af
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/10620
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5221 vvp: release mmap_sem in error case

The mmap_sem is downed in vvp_mmap_locks, but in case of
error from cl_io_lock_alloc_add, it is not upped.

Credit to Paul Casella at Cray for finding this.

Signed-off-by: Patrick Farrell <paf@cray.com>
Change-Id: If172e7cb4c4e6400143d76eee8aa595ae767a20c
Reviewed-on: http://review.whamcloud.com/10741
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>