1
0
mirror of https://github.com/gluster/glusterd2.git synced 2026-02-05 12:45:38 +01:00

volgen: quota support for volgen changes

Fixes: #1111 and #1190
Signed-off-by: Aravinda VK <avishwan@redhat.com>
This commit is contained in:
Aravinda VK
2018-09-06 21:20:55 +05:30
committed by Atin Mukherjee
parent f704fc87f0
commit 341e02a0df
2 changed files with 8 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ import (
"path"
"github.com/gluster/glusterd2/glusterd2/daemon"
"github.com/gluster/glusterd2/glusterd2/volgen"
"github.com/gluster/glusterd2/glusterd2/volume"
"github.com/gluster/glusterd2/glusterd2/xlator"
"github.com/gluster/glusterd2/pkg/errors"
@@ -80,6 +81,10 @@ func (actor *quotadActor) Do(v *volume.Volinfo, key, value string, volOp xlator.
} else {
logger.Info("quotad stopped for restart")
}
err = volgen.ClusterVolfileToFile(v, quotadDaemon.VolfileID, "quotad")
if err != nil {
return err
}
if err = daemon.Start(quotadDaemon, true, logger); err != nil {
logger.WithError(err).Error("quotad start failed")
}

View File

@@ -24,7 +24,7 @@ type Quotad struct {
pidfilepath string
logfilepath string
volname string
volFileID string
VolfileID string
// For internal use
}
@@ -46,11 +46,9 @@ func (q *Quotad) Args() []string {
if shost == "" {
shost = "127.0.0.1"
}
q.volFileID = "gluster/quotad"
q.args = []string{}
q.args = append(q.args, "-s", shost)
q.args = append(q.args, "--volfile-id", q.volFileID)
q.args = append(q.args, "--volfile-id", q.VolfileID)
q.args = append(q.args, "-p", q.PidFile())
q.args = append(q.args, "-S", q.SocketFile())
q.args = append(q.args, "-l", q.logfilepath)
@@ -95,7 +93,7 @@ func NewQuotad() (*Quotad, error) {
)
return &Quotad{binarypath: binarypath, pidfilepath: pidfilepath,
logfilepath: logfilepath}, nil
logfilepath: logfilepath, VolfileID: "gluster/quotad"}, nil
}
// ID returns the unique identifier of the quota.