Skip to content

Commit

Permalink
cleanup: reduce struct padding
Browse files Browse the repository at this point in the history
internal/rbd/rbd_util.go:89:15: struct of size 312 bytes could be of
size 304 bytes:
``
struct{
	RbdImageName   	string,
	ImageID        	string,
	VolID          	string,
	Monitors       	string,
	JournalPool    	string,
	Pool           	string,
	RadosNamespace 	string,
	ClusterID      	string,
	RequestName    	string,
	NamePrefix     	string,
	ParentName     	string,
	ParentPool     	string,
	ClusterName    	string,
	Owner          	string,
	VolSize        	int64,
	StripeCount    	uint64,
	StripeUnit     	uint64,
	ObjectSize     	uint64,
	ImageFeatureSet	github.com/ceph/go-ceph/rbd.FeatureSet,
	encryption
*github.com/ceph/ceph-csi/internal/util.VolumeEncryption,
	CreatedAt
*google.golang.org/protobuf/types/known/timestamppb.Timestamp,
	conn
*github.com/ceph/ceph-csi/internal/util.ClusterConnection,
	ioctx          	*github.com/ceph/go-ceph/rados.IOContext,
	Primary        	bool,
	EnableMetadata 	bool,
}
`` (maligned)
type rbdImage struct {
              ^}`
make: *** [Makefile:118: go-lint] Error 1

Signed-off-by: Prasanna Kumar Kalever <[email protected]>
  • Loading branch information
Prasanna Kumar Kalever authored and mergify[bot] committed Jun 28, 2022
1 parent 29a3f4a commit 9fa3c83
Showing 1 changed file with 18 additions and 22 deletions.
40 changes: 18 additions & 22 deletions internal/rbd/rbd_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,7 @@ type rbdImage struct {
ImageID string
// VolID is the volume ID that is exchanged with CSI drivers,
// identifying this rbd image
VolID string `json:"volID"`

// VolSize is the size of the RBD image backing this rbdImage.
VolSize int64

// image striping configurations.
StripeCount uint64
StripeUnit uint64
ObjectSize uint64

VolID string `json:"volID"`
Monitors string
// JournalPool is the ceph pool in which the CSI Journal/CSI snapshot Journal is
// stored
Expand All @@ -121,31 +112,36 @@ type rbdImage struct {
// config maps in v1.0.0
RequestName string
NamePrefix string

// ParentName represents the parent image name of the image.
ParentName string
// Parent Pool is the pool that contains the parent image.
ParentPool string
ImageFeatureSet librbd.FeatureSet
// Primary represent if the image is primary or not.
Primary bool

ParentPool string
// Cluster name
ClusterName string
// Set metadata on volume
EnableMetadata bool

// encryption provides access to optional VolumeEncryption functions
encryption *util.VolumeEncryption
// Owner is the creator (tenant, Kubernetes Namespace) of the volume
Owner string

CreatedAt *timestamp.Timestamp
// VolSize is the size of the RBD image backing this rbdImage.
VolSize int64

// image striping configurations.
StripeCount uint64
StripeUnit uint64
ObjectSize uint64

ImageFeatureSet librbd.FeatureSet
// encryption provides access to optional VolumeEncryption functions
encryption *util.VolumeEncryption
CreatedAt *timestamp.Timestamp
// conn is a connection to the Ceph cluster obtained from a ConnPool
conn *util.ClusterConnection
// an opened IOContext, call .openIoctx() before using
ioctx *rados.IOContext

// Primary represent if the image is primary or not.
Primary bool
// Set metadata on volume
EnableMetadata bool
}

// rbdVolume represents a CSI volume and its RBD image specifics.
Expand Down

0 comments on commit 9fa3c83

Please sign in to comment.