mirror of
https://github.com/versity/scoutfs-go.git
synced 2025-12-23 13:15:19 +00:00
Merge pull request #8 from versity/ben/quota_string
add StringNoLimit to quota rule
This commit is contained in:
31
scoutfs.go
31
scoutfs.go
@@ -1244,6 +1244,37 @@ func (q QuotaRule) String() string {
|
||||
return q.Raw(false)
|
||||
}
|
||||
|
||||
func (q QuotaRule) StringNoLimit() string {
|
||||
switch q.QuotaSource[2] {
|
||||
case quotaLiteral:
|
||||
return fmt.Sprintf("P: %*v %*v Literal",
|
||||
prioPad, q.Prioirity, opPad, q.Op)
|
||||
case quotaUID:
|
||||
if q.QuotaFlags[2] == quotaSelect {
|
||||
return fmt.Sprintf("P: %*v %*v UID [%5v]",
|
||||
prioPad, q.Prioirity, opPad, q.Op, q.QuotaValue[2])
|
||||
}
|
||||
return fmt.Sprintf("P: %*v %*v UID general",
|
||||
prioPad, q.Prioirity, opPad, q.Op)
|
||||
case quotaGID:
|
||||
if q.QuotaFlags[2] == quotaSelect {
|
||||
return fmt.Sprintf("P: %*v %*v GID [%5v]",
|
||||
prioPad, q.Prioirity, opPad, q.Op, q.QuotaValue[2])
|
||||
}
|
||||
return fmt.Sprintf("P: %*v %*v GID general",
|
||||
prioPad, q.Prioirity, opPad, q.Op)
|
||||
case quotaProj:
|
||||
if q.QuotaFlags[2] == quotaSelect {
|
||||
return fmt.Sprintf("P: %*v %*v Proj [%5v]",
|
||||
prioPad, q.Prioirity, opPad, q.Op, q.QuotaValue[2])
|
||||
}
|
||||
return fmt.Sprintf("P: %*v %*v Proj general",
|
||||
prioPad, q.Prioirity, opPad, q.Op)
|
||||
}
|
||||
|
||||
return q.Raw(false)
|
||||
}
|
||||
|
||||
func (q QuotaRule) HumanString() string {
|
||||
limit := fmt.Sprintf("%v", q.Limit)
|
||||
if q.Op == QuotaData {
|
||||
|
||||
Reference in New Issue
Block a user