2022-04-03 06:14:37 +08:00
|
|
|
package mount
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2022-04-03 12:34:26 +08:00
|
|
|
"fmt"
|
2022-04-03 06:14:37 +08:00
|
|
|
"github.com/chrislusf/seaweedfs/weed/glog"
|
|
|
|
"github.com/chrislusf/seaweedfs/weed/pb/mount_pb"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (wfs *WFS) Configure(ctx context.Context, request *mount_pb.ConfigureRequest) (*mount_pb.ConfigureResponse, error) {
|
2022-04-03 12:34:26 +08:00
|
|
|
if wfs.option.Collection == "" {
|
|
|
|
return nil, fmt.Errorf("mount quota only works when mounted to a new folder with a collection")
|
|
|
|
}
|
2022-04-03 06:14:37 +08:00
|
|
|
glog.V(0).Infof("quota changed from %d to %d", wfs.option.Quota, request.CollectionCapacity)
|
|
|
|
wfs.option.Quota = request.GetCollectionCapacity()
|
|
|
|
return &mount_pb.ConfigureResponse{}, nil
|
|
|
|
}
|