quota_on(): refactor and fix

This is more of a fix than proper refactoring.

So what I tried to achieve is:

1. Return proper code (one of VZ_DQ_ON, VZ_DQ_INIT, VZ_DQ_SET)
   depending on what really failed.

2. Do not print errorneous "vzquota on failed" with wrong exit code
   for the case of failed quota_init() or quota_set(). Note that
   quota_init() and quota_set() print their own error messages
   and return correct code (which can be used as an exit code).

3. Do not run quota_init() for the second time, if quota_on()
   still returns "no quota file".

4. Make this mess a bit more clear, easier to read and follow.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed