Whamcloud - gitweb
LU-11025 osd: osd_attr_get() returns dirent count
For osd-ldiskfs, to get dirent count it needs to iterate directory
entries and sum it up, while for osd-zfs, zap_count() can get it
from ZAP directly.
Add a new field 'la_dirent_count' in struct lu_attr, and set it
to directory entry count in osd_attr_get() if object is directory, and
this value will be cached in osd_object for osd-ldiskfs, if directory
is newly created, it will be set to '0', and later index_insert/delete
will update its value, so the following osd_attr_get() can use the
cached value.
Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: If4225aecdba1c428d64d97c35b6c982c4932a265
Reviewed-on: https://review.whamcloud.com/38097
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>