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 91cb5c4 commit f2e244e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/eosclient/eosgrpc/eosgrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -704,16 +704,15 @@ func (c *Client) GetQuota(ctx context.Context, username, rootUID, rootGID, path
// If there are many for this node, we sum them up
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("")
var mx uint64

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

mx = resp.Quota.Quotanode[i].Maxfiles - resp.Quota.Quotanode[i].Usedfiles
mx = uint64(resp.Quota.Quotanode[i].Maxfiles) - uint64(resp.Quota.Quotanode[i].Usedfiles)
if mx < 0 {
mx = 0
}
Expand Down

0 comments on commit f2e244e

Please sign in to comment.