basic change for godoc

This commit is contained in:
Lei Xue
2016-11-27 13:31:43 +08:00
parent c5f96b7af4
commit bd7193880e
13 changed files with 59 additions and 30 deletions

View File

@@ -0,0 +1,18 @@
/*
Copyright 2016 The GoStor Authors All rights reserved.
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 backingstore provides the plugin to connect backend storage.
package backingstore

View File

@@ -164,7 +164,7 @@ write:
glog.V(2).Infof("write data at %d for length %d", offset, length)
var pg *api.ModePage
for _, p := range lu.ModePages {
if p.Pcode == 0x08 && p.SubPcode == 0 {
if p.PageCode == 0x08 && p.SubPageCode == 0 {
pg = &p
break
}

View File

@@ -1,5 +1,5 @@
/*
Copyright 2015 The GoStor Authors All rights reserved.
Copyright 2016 The GoStor Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -20,7 +20,7 @@ import "errors"
type SCSIError struct {
errno byte
Err error
err error
}
var (
@@ -58,7 +58,7 @@ var (
type SCSISubError uint16
var (
/* Key 0: No Sense Errors */
// Key 0: No Sense Errors
NO_ADDITIONAL_SENSE SCSISubError = 0x0000
ASC_MARK SCSISubError = 0x0001
ASC_EOM SCSISubError = 0x0002
@@ -67,14 +67,14 @@ var (
ASC_OP_IN_PROGRESS SCSISubError = 0x0016
ASC_DRIVE_REQUIRES_CLEANING SCSISubError = 0x8282
/* Key 1: Recovered Errors */
// Key 1: Recovered Errors
ASC_WRITE_ERROR SCSISubError = 0x0c00
ASC_READ_ERROR SCSISubError = 0x1100
ASC_RECOVERED_WITH_RETRYS SCSISubError = 0x1701
ASC_MEDIA_LOAD_EJECT_ERROR SCSISubError = 0x5300
ASC_FAILURE_PREDICTION SCSISubError = 0x5d00
/* Key 2: Not ready */
// Key 2: Not ready
ASC_CAUSE_NOT_REPORTABLE SCSISubError = 0x0400
ASC_BECOMING_READY SCSISubError = 0x0401
ASC_INITIALIZING_REQUIRED SCSISubError = 0x0402
@@ -83,7 +83,7 @@ var (
ASC_MEDIUM_NOT_PRESENT SCSISubError = 0x3a00
ASC_LOGICAL_UNIT_NOT_CONFIG SCSISubError = 0x3e00
/* Key 3: Medium Errors */
// Key 3: Medium Errors
ASC_UNRECOVERED_READ SCSISubError = 0x1100
ASC_RECORDED_ENTITY_NOT_FOUND SCSISubError = 0x1400
ASC_UNKNOWN_FORMAT SCSISubError = 0x3001
@@ -94,7 +94,7 @@ var (
ASC_CARTRIDGE_FAULT SCSISubError = 0x5200
ASC_MEDIA_LOAD_OR_EJECT_FAILED SCSISubError = 0x5300
/* Key 4: Hardware Failure */
// Key 4: Hardware Failure
ASC_COMPRESSION_CHECK SCSISubError = 0x0c04
ASC_DECOMPRESSION_CRC SCSISubError = 0x110d
ASC_MECHANICAL_POSITIONING_ERROR SCSISubError = 0x1501
@@ -103,7 +103,7 @@ var (
ASC_INTERNAL_TGT_FAILURE SCSISubError = 0x4400
ASC_ERASE_FAILURE SCSISubError = 0x5100
/* Key 5: Illegal Request */
// Key 5: Illegal Request
ASC_PARAMETER_LIST_LENGTH_ERR SCSISubError = 0x1a00
ASC_INVALID_OP_CODE SCSISubError = 0x2000
ASC_LBA_OUT_OF_RANGE SCSISubError = 0x2100
@@ -120,7 +120,7 @@ var (
ASC_INSUFFICENT_REGISTRATION_RESOURCES SCSISubError = 0x5504
ASC_BAD_MICROCODE_DETECTED SCSISubError = 0x8283
/* Key 6: Unit Attention */
// Key 6: Unit Attention
ASC_NOT_READY_TO_TRANSITION SCSISubError = 0x2800
ASC_POWERON_RESET SCSISubError = 0x2900
ASC_I_T_NEXUS_LOSS_OCCURRED SCSISubError = 0x2907
@@ -134,10 +134,10 @@ var (
ASC_REPORTED_LUNS_DATA_HAS_CHANGED SCSISubError = 0x3f0e
ASC_FAILURE_PREDICTION_FALSE SCSISubError = 0x5dff
/* Data Protect */
// Data Protect
ASC_WRITE_PROTECT SCSISubError = 0x2700
ASC_MEDIUM_OVERWRITE_ATTEMPTED SCSISubError = 0x300c
/* Miscompare */
// Miscompare
ASC_MISCOMPARE_DURING_VERIFY_OPERATION SCSISubError = 0x1d00
)

View File

@@ -22,10 +22,8 @@ import (
"github.com/gostor/gotgt/pkg/api"
)
/*
* path format <protocol>:/absolute/file/path
*/
// NewSCSILu: create a new SCSI LU
// path format <protocol>:/absolute/file/path
func NewSCSILu(device_uuid uint64, path string, online bool) (*api.SCSILu, error) {
pathinfo := strings.SplitN(path, ":", 2)
@@ -60,6 +58,7 @@ func NewSCSILu(device_uuid uint64, path string, online bool) (*api.SCSILu, error
return lu, nil
}
// NewLUN0: create a new fake SCSI LU
func NewLUN0() *api.SCSILu {
sbc := NewSBCDevice(api.TYPE_UNKNOWN)

View File

@@ -66,7 +66,7 @@ func (sbc SBCSCSIDeviceProtocol) InitLu(lu *api.SCSILu) error {
lu.Attrs.SenseFormat = false
lu.Attrs.VendorID = SCSIVendorID
lu.Attrs.ProductID = SCSIProductID
lu.Attrs.ProductRev = version.SCSI_VERSION
lu.Attrs.ProductRev = version.SCSIVersion
/*
SCSIID for PAGE83 T10 VENDOR IDENTIFICATION field