In the DNE environment, usually we want to get free indoes on the
master MDT but not the whole filesystem.
Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I3bbae177ba556eaa7a7cdb582448c94d24c57bfb
Reviewed-on: http://review.whamcloud.com/7375
Tested-by: Hudson
Reviewed-by: Jian Yu <jian.yu@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
require_inode=$((file_count * thrhi))
# get available inode for mdt
- avail_mdt_inode=$(lfs_df -i $MOUNT | grep "summary" | awk '{print $4}')
+ avail_mdt_inode=$(mdt_free_inodes 0)
avail_mdt_inode=$((avail_mdt_inode * 9 / 10))
# get available inode for ost
[ "$SLOW" = "no" ] && LIMIT=1024 # 1k inodes
- local FREE_INODES=$(lfs_df -i | grep "summary" | awk '{print $4}')
+ local FREE_INODES=$(mdt_free_inodes 0)
+ echo "$FREE_INODES free inodes on master MDT"
[ $FREE_INODES -lt $LIMIT ] &&
skip "not enough free inodes $FREE_INODES required $LIMIT" &&
return
test_24v() {
local NRFILES=100000
- local FREE_INODES=$(lfs_df -i | grep "summary" | awk '{print $4}')
+ local FREE_INODES=$(mdt_free_inodes 0)
[ $FREE_INODES -lt $NRFILES ] && \
skip "not enough free inodes $FREE_INODES required $NRFILES" &&
return
$LFS df $* | sed -e 's/filesystem /filesystem_/'
}
+# Get free inodes on the MDT specified by mdt index, free indoes on
+# the whole filesystem will be returned when index == -1.
+mdt_free_inodes() {
+ local index=$1
+ local free_inodes
+ local mdt_uuid
+
+ if [ $index -eq -1 ]; then
+ mdt_uuid="summary"
+ else
+ mdt_uuid=$(mdtuuid_from_index $index)
+ fi
+
+ free_inodes=$(lfs_df -i $MOUNT | grep $mdt_uuid | awk '{print $4}')
+ echo $free_inodes
+}
+
setup_quota(){
if [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.3.50) ]; then
setup_quota_old $1