Skip to content

Commit

Permalink
eosfs: Fix two minor warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabrizio Furano committed Mar 22, 2021
1 parent 9423a36 commit 07a5e51
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/eosclient/eosgrpc/eosgrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ type Client struct {
cl erpc.EosClient
}

// GetHttpCl creates an http client for immediate usage, using the already instantiated resources
// GetHTTPCl creates an http client for immediate usage, using the already instantiated resources
func (c *Client) GetHTTPCl() *ehttp.EosHttpClient {
return ehttp.New(&c.opt.httpopts)
}
Expand Down 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 := resp.Quota.Quotanode[i].Maxlogicalbytes - 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 = resp.Quota.Quotanode[i].Maxfiles - 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 07a5e51

Please sign in to comment.