mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
daemon/graphdriver: normalize comment formatting
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
6625fa6103
commit
ec4bc83258
7 changed files with 9 additions and 10 deletions
|
@ -134,7 +134,7 @@ func parseOptions(opt []string) (btrfsOptions, bool, error) {
|
||||||
|
|
||||||
// Driver contains information about the filesystem mounted.
|
// Driver contains information about the filesystem mounted.
|
||||||
type Driver struct {
|
type Driver struct {
|
||||||
//root of the file system
|
// root of the file system
|
||||||
home string
|
home string
|
||||||
uidMaps []idtools.IDMap
|
uidMaps []idtools.IDMap
|
||||||
gidMaps []idtools.IDMap
|
gidMaps []idtools.IDMap
|
||||||
|
|
|
@ -143,7 +143,7 @@ func DirCopy(srcDir, dstDir string, copyMode Mode, copyXattrs bool) error {
|
||||||
|
|
||||||
switch mode := f.Mode(); {
|
switch mode := f.Mode(); {
|
||||||
case mode.IsRegular():
|
case mode.IsRegular():
|
||||||
//the type is 32bit on mips
|
// the type is 32bit on mips
|
||||||
id := fileID{dev: uint64(stat.Dev), ino: stat.Ino} // nolint: unconvert
|
id := fileID{dev: uint64(stat.Dev), ino: stat.Ino} // nolint: unconvert
|
||||||
if copyMode == Hardlink {
|
if copyMode == Hardlink {
|
||||||
isHardlink = true
|
isHardlink = true
|
||||||
|
|
|
@ -67,8 +67,7 @@ func TestCopyDir(t *testing.T) {
|
||||||
if srcFileSys.Dev == dstFileSys.Dev {
|
if srcFileSys.Dev == dstFileSys.Dev {
|
||||||
assert.Check(t, srcFileSys.Ino != dstFileSys.Ino)
|
assert.Check(t, srcFileSys.Ino != dstFileSys.Ino)
|
||||||
}
|
}
|
||||||
// Todo: check size, and ctim is not equal
|
// Todo: check size, and ctim is not equal on filesystems that have granular ctimes
|
||||||
/// on filesystems that have granular ctimes
|
|
||||||
assert.Check(t, is.DeepEqual(srcFileSys.Mode, dstFileSys.Mode))
|
assert.Check(t, is.DeepEqual(srcFileSys.Mode, dstFileSys.Mode))
|
||||||
assert.Check(t, is.DeepEqual(srcFileSys.Uid, dstFileSys.Uid))
|
assert.Check(t, is.DeepEqual(srcFileSys.Uid, dstFileSys.Uid))
|
||||||
assert.Check(t, is.DeepEqual(srcFileSys.Gid, dstFileSys.Gid))
|
assert.Check(t, is.DeepEqual(srcFileSys.Gid, dstFileSys.Gid))
|
||||||
|
|
|
@ -119,7 +119,7 @@ type DeviceSet struct {
|
||||||
deletionWorkerTicker *time.Ticker
|
deletionWorkerTicker *time.Ticker
|
||||||
uidMaps []idtools.IDMap
|
uidMaps []idtools.IDMap
|
||||||
gidMaps []idtools.IDMap
|
gidMaps []idtools.IDMap
|
||||||
minFreeSpacePercent uint32 //min free space percentage in thinpool
|
minFreeSpacePercent uint32 // min free space percentage in thinpool
|
||||||
xfsNospaceRetries string // max retries when xfs receives ENOSPC
|
xfsNospaceRetries string // max retries when xfs receives ENOSPC
|
||||||
lvmSetupConfig directLVMConfig
|
lvmSetupConfig directLVMConfig
|
||||||
}
|
}
|
||||||
|
@ -1692,8 +1692,8 @@ func (devices *DeviceSet) initDevmapper(doInit bool) (retErr error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//create the root dir of the devmapper driver ownership to match this
|
// create the root dir of the devmapper driver ownership to match this
|
||||||
//daemon's remapped root uid/gid so containers can start properly
|
// daemon's remapped root uid/gid so containers can start properly
|
||||||
uid, gid, err := idtools.GetRootUIDGID(devices.uidMaps, devices.gidMaps)
|
uid, gid, err := idtools.GetRootUIDGID(devices.uidMaps, devices.gidMaps)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -110,7 +110,7 @@ func testChangeLoopBackSize(t *testing.T, delta, expectDataSize, expectMetaDataS
|
||||||
if err := driver.Cleanup(); err != nil {
|
if err := driver.Cleanup(); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
//Reload
|
// Reload
|
||||||
d, err := Init(driver.home, []string{
|
d, err := Init(driver.home, []string{
|
||||||
fmt.Sprintf("dm.loopdatasize=%d", defaultDataLoopbackSize+delta),
|
fmt.Sprintf("dm.loopdatasize=%d", defaultDataLoopbackSize+delta),
|
||||||
fmt.Sprintf("dm.loopmetadatasize=%d", defaultMetaDataLoopbackSize+delta),
|
fmt.Sprintf("dm.loopmetadatasize=%d", defaultMetaDataLoopbackSize+delta),
|
||||||
|
|
|
@ -29,7 +29,7 @@ var (
|
||||||
drivers map[string]InitFunc
|
drivers map[string]InitFunc
|
||||||
)
|
)
|
||||||
|
|
||||||
//CreateOpts contains optional arguments for Create() and CreateReadWrite()
|
// CreateOpts contains optional arguments for Create() and CreateReadWrite()
|
||||||
// methods.
|
// methods.
|
||||||
type CreateOpts struct {
|
type CreateOpts struct {
|
||||||
MountLabel string
|
MountLabel string
|
||||||
|
|
|
@ -53,7 +53,7 @@ func mountFrom(dir, device, target, mType string, flags uintptr, label string) e
|
||||||
w.Close()
|
w.Close()
|
||||||
return fmt.Errorf("mountfrom error on re-exec cmd: %v", err)
|
return fmt.Errorf("mountfrom error on re-exec cmd: %v", err)
|
||||||
}
|
}
|
||||||
//write the options to the pipe for the untar exec to read
|
// write the options to the pipe for the untar exec to read
|
||||||
if err := json.NewEncoder(w).Encode(options); err != nil {
|
if err := json.NewEncoder(w).Encode(options); err != nil {
|
||||||
w.Close()
|
w.Close()
|
||||||
return fmt.Errorf("mountfrom json encode to pipe failed: %v", err)
|
return fmt.Errorf("mountfrom json encode to pipe failed: %v", err)
|
||||||
|
|
Loading…
Reference in a new issue