Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
jacobsa-fuse
Commits
d599dcd2
Commit
d599dcd2
authored
May 01, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split up convert.go a bit.
parent
83f6f835
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
55 deletions
+91
-55
fuseops/common_op.go
fuseops/common_op.go
+73
-0
fuseops/convert.go
fuseops/convert.go
+0
-55
fuseops/doc.go
fuseops/doc.go
+18
-0
No files found.
fuseops/common_op.go
0 → 100644
View file @
d599dcd2
// Copyright 2015 Google Inc. 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
fuseops
import
(
"sync"
"github.com/jacobsa/bazilfuse"
"golang.org/x/net/context"
)
// A helper for embedding common behavior.
type
commonOp
struct
{
opType
string
ctx
context
.
Context
r
bazilfuse
.
Request
log
func
(
int
,
string
,
...
interface
{})
opsInFlight
*
sync
.
WaitGroup
}
func
(
o
*
commonOp
)
init
(
opType
string
,
r
bazilfuse
.
Request
,
log
func
(
int
,
string
,
...
interface
{}),
opsInFlight
*
sync
.
WaitGroup
)
{
o
.
opType
=
opType
o
.
ctx
=
context
.
Background
()
o
.
r
=
r
o
.
log
=
log
o
.
opsInFlight
=
opsInFlight
}
func
(
o
*
commonOp
)
Header
()
OpHeader
{
bh
:=
o
.
r
.
Hdr
()
return
OpHeader
{
Uid
:
bh
.
Uid
,
Gid
:
bh
.
Gid
,
}
}
func
(
o
*
commonOp
)
Context
()
context
.
Context
{
return
o
.
ctx
}
func
(
o
*
commonOp
)
Logf
(
format
string
,
v
...
interface
{})
{
const
calldepth
=
2
o
.
log
(
calldepth
,
format
,
v
...
)
}
func
(
o
*
commonOp
)
respondErr
(
err
error
)
{
if
err
==
nil
{
panic
(
"Expect non-nil here."
)
}
o
.
Logf
(
"-> (%s) error: %v"
,
o
.
opType
,
err
)
o
.
r
.
RespondError
(
err
)
}
fuseops/convert.go
View file @
d599dcd2
...
...
@@ -12,9 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// Package fuseops contains implementations of the fuse.Op interface that may
// be returned by fuse.Connection.ReadOp. See documentation in that package for
// more.
package
fuseops
import
(
...
...
@@ -23,7 +20,6 @@ import (
"time"
"github.com/jacobsa/bazilfuse"
"golang.org/x/net/context"
)
// Convert the supplied bazilfuse request struct to an Op, returning nil if it
...
...
@@ -264,54 +260,3 @@ func convertChildInodeEntry(
out
.
AttrValid
=
convertExpirationTime
(
in
.
AttributesExpiration
)
out
.
EntryValid
=
convertExpirationTime
(
in
.
EntryExpiration
)
}
// A helper for embedding common behavior.
type
commonOp
struct
{
opType
string
ctx
context
.
Context
r
bazilfuse
.
Request
log
func
(
int
,
string
,
...
interface
{})
opsInFlight
*
sync
.
WaitGroup
}
func
(
o
*
commonOp
)
init
(
opType
string
,
r
bazilfuse
.
Request
,
log
func
(
int
,
string
,
...
interface
{}),
opsInFlight
*
sync
.
WaitGroup
)
{
o
.
opType
=
opType
o
.
ctx
=
context
.
Background
()
o
.
r
=
r
o
.
log
=
log
o
.
opsInFlight
=
opsInFlight
}
func
(
o
*
commonOp
)
Header
()
OpHeader
{
bh
:=
o
.
r
.
Hdr
()
return
OpHeader
{
Uid
:
bh
.
Uid
,
Gid
:
bh
.
Gid
,
}
}
func
(
o
*
commonOp
)
Context
()
context
.
Context
{
return
o
.
ctx
}
func
(
o
*
commonOp
)
Logf
(
format
string
,
v
...
interface
{})
{
const
calldepth
=
2
o
.
log
(
calldepth
,
format
,
v
...
)
}
func
(
o
*
commonOp
)
respondErr
(
err
error
)
{
if
err
==
nil
{
panic
(
"Expect non-nil here."
)
}
o
.
Logf
(
"-> (%s) error: %v"
,
o
.
opType
,
err
)
o
.
r
.
RespondError
(
err
)
}
fuseops/doc.go
0 → 100644
View file @
d599dcd2
// Copyright 2015 Google Inc. 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 fuseops contains implementations of the fuse.Op interface that may
// be returned by fuse.Connection.ReadOp. See documentation in that package for
// more.
package
fuseops
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment