Skip to content

Commit

Permalink
eosfs: Fix one minor warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabrizio Furano committed Mar 19, 2021
1 parent f2e244e commit cf6da42
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/eosclient/eosgrpc/eosgrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -705,18 +705,18 @@ func (c *Client) GetQuota(ctx context.Context, username, rootUID, rootGID, path
for i := 0; i < len(resp.Quota.Quotanode); i++ {
log.Debug().Str("func", "GetQuota").Str("rootuid,rootgid", rootUID+","+rootGID).Str("quotanode:", fmt.Sprintf("%d: %#v", i, resp.Quota.Quotanode[i])).Msg("")

mx := uint64(resp.Quota.Quotanode[i].Maxlogicalbytes) - uint64(resp.Quota.Quotanode[i].Usedbytes)
mx := int64(resp.Quota.Quotanode[i].Maxlogicalbytes) - int64(resp.Quota.Quotanode[i].Usedbytes)
if mx < 0 {
mx = 0
}
qi.AvailableBytes += mx
qi.AvailableBytes += uint64(mx)
qi.UsedBytes += resp.Quota.Quotanode[i].Usedbytes

mx = uint64(resp.Quota.Quotanode[i].Maxfiles) - uint64(resp.Quota.Quotanode[i].Usedfiles)
mx = int64(resp.Quota.Quotanode[i].Maxfiles) - int64(resp.Quota.Quotanode[i].Usedfiles)
if mx < 0 {
mx = 0
}
qi.AvailableInodes += mx
qi.AvailableInodes += uint64(mx)
qi.UsedInodes += resp.Quota.Quotanode[i].Usedfiles
}

Expand Down

0 comments on commit cf6da42

Please sign in to comment.