mirror of
https://github.com/minio/minio.git
synced 2025-11-24 19:46:16 -05:00
Fix OS X build
- Explicitly cast statfs_t members to int64 (this structure is platform-specific) - Add pass-through New methods to Darwin SHA package - Move scsi pkg types to common translation unit (package was empty) - Add stub implementations mount/disk ops for OS X
This commit is contained in:
@@ -31,16 +31,6 @@ import (
|
||||
"github.com/minio/minio/pkg/iodine"
|
||||
)
|
||||
|
||||
// Mountinfo container to capture /etc/mtab mount structure
|
||||
type Mountinfo struct {
|
||||
FSName string /* name of mounted filesystem */
|
||||
Dir string /* filesystem path prefix */
|
||||
Type string /* mount type (see mntent.h) */
|
||||
Opts string /* mount options (see mntent.h) */
|
||||
Freq int /* dump frequency in days */
|
||||
Passno int /* pass number on parallel fsck */
|
||||
}
|
||||
|
||||
var supportedFSType = map[string]bool{
|
||||
"ext4": true,
|
||||
"xfs": true,
|
||||
|
||||
23
pkg/utils/scsi/mountinfo_darwin.go
Normal file
23
pkg/utils/scsi/mountinfo_darwin.go
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Mini Object Storage, (C) 2014 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package scsi
|
||||
|
||||
// GetMountInfo - get mount info map
|
||||
func GetMountInfo() (map[string]Mountinfo, error) {
|
||||
// Stub implementation; returns an empty map
|
||||
return make(map[string]Mountinfo), nil
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build linux,amd64
|
||||
|
||||
/*
|
||||
* Mini Object Storage, (C) 2014 Minio, Inc.
|
||||
*
|
||||
@@ -25,6 +23,22 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Attributes Scsi device attributes
|
||||
type Attributes map[string]string
|
||||
|
||||
// Disks is a list of scsis disks and attributes
|
||||
type Disks map[string]Attributes
|
||||
|
||||
// Mountinfo container to capture /etc/mtab mount structure
|
||||
type Mountinfo struct {
|
||||
FSName string /* name of mounted filesystem */
|
||||
Dir string /* filesystem path prefix */
|
||||
Type string /* mount type (see mntent.h) */
|
||||
Opts string /* mount options (see mntent.h) */
|
||||
Freq int /* dump frequency in days */
|
||||
Passno int /* pass number on parallel fsck */
|
||||
}
|
||||
|
||||
func getattrs(scsiAttrPath string, scsiAttrList []string) map[string]string {
|
||||
attrMap := make(map[string]string)
|
||||
for _, attr := range scsiAttrList {
|
||||
|
||||
@@ -28,12 +28,6 @@ import (
|
||||
|
||||
// NOTE : supporting virtio based scsi devices is out of scope for this implementation
|
||||
|
||||
// Attributes Scsi device attributes
|
||||
type Attributes map[string]string
|
||||
|
||||
// Disks is a list of scsis disks and attributes
|
||||
type Disks map[string]Attributes
|
||||
|
||||
// Get get disk scsi params
|
||||
func (d Disks) Get(disk string) Attributes {
|
||||
return d[disk]
|
||||
|
||||
23
pkg/utils/scsi/scsi_darwin.go
Normal file
23
pkg/utils/scsi/scsi_darwin.go
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Minimalist Object Storage, (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package scsi
|
||||
|
||||
// GetDisks - get system devices list
|
||||
func GetDisks() (Disks, error) {
|
||||
// Stub implementation; returns empty disk information
|
||||
return Disks{}, nil
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build linux,amd64
|
||||
|
||||
/*
|
||||
* Minimalist Object Storage, (C) 2015 Minio, Inc.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user