aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/weedfs_grpc_server.go
blob: 245f8c70ad65324740285341e0967f6d700d3dcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package mount

import (
	"context"
	"fmt"
	"github.com/seaweedfs/seaweedfs/weed/util/log"
	"github.com/seaweedfs/seaweedfs/weed/pb/mount_pb"
)

func (wfs *WFS) Configure(ctx context.Context, request *mount_pb.ConfigureRequest) (*mount_pb.ConfigureResponse, error) {
	if wfs.option.Collection == "" {
		return nil, fmt.Errorf("mount quota only works when mounted to a new folder with a collection")
	}
	log.V(3).Infof("quota changed from %d to %d", wfs.option.Quota, request.CollectionCapacity)
	wfs.option.Quota = request.GetCollectionCapacity()
	return &mount_pb.ConfigureResponse{}, nil
}