udf: create common function for changing free space counter