Small improvements related to packet quota handling.
This commit is contained in:
parent
5637091ea2
commit
b05ce2184e
@ -2,8 +2,9 @@ package de.hsadmin.hostsharing;
|
||||
|
||||
public class QuotaLimit {
|
||||
|
||||
public static final double USER_HARD_FACTOR = 1.50;
|
||||
public static final double GROUP_HARD_FACTOR = 1.50;
|
||||
public static final double INODE_LIMIT_FACTOR = 0.25;
|
||||
public static final double BLOCK_QUOTA_FACTOR = 1.00;
|
||||
public static final double BLOCK_LIMIT_FACTOR = 1.50;
|
||||
public static final double FILE_QUOTA_FACTOR = 0.10;
|
||||
public static final double FILE_LIMIT_FACTOR = 0.15;
|
||||
|
||||
}
|
||||
|
@ -147,10 +147,10 @@ public class PacProcessorFactory implements EntityProcessorFactory {
|
||||
quota = pacComponent.getQuantity() * 1024;
|
||||
}
|
||||
}
|
||||
int blocksSoft = quota;
|
||||
int blocksHard = ((Double) (quota * QuotaLimit.GROUP_HARD_FACTOR)).intValue();
|
||||
int inodesSoft = ((Double) (quota * QuotaLimit.INODE_LIMIT_FACTOR)).intValue();
|
||||
int inodesHard = ((Double) (quota * QuotaLimit.INODE_LIMIT_FACTOR)).intValue();
|
||||
int blocksSoft = ((Double) (quota * QuotaLimit.BLOCK_QUOTA_FACTOR)).intValue();
|
||||
int blocksHard = ((Double) (quota * QuotaLimit.BLOCK_LIMIT_FACTOR)).intValue();
|
||||
int inodesSoft = ((Double) (quota * QuotaLimit.FILE_QUOTA_FACTOR)).intValue();
|
||||
int inodesHard = ((Double) (quota * QuotaLimit.FILE_QUOTA_FACTOR)).intValue();
|
||||
return new ShellProcessor("setquota -g " + pac.getName() + " "
|
||||
+ blocksSoft + " " + blocksHard + " "
|
||||
+ inodesSoft + " " + inodesHard + " "
|
||||
|
@ -90,9 +90,6 @@ public class UnixUserProcessorFactory implements EntityProcessorFactory {
|
||||
quotaHard = new Integer(0);
|
||||
} else {
|
||||
quotaHard = quotaHard * 1024;
|
||||
}
|
||||
if (quotaHard.intValue() < quotaSoft.intValue()) {
|
||||
quotaHard = ((Double) (quotaSoft * QuotaLimit.USER_HARD_FACTOR)).intValue();
|
||||
}
|
||||
aCP.appendProcessor(new ShellProcessor("setquota -u "
|
||||
+ user.getName() + " " + quotaSoft + " "
|
||||
|
Loading…
Reference in New Issue
Block a user