+mds_sec_level_switch() {
+ [ $# -lt 1 ] && echo "Miss mds sec level switch value" && return 1
+
+ case $1 in
+ 0) echo "Disable capa for all clients";;
+ 1) echo "Enable capa for remote client";;
+ 3) echo "Enable capa for all clients";;
+ *) echo "Invalid mds sec level switch value" && return 2;;
+ esac
+
+ do_facet $SINGLEMDS "lctl set_param -n $MDSSECLEVEL=$1"
+ return 0
+}
+
+oss_sec_level_switch() {
+ [ $# -lt 1 ] && echo "Miss oss sec level switch value" && return 1
+
+ case $1 in
+ 0) echo "Disable capa for all clients";;
+ 1) echo "Enable capa for remote client";;
+ 3) echo "Enable capa for all clients";;
+ *) echo "Invalid oss sec level switch value" && return 2;;
+ esac
+
+ for i in `seq $OSTCOUNT`; do
+ local j=`expr $i - 1`
+ local OST="`do_facet ost$i "lctl get_param -N obdfilter.\*OST\*$j/stats 2>/dev/null | cut -d"." -f2" || true`"
+ [ -z "$OST" ] && return 3
+ do_facet ost$i "lctl set_param -n obdfilter.$OST.sec_level=$1"
+ done
+ return 0
+}
+