You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
588 B

  1. package mount
  2. import (
  3. "context"
  4. "fmt"
  5. "github.com/chrislusf/seaweedfs/weed/glog"
  6. "github.com/chrislusf/seaweedfs/weed/pb/mount_pb"
  7. )
  8. func (wfs *WFS) Configure(ctx context.Context, request *mount_pb.ConfigureRequest) (*mount_pb.ConfigureResponse, error) {
  9. if wfs.option.Collection == "" {
  10. return nil, fmt.Errorf("mount quota only works when mounted to a new folder with a collection")
  11. }
  12. glog.V(0).Infof("quota changed from %d to %d", wfs.option.Quota, request.CollectionCapacity)
  13. wfs.option.Quota = request.GetCollectionCapacity()
  14. return &mount_pb.ConfigureResponse{}, nil
  15. }