mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rbd: disable rbd_discard_on_zeroed_write_same for thick-allocation
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
5522a05f59
commit
74d218df8d
@ -32,6 +32,8 @@ type ClusterConnection struct {
|
||||
// FIXME: temporary reference for credentials. Remove this when go-ceph
|
||||
// is used for operations.
|
||||
Creds *Credentials
|
||||
|
||||
discardOnZeroedWriteSameDisabled bool
|
||||
}
|
||||
|
||||
var (
|
||||
@ -92,3 +94,22 @@ func (cc *ClusterConnection) GetFSAdmin() (*ca.FSAdmin, error) {
|
||||
|
||||
return ca.NewFromConn(cc.conn), nil
|
||||
}
|
||||
|
||||
// DisableDiscardOnZeroedWriteSame enables the
|
||||
// `rbd_discard_on_zeroed_write_same` option in the cluster connection, so that
|
||||
// writing zero blocks of data are actual writes on the OSDs (doing
|
||||
// allocations) and not discard calls. This makes writes much slower, but
|
||||
// enables the option to do thick-provisioning.
|
||||
func (cc *ClusterConnection) DisableDiscardOnZeroedWriteSame() error {
|
||||
if cc.discardOnZeroedWriteSameDisabled {
|
||||
return nil
|
||||
}
|
||||
|
||||
err := cc.conn.SetConfigOption("rbd_discard_on_zeroed_write_same", "false")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cc.discardOnZeroedWriteSameDisabled = true
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user